1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

LP-518 Only disable link for OPlink protocols, not OpenLRS.

This commit is contained in:
Laurent Lalanne 2018-08-14 00:41:11 +02:00
parent 36f361d6a1
commit 7a97907504

View File

@ -131,6 +131,7 @@ static uint8_t i2c_error_activity[PIOS_I2C_ERROR_COUNT_NUMELEM];
#ifdef PIOS_INCLUDE_RFM22B
static uint8_t previousRFXtalCap;
static uint8_t protocol;
static void oplinkSettingsUpdatedCb(UAVObjEvent *ev);
#endif
@ -239,6 +240,8 @@ static void systemTask(__attribute__((unused)) void *parameters)
// Initialize previousRFXtalCap used by callback
OPLinkSettingsRFXtalCapGet(&previousRFXtalCap);
OPLinkSettingsConnectCallback(oplinkSettingsUpdatedCb);
// Get protocol
OPLinkSettingsProtocolGet(&protocol);
#endif
#ifdef DIAG_TASKS
@ -332,7 +335,7 @@ static void systemTask(__attribute__((unused)) void *parameters)
oplinkStatus.RXSeq = radio_stats.rx_seq;
oplinkStatus.LinkState = radio_stats.link_state;
} else {
} else if (protocol != OPLINKSETTINGS_PROTOCOL_OPENLRS) {
oplinkStatus.LinkState = OPLINKSTATUS_LINKSTATE_DISABLED;
}
OPLinkStatusSet(&oplinkStatus);