altos: Add timeout in MS5607 get_sample code
authorKeith Packard <keithp@keithp.com>
Tue, 6 Dec 2022 03:26:42 +0000 (19:26 -0800)
committerKeith Packard <keithp@keithp.com>
Sun, 18 Dec 2022 02:12:24 +0000 (18:12 -0800)
commit560767497057c08a6fc3bc24aaba23a8d6192259
tree52420d89737cd9eb0e7e2eb26543c0cbdce65997
parent4af1fba120644f38e91bae283c9ff2ef32c2e49c
altos: Add timeout in MS5607 get_sample code

MISO is supposed to rise when the sample value is ready, but sometimes
we miss the interrupt which should be generated. I spent a day
attempting to fix this, but was unable to make it 100%. Instead, add a
10ms timeout, which is longer than the sample time (8.2ms), and then
read MISO directly. If the interrupt fires, we'll read a bit sooner.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_ms5607.c