Merge pull request #210 from rotorman/sf1to64

Show special functions from 1 to 64, instead of 0 to 63
This commit is contained in:
Raphael Coeffic
2021-06-15 08:04:13 +02:00
committed by GitHub
+2 -2
View File
@@ -76,7 +76,7 @@ class SpecialFunctionEditPage : public Page
window, window,
{PAGE_TITLE_LEFT, PAGE_TITLE_TOP + PAGE_LINE_HEIGHT, {PAGE_TITLE_LEFT, PAGE_TITLE_TOP + PAGE_LINE_HEIGHT,
LCD_W - PAGE_TITLE_LEFT, 20}, LCD_W - PAGE_TITLE_LEFT, 20},
(functions == g_model.customFn ? "SF" : "GF") + std::to_string(index), (functions == g_model.customFn ? "SF" : "GF") + std::to_string(index+1),
0, FOCUS_COLOR); 0, FOCUS_COLOR);
} }
@@ -526,7 +526,7 @@ void SpecialFunctionsPage::build(FormWindow *window, int8_t focusIndex)
for (uint8_t i = 0; i < MAX_SPECIAL_FUNCTIONS; i++) { for (uint8_t i = 0; i < MAX_SPECIAL_FUNCTIONS; i++) {
CustomFunctionData *cfn = &functions[i]; CustomFunctionData *cfn = &functions[i];
strAppendUnsigned(&s[2], i); strAppendUnsigned(&s[2], i+1);
if (cfn->swtch == 0) { if (cfn->swtch == 0) {
auto button = new TextButton(window, grid.getLabelSlot(), s); auto button = new TextButton(window, grid.getLabelSlot(), s);