All my comments from the PR fixed. Still missing the Companion part
This commit is contained in:
+11
-3
@@ -451,7 +451,8 @@ PACK(struct ModuleData {
|
|||||||
int8_t refreshRate; // definition as framelength for ppm (* 5 + 225 = time in 1/10 ms)
|
int8_t refreshRate; // definition as framelength for ppm (* 5 + 225 = time in 1/10 ms)
|
||||||
} sbus);
|
} sbus);
|
||||||
NOBACKUP(PACK(struct {
|
NOBACKUP(PACK(struct {
|
||||||
uint8_t receivers; // 5 bits spare
|
uint8_t receiver:7; // 4 bits spare
|
||||||
|
uint8_t racingMode:1;
|
||||||
char receiverName[PXX2_MAX_RECEIVERS_PER_MODULE][PXX2_LEN_RX_NAME];
|
char receiverName[PXX2_MAX_RECEIVERS_PER_MODULE][PXX2_LEN_RX_NAME];
|
||||||
}) pxx2);
|
}) pxx2);
|
||||||
NOBACKUP(PACK(struct {
|
NOBACKUP(PACK(struct {
|
||||||
@@ -475,14 +476,21 @@ PACK(struct ModuleData {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Helper functions to set both of the rfProto protocol at the same time
|
// Helper functions to set both of the rfProto protocol at the same time
|
||||||
NOBACKUP(inline uint8_t getMultiProtocol() {
|
NOBACKUP(inline uint8_t getMultiProtocol() const
|
||||||
|
{
|
||||||
return ((uint8_t) (rfProtocol & 0x0F)) + (multi.rfProtocolExtra << 4);
|
return ((uint8_t) (rfProtocol & 0x0F)) + (multi.rfProtocolExtra << 4);
|
||||||
})
|
})
|
||||||
|
|
||||||
NOBACKUP(inline void setMultiProtocol(uint8_t proto) {
|
NOBACKUP(inline void setMultiProtocol(uint8_t proto)
|
||||||
|
{
|
||||||
rfProtocol = (uint8_t) (proto & 0x0F);
|
rfProtocol = (uint8_t) (proto & 0x0F);
|
||||||
multi.rfProtocolExtra = (proto & 0x70) >> 4;
|
multi.rfProtocolExtra = (proto & 0x70) >> 4;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
NOBACKUP(inline uint8_t getChannelsCount() const
|
||||||
|
{
|
||||||
|
return channelsCount + 8;
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case FUNC_RACING_MODE:
|
case FUNC_RACING_MODE:
|
||||||
if (isRacingModeAllowed()) {
|
if (isRacingModeEnabled()) {
|
||||||
newActiveFunctions |= (1u << FUNCTION_RACING_MODE);
|
newActiveFunctions |= (1u << FUNCTION_RACING_MODE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1236,8 +1236,8 @@ void menuModelSetup(event_t event)
|
|||||||
case ITEM_MODEL_SETUP_INTERNAL_MODULE_RACING_MODE:
|
case ITEM_MODEL_SETUP_INTERNAL_MODULE_RACING_MODE:
|
||||||
{
|
{
|
||||||
ModuleData & moduleData = g_model.moduleData[moduleIdx];
|
ModuleData & moduleData = g_model.moduleData[moduleIdx];
|
||||||
lcdDrawTextAlignedLeft(y, STR_RACING_MODE);
|
lcdDrawText(INDENT_WIDTH, y, STR_RACING_MODE);
|
||||||
moduleState[moduleIdx].racingMode = editCheckBox(moduleState[moduleIdx].racingMode, MODEL_SETUP_2ND_COLUMN, y, "", attr, event);
|
moduleData.pxx2.racingMode = editCheckBox(moduleData.pxx2.racingMode, MODEL_SETUP_2ND_COLUMN, y, "", attr, event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1522,7 +1522,6 @@ void menuModelSetup(event_t event)
|
|||||||
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
setCustomFailsafe(moduleIdx);
|
setCustomFailsafe(moduleIdx);
|
||||||
storageDirty(EE_MODEL);
|
|
||||||
AUDIO_WARNING1();
|
AUDIO_WARNING1();
|
||||||
SEND_FAILSAFE_NOW(moduleIdx);
|
SEND_FAILSAFE_NOW(moduleIdx);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1104,8 +1104,8 @@ void menuModelSetup(event_t event)
|
|||||||
{
|
{
|
||||||
uint8_t moduleIdx = CURRENT_MODULE_EDITED(k);
|
uint8_t moduleIdx = CURRENT_MODULE_EDITED(k);
|
||||||
ModuleData & moduleData = g_model.moduleData[moduleIdx];
|
ModuleData & moduleData = g_model.moduleData[moduleIdx];
|
||||||
lcdDrawTextAlignedLeft(y, STR_RACING_MODE);
|
lcdDrawText(INDENT_WIDTH, y, STR_RACING_MODE);
|
||||||
moduleState[moduleIdx].racingMode = editCheckBox(moduleState[moduleIdx].racingMode, MODEL_SETUP_2ND_COLUMN, y, "", attr, event);
|
moduleData.pxx2.racingMode = editCheckBox(moduleData.pxx2.racingMode, MODEL_SETUP_2ND_COLUMN, y, "", attr, event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1281,7 +1281,6 @@ void menuModelSetup(event_t event)
|
|||||||
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
setCustomFailsafe(moduleIdx);
|
setCustomFailsafe(moduleIdx);
|
||||||
storageDirty(EE_MODEL);
|
|
||||||
AUDIO_WARNING1();
|
AUDIO_WARNING1();
|
||||||
SEND_FAILSAFE_NOW(moduleIdx);
|
SEND_FAILSAFE_NOW(moduleIdx);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1254,8 +1254,8 @@ bool menuModelSetup(event_t event)
|
|||||||
case ITEM_MODEL_SETUP_INTERNAL_MODULE_RACING_MODE:
|
case ITEM_MODEL_SETUP_INTERNAL_MODULE_RACING_MODE:
|
||||||
{
|
{
|
||||||
ModuleData & moduleData = g_model.moduleData[moduleIdx];
|
ModuleData & moduleData = g_model.moduleData[moduleIdx];
|
||||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_RACING_MODE);
|
lcdDrawText(MENUS_MARGIN_LEFT + INDENT_WIDTH, y, STR_RACING_MODE);
|
||||||
moduleState[moduleIdx].racingMode = editCheckBox(moduleState[moduleIdx].racingMode, MODEL_SETUP_2ND_COLUMN, y, "", attr, event);
|
moduleData.pxx2.racingMode = editCheckBox(moduleData.pxx2.racingMode, MODEL_SETUP_2ND_COLUMN, y, "", attr, event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1666,7 +1666,6 @@ bool menuModelSetup(event_t event)
|
|||||||
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
setCustomFailsafe(moduleIdx);
|
setCustomFailsafe(moduleIdx);
|
||||||
storageDirty(EE_MODEL);
|
|
||||||
AUDIO_WARNING1();
|
AUDIO_WARNING1();
|
||||||
SEND_FAILSAFE_NOW(moduleIdx);
|
SEND_FAILSAFE_NOW(moduleIdx);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,10 +186,12 @@ inline uint8_t MODULE_CHANNELS_ROWS(int moduleIdx)
|
|||||||
|
|
||||||
inline bool isRacingModeAllowed()
|
inline bool isRacingModeAllowed()
|
||||||
{
|
{
|
||||||
if (isModulePXX2(INTERNAL_MODULE) && 0 == g_model.moduleData[INTERNAL_MODULE].channelsCount && moduleState[INTERNAL_MODULE].racingMode)
|
return isModulePXX2(INTERNAL_MODULE) && g_model.moduleData[INTERNAL_MODULE].getChannelsCount() == 8;
|
||||||
return true;
|
}
|
||||||
else
|
|
||||||
return false;
|
inline bool isRacingModeEnabled()
|
||||||
|
{
|
||||||
|
return isRacingModeAllowed() && g_model.moduleData[INTERNAL_MODULE].pxx2.racingMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline uint8_t IF_ALLOW_RACING_MODE(int moduleIdx)
|
inline uint8_t IF_ALLOW_RACING_MODE(int moduleIdx)
|
||||||
@@ -197,9 +199,8 @@ inline uint8_t IF_ALLOW_RACING_MODE(int moduleIdx)
|
|||||||
if (!IS_MODULE_ENABLED(moduleIdx)) {
|
if (!IS_MODULE_ENABLED(moduleIdx)) {
|
||||||
return HIDDEN_ROW;
|
return HIDDEN_ROW;
|
||||||
}
|
}
|
||||||
else if (isModulePXX2(moduleIdx)) {
|
else if (isRacingModeAllowed()) {
|
||||||
if (0 == g_model.moduleData[moduleIdx].channelsCount)
|
return 0;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
return HIDDEN_ROW;
|
return HIDDEN_ROW;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ static int luaModelGetModule(lua_State *L)
|
|||||||
lua_pushtableinteger(L, "subType", module.subType);
|
lua_pushtableinteger(L, "subType", module.subType);
|
||||||
lua_pushtableinteger(L, "modelId", g_model.header.modelId[idx]);
|
lua_pushtableinteger(L, "modelId", g_model.header.modelId[idx]);
|
||||||
lua_pushtableinteger(L, "firstChannel", module.channelsStart);
|
lua_pushtableinteger(L, "firstChannel", module.channelsStart);
|
||||||
lua_pushtableinteger(L, "channelsCount", module.channelsCount + 8);
|
lua_pushtableinteger(L, "channelsCount", module.getChannelsCount());
|
||||||
lua_pushtableinteger(L, "Type", module.type);
|
lua_pushtableinteger(L, "Type", module.type);
|
||||||
#if defined(MULTIMODULE)
|
#if defined(MULTIMODULE)
|
||||||
if (module.type == MODULE_TYPE_MULTIMODULE) {
|
if (module.type == MODULE_TYPE_MULTIMODULE) {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ void Pxx2Pulses::addFlag1(uint8_t module)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t flag1 = subType << 4u;
|
uint8_t flag1 = subType << 4u;
|
||||||
if (isFunctionActive(FUNCTION_RACING_MODE)) {
|
if (isRacingModeEnabled() && isFunctionActive(FUNCTION_RACING_MODE)) {
|
||||||
flag1 |= PXX2_CHANNELS_FLAG1_RACING_MODE;
|
flag1 |= PXX2_CHANNELS_FLAG1_RACING_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libACCESS updated: 79a6921d23...63802e6d50
@@ -1225,7 +1225,7 @@
|
|||||||
#define TR_JITTER_FILTER "ADC Filtr"
|
#define TR_JITTER_FILTER "ADC Filtr"
|
||||||
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
||||||
#define TR_AUTH_FAILURE "Auth-failure"
|
#define TR_AUTH_FAILURE "Auth-failure"
|
||||||
#define TR_RACING_MODE INDENT "Racing mode"
|
#define TR_RACING_MODE "Racing mode"
|
||||||
|
|
||||||
#define ZSTR_VFR "VFR"
|
#define ZSTR_VFR "VFR"
|
||||||
#define ZSTR_RSSI "RSSI"
|
#define ZSTR_RSSI "RSSI"
|
||||||
|
|||||||
@@ -1231,7 +1231,7 @@
|
|||||||
#define TR_JITTER_FILTER "ADC Filter"
|
#define TR_JITTER_FILTER "ADC Filter"
|
||||||
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
||||||
#define TR_AUTH_FAILURE "Auth-failure"
|
#define TR_AUTH_FAILURE "Auth-failure"
|
||||||
#define TR_RACING_MODE INDENT "Racing mode"
|
#define TR_RACING_MODE "Racing mode"
|
||||||
|
|
||||||
// ----------------------------------------------------------------
|
// ----------------------------------------------------------------
|
||||||
#define ZSTR_VFR "VFR"
|
#define ZSTR_VFR "VFR"
|
||||||
|
|||||||
@@ -1229,7 +1229,7 @@
|
|||||||
#define TR_JITTER_FILTER "ADC filter"
|
#define TR_JITTER_FILTER "ADC filter"
|
||||||
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
||||||
#define TR_AUTH_FAILURE "Auth-failure"
|
#define TR_AUTH_FAILURE "Auth-failure"
|
||||||
#define TR_RACING_MODE INDENT "Racing mode"
|
#define TR_RACING_MODE "Racing mode"
|
||||||
|
|
||||||
#define ZSTR_VFR "VFR"
|
#define ZSTR_VFR "VFR"
|
||||||
#define ZSTR_RSSI "RSSI"
|
#define ZSTR_RSSI "RSSI"
|
||||||
|
|||||||
@@ -1228,7 +1228,7 @@
|
|||||||
#define TR_JITTER_FILTER "Filtro ADC"
|
#define TR_JITTER_FILTER "Filtro ADC"
|
||||||
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltaje")
|
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltaje")
|
||||||
#define TR_AUTH_FAILURE "Fallo " LCDW_128_480_LINEBREAK "autentificación"
|
#define TR_AUTH_FAILURE "Fallo " LCDW_128_480_LINEBREAK "autentificación"
|
||||||
#define TR_RACING_MODE INDENT "Racing mode"
|
#define TR_RACING_MODE "Racing mode"
|
||||||
|
|
||||||
#define ZSTR_VFR "VFR"
|
#define ZSTR_VFR "VFR"
|
||||||
#define ZSTR_RSSI "RSSI"
|
#define ZSTR_RSSI "RSSI"
|
||||||
|
|||||||
@@ -1237,7 +1237,7 @@
|
|||||||
#define TR_JITTER_FILTER "ADC Filter"
|
#define TR_JITTER_FILTER "ADC Filter"
|
||||||
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
||||||
#define TR_AUTH_FAILURE "Auth-failure"
|
#define TR_AUTH_FAILURE "Auth-failure"
|
||||||
#define TR_RACING_MODE INDENT "Racing mode"
|
#define TR_RACING_MODE "Racing mode"
|
||||||
|
|
||||||
#define ZSTR_VFR "VFR"
|
#define ZSTR_VFR "VFR"
|
||||||
#define ZSTR_RSSI "RSSI"
|
#define ZSTR_RSSI "RSSI"
|
||||||
|
|||||||
@@ -1253,7 +1253,7 @@
|
|||||||
#define TR_JITTER_FILTER "Filtre ADC"
|
#define TR_JITTER_FILTER "Filtre ADC"
|
||||||
#define TR_RTC_CHECK TR("Vérif. RTC", "Vérif. pile RTC")
|
#define TR_RTC_CHECK TR("Vérif. RTC", "Vérif. pile RTC")
|
||||||
#define TR_AUTH_FAILURE "Auth-failure"
|
#define TR_AUTH_FAILURE "Auth-failure"
|
||||||
#define TR_RACING_MODE INDENT "Racing mode"
|
#define TR_RACING_MODE "Racing mode"
|
||||||
|
|
||||||
#define ZSTR_VFR "VFR"
|
#define ZSTR_VFR "VFR"
|
||||||
#define ZSTR_RSSI "RSSI"
|
#define ZSTR_RSSI "RSSI"
|
||||||
|
|||||||
@@ -1246,7 +1246,7 @@
|
|||||||
#define TR_JITTER_FILTER "Filtro ADC"
|
#define TR_JITTER_FILTER "Filtro ADC"
|
||||||
#define TR_RTC_CHECK TR("Controllo RTC", "Controllo volt. RTC")
|
#define TR_RTC_CHECK TR("Controllo RTC", "Controllo volt. RTC")
|
||||||
#define TR_AUTH_FAILURE "Auth-failure"
|
#define TR_AUTH_FAILURE "Auth-failure"
|
||||||
#define TR_RACING_MODE INDENT "Racing mode"
|
#define TR_RACING_MODE "Racing mode"
|
||||||
|
|
||||||
#define ZSTR_VFR "VFR"
|
#define ZSTR_VFR "VFR"
|
||||||
#define ZSTR_RSSI "RSSI"
|
#define ZSTR_RSSI "RSSI"
|
||||||
|
|||||||
@@ -1238,7 +1238,7 @@
|
|||||||
#define TR_JITTER_FILTER "ADC Filter"
|
#define TR_JITTER_FILTER "ADC Filter"
|
||||||
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
||||||
#define TR_AUTH_FAILURE "Auth-failure"
|
#define TR_AUTH_FAILURE "Auth-failure"
|
||||||
#define TR_RACING_MODE INDENT "Racing mode"
|
#define TR_RACING_MODE "Racing mode"
|
||||||
|
|
||||||
#define ZSTR_VFR "VFR"
|
#define ZSTR_VFR "VFR"
|
||||||
#define ZSTR_RSSI "RSSI"
|
#define ZSTR_RSSI "RSSI"
|
||||||
|
|||||||
@@ -1245,7 +1245,7 @@
|
|||||||
#define TR_JITTER_FILTER "ADC Filter"
|
#define TR_JITTER_FILTER "ADC Filter"
|
||||||
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
||||||
#define TR_AUTH_FAILURE "Auth-failure"
|
#define TR_AUTH_FAILURE "Auth-failure"
|
||||||
#define TR_RACING_MODE INDENT "Racing mode"
|
#define TR_RACING_MODE "Racing mode"
|
||||||
|
|
||||||
#define ZSTR_VFR "VFR"
|
#define ZSTR_VFR "VFR"
|
||||||
#define ZSTR_RSSI "RSSI"
|
#define ZSTR_RSSI "RSSI"
|
||||||
|
|||||||
@@ -1245,7 +1245,7 @@
|
|||||||
#define TR_JITTER_FILTER "ADC Filter"
|
#define TR_JITTER_FILTER "ADC Filter"
|
||||||
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
||||||
#define TR_AUTH_FAILURE "Auth-failure"
|
#define TR_AUTH_FAILURE "Auth-failure"
|
||||||
#define TR_RACING_MODE INDENT "Racing mode"
|
#define TR_RACING_MODE "Racing mode"
|
||||||
#define ZSTR_VFR "VFR"
|
#define ZSTR_VFR "VFR"
|
||||||
#define ZSTR_RSSI "RSSI"
|
#define ZSTR_RSSI "RSSI"
|
||||||
#define ZSTR_R9PW "R9PW"
|
#define ZSTR_R9PW "R9PW"
|
||||||
|
|||||||
@@ -1245,7 +1245,7 @@
|
|||||||
#define TR_JITTER_FILTER "ADC Filter"
|
#define TR_JITTER_FILTER "ADC Filter"
|
||||||
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
#define TR_RTC_CHECK TR("Check RTC", "Check RTC voltage")
|
||||||
#define TR_AUTH_FAILURE "Auth-failure"
|
#define TR_AUTH_FAILURE "Auth-failure"
|
||||||
#define TR_RACING_MODE INDENT "Racing mode"
|
#define TR_RACING_MODE "Racing mode"
|
||||||
|
|
||||||
#define ZSTR_VFR "VFR"
|
#define ZSTR_VFR "VFR"
|
||||||
#define ZSTR_RSSI "RSSI"
|
#define ZSTR_RSSI "RSSI"
|
||||||
|
|||||||
Reference in New Issue
Block a user