diff --git a/lib/sensor_sdm120.c b/lib/sensor_sdm120.c index f3a421c..eff2ae0 100644 --- a/lib/sensor_sdm120.c +++ b/lib/sensor_sdm120.c @@ -63,14 +63,14 @@ static volatile uint8_t tx_used = 0; /**< number of byte to transmit */ volatile bool sensor_sdm120_measurement_received = false; -/**< the ModBus timeouts to respect for sending messages **/ +/** the ModBus timeouts to respect for sending messages **/ static enum timeout_t { TIMEOUT_BEGIN = 0, /**< silent time before sending data */ TIMEOUT_END, /**< silent time after sending data */ TIMEOUT_BETWEEN, /**< time to wait between messages */ - TIMEOUT_MAX -} timeout; -/**< current timeout used */ + TIMEOUT_MAX /**< last element (useful to no the number of elements) */ +} timeout; /**< the current timeout used */ +/** current timeout used */ static uint16_t timeout_times[TIMEOUT_MAX] = {0}; /** SDM120 3xxxx input register start addresses for the measurement types */ @@ -343,6 +343,7 @@ void USART_ISR(SENSOR_SDM120_USART)(void) } } +/** interrupt service routine called on timeout */ void TIM_ISR(SENSOR_SDM120_TIMER)(void) { if (timer_get_flag(TIM(SENSOR_SDM120_TIMER), TIM_SR_UIF)) { // update event happened