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:
parent
ad3f5a8e3a
commit
77caedcda2
1 changed files with 7 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue