Skip to content

Commit 8664308

Browse files
committed
changed 128x64 and 212x64 SF SD Logs to same logic as colorlcd with
- minimum log interval 0.1s - maximum log interval 25.5s - default log interval 1.0s TX12_Sim and X9D_Sim tested ok
1 parent 89bee4f commit 8664308

2 files changed

Lines changed: 24 additions & 12 deletions

File tree

radio/src/gui/128x64/model_special_functions.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
#endif
3333

3434
#if defined(SDCARD)
35+
#define SD_LOGS_PERIOD_MIN 1 // 0.1s fastest period
36+
#define SD_LOGS_PERIOD_MAX 255 // 25.5s slowest period
37+
#define SD_LOGS_PERIOD_DEFAULT 10 // 1s default period for newly created SF
38+
3539
void onCustomFunctionsFileSelectionMenu(const char * result)
3640
{
3741
int sub = menuVerticalPosition - HEADER_LINE;
@@ -352,13 +356,15 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
352356
}
353357
#if defined(SDCARD)
354358
else if (func == FUNC_LOGS) {
355-
if (val_displayed) {
356-
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT);
357-
lcdDrawChar(lcdLastRightPos, y, 's');
358-
}
359-
else {
360-
lcdDrawMMM(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, attr);
359+
val_min = SD_LOGS_PERIOD_MIN;
360+
val_max = SD_LOGS_PERIOD_MAX;
361+
362+
if (!val_displayed) {
363+
val_displayed = CFN_PARAM(cfn) = SD_LOGS_PERIOD_DEFAULT;
361364
}
365+
366+
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT);
367+
lcdDrawChar(lcdLastRightPos, y, 's');
362368
}
363369
#endif
364370
#if defined(GVARS)

radio/src/gui/212x64/model_special_functions.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#define MODEL_SPECIAL_FUNC_4TH_COLUMN (33*FW-3)
2828
#define MODEL_SPECIAL_FUNC_4TH_COLUMN_ONOFF (34*FW-3)
2929

30+
#define SD_LOGS_PERIOD_MIN 1 // 0.1s fastest period
31+
#define SD_LOGS_PERIOD_MAX 255 // 25.5s slowest period
32+
#define SD_LOGS_PERIOD_DEFAULT 10 // 1s default period for newly created SF
33+
3034
void onCustomFunctionsFileSelectionMenu(const char * result)
3135
{
3236
int sub = menuVerticalPosition;
@@ -334,13 +338,15 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
334338
}
335339
}
336340
else if (func == FUNC_LOGS) {
337-
if (val_displayed) {
338-
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT);
339-
lcdDrawChar(lcdLastRightPos, y, 's');
340-
}
341-
else {
342-
lcdDrawMMM(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, attr);
341+
val_min = SD_LOGS_PERIOD_MIN;
342+
val_max = SD_LOGS_PERIOD_MAX;
343+
344+
if (!val_displayed) {
345+
val_displayed = CFN_PARAM(cfn) = SD_LOGS_PERIOD_DEFAULT;
343346
}
347+
348+
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT);
349+
lcdDrawChar(lcdLastRightPos, y, 's');
344350
}
345351
else if (func == FUNC_BACKLIGHT) {
346352
val_max = MIXSRC_LAST_CH;

0 commit comments

Comments
 (0)