1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

OP-1067 Force oplonk to report disabled if rfm22b is not initialized.

This commit is contained in:
Mathieu Rondonneau 2013-08-28 19:45:50 -07:00
parent 151d44b8e7
commit fc6d544476

View File

@ -149,6 +149,7 @@ static void systemTask(__attribute__((unused)) void *parameters)
struct rfm22b_stats radio_stats;
PIOS_RFM22B_GetStats(pios_rfm22b_id, &radio_stats);
if (pios_rfm22b_id) {
// Update the status
oplinkStatus.HeapRemaining = xPortGetFreeHeapSize();
oplinkStatus.DeviceID = PIOS_RFM22B_DeviceID(pios_rfm22b_id);
@ -179,6 +180,11 @@ static void systemTask(__attribute__((unused)) void *parameters)
oplinkStatus.TXSeq = radio_stats.tx_seq;
oplinkStatus.RXSeq = radio_stats.rx_seq;
oplinkStatus.LinkState = radio_stats.link_state;
} else {
oplinkStatus.LinkState = OPLINKSTATUS_LINKSTATE_DISABLED;
}
if (radio_stats.link_state == OPLINKSTATUS_LINKSTATE_CONNECTED) {
LINK_LED_ON;
} else {