universam1 / iSpindel

electronic Hydrometer
http://www.ispindel.de
Other
827 stars 324 forks source link

Add timeout when waiting for gyro data ready status #591

Closed stuartraetaylor closed 2 years ago

stuartraetaylor commented 2 years ago

Adds a timeout to the loop that waits for accelgyro.getIntDataReadyStatus().

After 30 iterations the loop (same as wifi check), breaks and logs. Whatever readings we get from the gyro are logged as usual.

I recently had a faulty MPU-6050 that hung in this loop -

    while (!accelgyro.getIntDataReadyStatus())
       delay(2);

The iSpindel in this state doesn't send out any readings or log anything to serial. The idea of this PR is to make an MPU-6050 failure easier to troubleshoot in this situation.

universam1 commented 2 years ago

Thank you