Skip to content

Commit

Permalink
fix: customisable switch custom name not displayed (EdgeTX#5193)
Browse files Browse the repository at this point in the history
  • Loading branch information
3djc authored Jun 18, 2024
1 parent e750934 commit e596fc5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion radio/src/switches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,12 @@ void switchSetCustomName(uint8_t idx, const char* str, size_t len)

const char* switchGetCustomName(uint8_t idx)
{
return _switchNames[idx];
#if defined(FUNCTION_SWITCHES)
if (idx >= switchGetMaxSwitches()) // Switch is a customisable switch
return g_model.switchNames[idx - switchGetMaxSwitches()];
else
#endif
return _switchNames[idx];
}

bool switchHasCustomName(uint8_t idx)
Expand Down

0 comments on commit e596fc5

Please sign in to comment.