feat(radio): refactor of switch handling to better support customisable switches (#6095)
Co-authored-by: philmoz <phil.a.mitchell@gmail.com> Co-authored-by: 3djc <3djc@gh.com> Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
co-authored by
philmoz
3djc
elecpower
parent
28833f42e6
commit
0c8c39b134
@@ -420,19 +420,19 @@ char *getFlightModeString(char *dest, int8_t idx)
|
||||
return dest;
|
||||
}
|
||||
|
||||
char *getCustomSwitchesGroupName(char *dest, uint8_t idx)
|
||||
char* getCustomSwitchesGroupName(char *dest, uint8_t idx)
|
||||
{
|
||||
dest = strAppendStringWithIndex(dest, "GR", idx + 1);
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
char *getSwitchName(char *dest, uint8_t idx, bool defaultOnly)
|
||||
char* getSwitchName(char *dest, uint8_t idx, bool defaultOnly)
|
||||
{
|
||||
if (!defaultOnly && switchHasCustomName(idx)) {
|
||||
dest = strAppend(dest, switchGetCustomName(idx), LEN_SWITCH_NAME);
|
||||
if (!defaultOnly && g_model.switchHasCustomName(idx)) {
|
||||
dest = strAppend(dest, g_model.getSwitchCustomName(idx), LEN_SWITCH_NAME);
|
||||
} else {
|
||||
dest = strAppend(dest, switchGetName(idx), LEN_SWITCH_NAME);
|
||||
dest = strAppend(dest, switchGetDefaultName(idx), LEN_SWITCH_NAME);
|
||||
}
|
||||
|
||||
return dest;
|
||||
|
||||
Reference in New Issue
Block a user