mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-21 23:35:30 +03:00
fix for 32bit overflow of currentTime killing baro/mag after 72 minutes (yes, someone noticed)
thanks to enots @ feenode. git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@194 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
parent
e894dba995
commit
9a842f6bb0
3 changed files with 9 additions and 9 deletions
|
@ -243,7 +243,7 @@ void Baro_update(void)
|
|||
{
|
||||
int32_t pressure;
|
||||
|
||||
if (currentTime < baroDeadline)
|
||||
if ((int32_t)(currentTime - baroDeadline) < 0)
|
||||
return;
|
||||
|
||||
baroDeadline = currentTime;
|
||||
|
@ -414,7 +414,7 @@ void Mag_getADC(void)
|
|||
static int16_t magZeroTempMax[3];
|
||||
uint32_t axis;
|
||||
|
||||
if (currentTime < t)
|
||||
if ((int32_t)(currentTime - t) < 0)
|
||||
return; //each read is spaced by 100ms
|
||||
t = currentTime + 100000;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue