1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-19 14:25:16 +03:00

Limit I2C GPS retry rate to 1/500ms. Prevent I2C bus from being flooded by failed I2C transactions when no I2C-GPS is present

This commit is contained in:
Konstantin Sharlaimov (DigitalEntity) 2015-11-26 22:41:05 +10:00
parent ad3f5a8e3a
commit 77caedcda2

View file

@ -402,6 +402,13 @@ bool gpsDetectI2C(void)
void gpsInitI2C(void)
{
static uint32_t lastRetryMillis = 0;
if ((millis() - lastRetryMillis) < 500)
return;
lastRetryMillis = millis();
switch(gpsData.state) {
case GPS_INITIALIZING:
case GPS_CHANGE_BAUD: