LoRa node acquiring analog input and sending to LoRa Server - Working ok
Dependents: DISCO-L072CZ-LRWAN1_LoRa_node EIoT_LoRa_node_1 EIoT_LoRa_node_2 EIoT_LoRa_node_3
Fork of SX1276GenericLib by
Diff: sx1276/sx1276-mbed-hal.cpp
- Revision:
- 42:72deced1a4c4
- Parent:
- 41:2dbc4afedf61
- Child:
- 43:90de42f3c1fd
- Child:
- 44:544add59b26d
diff -r 2dbc4afedf61 -r 72deced1a4c4 sx1276/sx1276-mbed-hal.cpp --- a/sx1276/sx1276-mbed-hal.cpp Mon May 08 15:39:42 2017 +0200 +++ b/sx1276/sx1276-mbed-hal.cpp Mon May 08 22:52:31 2017 +0200 @@ -347,9 +347,30 @@ } } -void SX1276Generic::SetTimeout(Timeout_t timer, int timeout_ms) +void SX1276Generic::SetTimeout(TimeoutTimer_t timer, int timeout_ms) { - + SX1276 *sx = this; + switch(timer) { + case RXTimeoutTimer: + if (timeout_ms) + rxTimeoutTimer.attach_us(callback(sx, &SX1276::OnTimeoutIrq), timeout_ms); + else + rxTimeoutTimer.detach(); + break; + case TXTimeoutTimer: + if (timeout_ms) + txTimeoutTimer.attach_us(callback(sx, &SX1276::OnTimeoutIrq), timeout_ms); + else + txTimeoutTimer.detach(); + break; + case RXTimeoutSyncWorldTimer: + if (timeout_ms) + rxTimeoutSyncWord.attach_us(callback(sx, &SX1276::OnTimeoutIrq), timeout_ms); + else + rxTimeoutSyncWord.detach(); + break; + break; + } } bool SX1276Generic::CheckRfFrequency( uint32_t frequency )