feat: Allow the timer count direction to be selected (#2038)

* timer direction: ellapsed or left

* Add AUDIO announcement support

* Storage for showElapsed

* Translations

* Fix storage

* BW implementation

* Different BW implementation

* Companion support

* Color LCD implementation and rebase to lvgl

* Fix problems found by raphaelcoeffic

* chore: Regenerate the YAML files properly

* fix: Remove unused `TR_SHOW` remnant

* chore: Formatting and cleanup

* fix: Timer dir choice was shown in wrong place
Wrong newline used in ce23b50

* Fix cpn ui triggers, remove unnecessary code and some formatting

* fix(colorlcd): Hide timer dir opt if zero value

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
Co-authored-by: elecpower <neilh713@tpg.com.au>
This commit is contained in:
eshifri
2022-08-03 09:22:42 +10:00
committed by GitHub
co-authored by Peter Feerick elecpower
parent 415b566a79
commit be7a6a51ab
50 changed files with 286 additions and 85 deletions
+17 -3
View File
@@ -188,7 +188,7 @@ enum MenuModelSetupItems {
ITEM_MODEL_SETUP_TRAINER_LABEL,
ITEM_MODEL_SETUP_TRAINER_MODE,
#if defined(BLUETOOTH)
ITEM_MODEL_SETUP_TRAINER_BLUETOOTH,
ITEM_MODEL_SETUP_TRAINER_BLUETOOTH,
#endif
ITEM_MODEL_SETUP_TRAINER_CHANNELS,
ITEM_MODEL_SETUP_TRAINER_PPM_PARAMS,
@@ -261,11 +261,13 @@ inline uint8_t MODULE_SUBTYPE_ROWS(int moduleIdx)
#define POT_WARN_ROWS ((g_model.potsWarnMode) ? (uint8_t)(NUM_POTS+NUM_SLIDERS) : (uint8_t)0)
#define TIMER_ROWS(x) \
1, 0, 1, 0, 0, \
1, 0, \
(uint8_t)((g_model.timers[x].start) ? 2 : 1), \
0, 0, \
g_model.timers[x].countdownBeep != COUNTDOWN_SILENT ? (uint8_t)1 \
: (uint8_t)0
#define EXTRA_MODULE_ROWS
#define EXTRA_MODULE_ROWS
#if defined(FUNCTION_SWITCHES)
#define FUNCTION_SWITCHES_ROWS READONLY_ROW, NAVIGATION_LINE_BY_LINE|3, NAVIGATION_LINE_BY_LINE|3, NAVIGATION_LINE_BY_LINE|3, NAVIGATION_LINE_BY_LINE|3, NAVIGATION_LINE_BY_LINE|3, NAVIGATION_LINE_BY_LINE|3, NAVIGATION_LINE_BY_LINE|(NUM_FUNCTIONS_SWITCHES-1),
@@ -571,6 +573,12 @@ void menuModelSetup(event_t event)
menuHorizontalPosition == 0 ? attr : 0,
menuHorizontalPosition == 1 ? attr : 0);
if (timer->start) {
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN + 5 * FW, y, STR_TIMER_DIR,
timer->showElapsed,
menuHorizontalPosition == 2 ? attr : 0);
}
if (attr && s_editMode > 0) {
div_t qr = div(timer->start, 60);
switch (menuHorizontalPosition) {
@@ -586,6 +594,12 @@ void menuModelSetup(event_t event)
if ((int16_t) timer->start > 5999)
timer->start = 32399; // 8:59:59
break;
case 2:
if (timer->start) {
timer->showElapsed =
checkIncDecModel(event, timer->showElapsed, 0, 1);
}
break;
}
}
break;