Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: DISCO-L072CZ-LRWAN1-base
Fork of SX1276GenericLib by
Diff: sx1276/sx1276-mbed-hal.cpp
- Revision:
- 42:72deced1a4c4
- Parent:
- 41:2dbc4afedf61
- Child:
- 43:90de42f3c1fd
- Child:
- 44:544add59b26d
--- 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 )
