1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +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:
timecop 2012-08-15 08:47:23 +00:00
parent e894dba995
commit 9a842f6bb0
3 changed files with 9 additions and 9 deletions

View file

@ -268,7 +268,7 @@ void getEstimatedAltitude(void)
int32_t temp32;
int16_t last;
if (currentTime < deadLine)
if ((int32_t)(currentTime - deadLine) < 0)
return;
deadLine = currentTime + UPDATE_INTERVAL;