Fixes for targets without external module
This commit is contained in:
committed by
Raphael Coeffic
parent
56eb564b86
commit
66e08da1b8
@@ -798,8 +798,10 @@ const char * FrskyChipFirmwareUpdate::flashFirmware(const char * filename, Progr
|
|||||||
INTERNAL_MODULE_OFF();
|
INTERNAL_MODULE_OFF();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HARDWARE_EXTERNAL_MODULE)
|
||||||
uint8_t extPwr = IS_EXTERNAL_MODULE_ON();
|
uint8_t extPwr = IS_EXTERNAL_MODULE_ON();
|
||||||
EXTERNAL_MODULE_OFF();
|
EXTERNAL_MODULE_OFF();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(SPORT_UPDATE_PWR_GPIO)
|
#if defined(SPORT_UPDATE_PWR_GPIO)
|
||||||
uint8_t spuPwr = IS_SPORT_UPDATE_POWER_ON();
|
uint8_t spuPwr = IS_SPORT_UPDATE_POWER_ON();
|
||||||
|
|||||||
@@ -797,13 +797,14 @@ inline void resetAccessAuthenticationCount()
|
|||||||
|
|
||||||
inline void resetAfhdsOptions(uint8_t moduleIdx)
|
inline void resetAfhdsOptions(uint8_t moduleIdx)
|
||||||
{
|
{
|
||||||
auto & data = g_model.moduleData[moduleIdx];
|
|
||||||
#if defined(AFHDS3)
|
#if defined(AFHDS3)
|
||||||
|
auto & data = g_model.moduleData[moduleIdx];
|
||||||
data.subType = FLYSKY_SUBTYPE_AFHDS3;
|
data.subType = FLYSKY_SUBTYPE_AFHDS3;
|
||||||
data.afhds3.emi = 2; // FCC
|
data.afhds3.emi = 2; // FCC
|
||||||
data.afhds3.telemetry = 1;
|
data.afhds3.telemetry = 1;
|
||||||
data.afhds3.phyMode = 0;
|
data.afhds3.phyMode = 0;
|
||||||
#elif defined(AFHDS2A)
|
#elif defined(AFHDS2A)
|
||||||
|
auto & data = g_model.moduleData[moduleIdx];
|
||||||
data.subType = FLYSKY_SUBTYPE_AFHDS2A;
|
data.subType = FLYSKY_SUBTYPE_AFHDS2A;
|
||||||
data.flysky.setDefault();
|
data.flysky.setDefault();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -258,11 +258,15 @@ static inline void pollExtTelemetryLegacy()
|
|||||||
// - telemetry polling needs to happen for each enabled module
|
// - telemetry polling needs to happen for each enabled module
|
||||||
void telemetryWakeup()
|
void telemetryWakeup()
|
||||||
{
|
{
|
||||||
|
#if defined(HARDWARE_INTERNAL_MODULE)
|
||||||
auto int_drv = getIntModuleDriver();
|
auto int_drv = getIntModuleDriver();
|
||||||
if (int_drv) pollTelemetry(INTERNAL_MODULE, int_drv, getIntModuleCtx());
|
if (int_drv) pollTelemetry(INTERNAL_MODULE, int_drv, getIntModuleCtx());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HARDWARE_EXTERNAL_MODULE)
|
||||||
auto ext_drv = getExtModuleDriver();
|
auto ext_drv = getExtModuleDriver();
|
||||||
if (ext_drv) pollTelemetry(EXTERNAL_MODULE, ext_drv, getExtModuleCtx());
|
if (ext_drv) pollTelemetry(EXTERNAL_MODULE, ext_drv, getExtModuleCtx());
|
||||||
|
#endif
|
||||||
|
|
||||||
// TODO: needs to be moved to protocol/module init
|
// TODO: needs to be moved to protocol/module init
|
||||||
// as-is, it implies only ONE telemetry protocol
|
// as-is, it implies only ONE telemetry protocol
|
||||||
|
|||||||
Reference in New Issue
Block a user