1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

OP-1658 - fix temp interleaving for MS5611

This commit is contained in:
Alessio Morale 2014-12-29 16:46:50 +01:00
parent adbcdecb41
commit 4b01d0d2ea

View File

@ -38,7 +38,7 @@
// Option to change the interleave between Temp and Pressure conversions
// Undef for normal operation
// #define PIOS_MS5611_SLOW_TEMP_RATE 20
#define PIOS_MS5611_SLOW_TEMP_RATE 20
#ifndef PIOS_MS5611_SLOW_TEMP_RATE
#define PIOS_MS5611_SLOW_TEMP_RATE 1
#endif
@ -448,7 +448,8 @@ bool PIOS_MS5611_driver_poll(__attribute__((unused)) uintptr_t context)
case MS5611_FSM_CALCULATE:
temp_press_interleave_count--;
if (temp_press_interleave_count == 0) {
if (!temp_press_interleave_count) {
temp_press_interleave_count = PIOS_MS5611_SLOW_TEMP_RATE;
PIOS_MS5611_StartADC(MS5611_CONVERSION_TYPE_TemperatureConv);
next_state = MS5611_FSM_PRESSURE;
} else {