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

LP-417 Blink link LED on OPLink when not connected.

This commit is contained in:
Brian Webb 2016-09-24 15:10:57 -07:00
parent 9703dd1458
commit f8c69646b7

View File

@ -138,11 +138,6 @@ static void systemTask(__attribute__((unused)) void *parameters)
// Main system loop // Main system loop
while (1) { while (1) {
// Flash the heartbeat LED
#if defined(PIOS_LED_HEARTBEAT)
PIOS_LED_Toggle(PIOS_LED_HEARTBEAT);
#endif /* PIOS_LED_HEARTBEAT */
// Update the OPLinkStatus UAVO // Update the OPLinkStatus UAVO
OPLinkStatusData oplinkStatus; OPLinkStatusData oplinkStatus;
OPLinkStatusGet(&oplinkStatus); OPLinkStatusGet(&oplinkStatus);
@ -192,10 +187,11 @@ static void systemTask(__attribute__((unused)) void *parameters)
oplinkStatus.LinkState = radio_stats.link_state; oplinkStatus.LinkState = radio_stats.link_state;
} }
// Turn on the link/heartbeat ID if we're connected, otherwise flash it.
if (radio_stats.link_state == OPLINKSTATUS_LINKSTATE_CONNECTED) { if (radio_stats.link_state == OPLINKSTATUS_LINKSTATE_CONNECTED) {
LINK_LED_ON; LINK_LED_ON;
} else { } else {
LINK_LED_OFF; LINK_LED_TOGGLE;
} }
// Update the object // Update the object