Mercurial > public > ostc4
changeset 1005:85f7e19c6688 GasConsumption
Switch menu position of Buzzer and flipdisplay option:
The Buzzer is an HW option while the flipdisplay is a SW function => exchange the position in order to clean up categories.
author | Ideenmodellierer |
---|---|
date | Sat, 03 May 2025 17:47:53 +0200 (3 months ago) |
parents | efb7d18cc564 |
children | 75f958ca5d0e |
files | Discovery/Inc/tStructure.h Discovery/Src/tMenuCustom.c Discovery/Src/tMenuEditCustom.c Discovery/Src/tMenuEditCvOption.c Discovery/Src/tMenuEditHardware.c Discovery/Src/tMenuHardware.c |
diffstat | 6 files changed, 74 insertions(+), 72 deletions(-) [+] |
line wrap: on
line diff
--- a/Discovery/Inc/tStructure.h Sat May 03 17:45:32 2025 +0200 +++ b/Discovery/Inc/tStructure.h Sat May 03 17:47:53 2025 +0200 @@ -292,6 +292,8 @@ #define StMHARD5_ButtonBalance3 _MB(2,7,5,4,0) #define StMHARD5_ButtonLock _MB(2,7,5,5,0) +#define StMHARD6_WarningBuz _MB(2,7,6,1,0) + //#define StMHARD6_UpdateCPU2_No _MB(2,7,6,1,0) //#define StMHARD6_UpdateCPU2_Yes _MB(2,7,6,2,0) //#define StMHARD6_UpdateCPU2_Now _MB(2,7,6,3,0) @@ -378,7 +380,7 @@ #define StMCustom5_CViewPortAmbient _MB(2,9,5,4,0) #define StMCustom5_CViewPortControl _MB(2,9,5,5,0) #endif -#define StMCustom5_CViewWarningBuz _MB(2,9,5,1,0) + /* Page 10 */ @@ -390,8 +392,8 @@ #define StMOption_Compass_Inertia _MB(2,10,1,4,0) #define StMOption_Compass_Declination _MB(2,10,1,5,0) -#define StMOption_Timer _MB(2,10,2,1,0) - +#define StMOption_Timer _MB(2,10,2,0,0) +#define StMOption_Timer_Value _MB(2,10,2,1,0) /* PAGE 11 */ #define StMPLAN _MB(2,11,0,0,0)
--- a/Discovery/Src/tMenuCustom.c Sat May 03 17:45:32 2025 +0200 +++ b/Discovery/Src/tMenuCustom.c Sat May 03 17:47:53 2025 +0200 @@ -120,18 +120,17 @@ textPointer += 2; #endif - - if((isNewDisplay()) && ((line == 0) || (line == 5))) + if((line == 0) || (line == 5)) { - text[textPointer++] = TXT_2BYTE; - text[textPointer++] = TXT2BYTE_BUZZER; - text[textPointer++] = ' '; - text[textPointer++] = TXT_Warning; - text[textPointer++] = '\t'; - if(settingsGetPointer()->warningBuzzer) - text[textPointer++] = '\005'; - else - text[textPointer++] = '\006'; + text[textPointer++] = TXT_2BYTE; + text[textPointer++] = TXT2BYTE_FLIPDISPLAY; + text[textPointer++] = '\t'; + if(settingsGetPointer()->FlipDisplay) + text[textPointer++] = '\005'; + else + text[textPointer++] = '\006'; + text[textPointer] = 0; + } strcpy(&text[textPointer],"\n\r");
--- a/Discovery/Src/tMenuEditCustom.c Sat May 03 17:45:32 2025 +0200 +++ b/Discovery/Src/tMenuEditCustom.c Sat May 03 17:47:53 2025 +0200 @@ -57,7 +57,7 @@ void openEdit_BigScreen(void); void openEdit_MotionCtrl(void); void openEdit_ViewPort(void); -void openEdit_WarningBuz(void); +void openEdit_FlipDisplay(void); void refresh_Customviews(void); void setMenuContentStructure(); char customview_TXT2BYTE_helper(uint8_t customViewId); @@ -380,11 +380,10 @@ case 5: openEdit_ViewPort(); break; #endif - case 5: if(isNewDisplay()) - { - openEdit_WarningBuz(); - } - break; + case 5: + openEdit_FlipDisplay(); + break; + } } @@ -475,21 +474,16 @@ setEvent(StMCustom5_CViewPortControl, (uint32_t)OnAction_CViewPortControl); #endif } -void openEdit_WarningBuz(void) +void openEdit_FlipDisplay(void) { - SSettings *pSettings = settingsGetPointer(); +/* does not work like this resetEnterPressedToStateBeforeButtonAction(); */ - if(pSettings->warningBuzzer == 0) - { - pSettings->warningBuzzer = 1; - requestBuzzerActivation(REQUEST_BUZZER_ONCE); - } - else - { - pSettings->warningBuzzer = 0; - deactivateBuzzer(); - } - exitMenuEdit_to_Menu_with_Menu_Update_do_not_write_settings_for_this_only(); + bool oldValue = settingsGetPointer()->FlipDisplay; + + setFlipDisplay(!oldValue); + + exitEditWithUpdate(); + exitMenuEdit_to_Home(); } char customview_TXT2BYTE_helper(uint8_t customViewId)
--- a/Discovery/Src/tMenuEditCvOption.c Sat May 03 17:45:32 2025 +0200 +++ b/Discovery/Src/tMenuEditCvOption.c Sat May 03 17:47:53 2025 +0200 @@ -281,16 +281,17 @@ write_topline(text); set_globalState(StMOption_Timer); + resetMenuEdit(CLUT_MenuPageCvOption); uint16_t yPos = ME_Y_LINE_BASE + get_globalState_Menu_Line() * ME_Y_LINE_STEP; snprintf(text, 32, "%c%c", TXT_2BYTE, TXT2BYTE_Timer); write_label_var(30, 299, yPos, &FontT48, text); - write_field_udigit(StMOption_Timer, 300, 392, yPos, &FontT48, "#:##", settings->timerDurationS / 60, settings->timerDurationS % 60, 0, 0); + write_field_udigit(StMOption_Timer_Value, 300, 392, yPos, &FontT48, "#:##", settings->timerDurationS / 60, settings->timerDurationS % 60, 0, 0); write_label_var(393, 800, yPos, &FontT48, "\016\016 [m:ss]\017"); write_buttonTextline(TXT2BYTE_ButtonMinus, TXT2BYTE_ButtonEnter, TXT2BYTE_ButtonPlus); - setEvent(StMOption_Timer, (uint32_t)OnAction_Timer); + setEvent(StMOption_Timer_Value, (uint32_t)OnAction_Timer); startEdit(); } static uint8_t OnAction_Timer(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
--- a/Discovery/Src/tMenuEditHardware.c Sat May 03 17:45:32 2025 +0200 +++ b/Discovery/Src/tMenuEditHardware.c Sat May 03 17:47:53 2025 +0200 @@ -43,16 +43,16 @@ #include "data_exchange_main.h" -extern void tM_build_pages(void); +//extern void tM_build_pages(void); /* Private function prototypes -----------------------------------------------*/ void openEdit_Bluetooth(void); -void openEdit_Compass(void); void openEdit_O2Sensors(void); void openEdit_Brightness(void); //void openEdit_Luftintegration(void); void openEdit_ButtonSens(void); -void openEdit_FlipDisplay(void); +void openEdit_WarningBuz(void); + /* Announced function prototypes -----------------------------------------------*/ uint8_t OnAction_Sensor1 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); @@ -80,22 +80,20 @@ switch(line) { case 1: - default: - openEdit_Bluetooth(); - break; - case 2: - openEdit_O2Sensors(); - break; - case 3: - openEdit_Brightness(); - break; - case 4: - resetMenuEdit(CLUT_MenuPageHardware); - openEdit_ButtonSens(); - break; - case 5: - openEdit_FlipDisplay(); - break; + default: openEdit_Bluetooth(); + break; + case 2: openEdit_O2Sensors(); + break; + case 3: openEdit_Brightness(); + break; + case 4: resetMenuEdit(CLUT_MenuPageHardware); + openEdit_ButtonSens(); + break; + case 5: if(isNewDisplay()) + { + openEdit_WarningBuz(); + } + break; } } @@ -120,17 +118,23 @@ exitMenuEdit_to_Menu_with_Menu_Update_do_not_write_settings_for_this_only(); } -void openEdit_FlipDisplay(void) +void openEdit_WarningBuz(void) { -/* does not work like this resetEnterPressedToStateBeforeButtonAction(); */ - - bool oldValue = settingsGetPointer()->FlipDisplay; + SSettings *pSettings = settingsGetPointer(); - setFlipDisplay(!oldValue); + if(pSettings->warningBuzzer == 0) + { + pSettings->warningBuzzer = 1; + requestBuzzerActivation(REQUEST_BUZZER_ONCE); + } + else + { + pSettings->warningBuzzer = 0; + deactivateBuzzer(); + } + exitMenuEdit_to_Menu_with_Menu_Update_do_not_write_settings_for_this_only(); +} - exitEditWithUpdate(); - exitMenuEdit_to_Home(); -} void refresh_O2Sensors(void) {
--- a/Discovery/Src/tMenuHardware.c Sat May 03 17:45:32 2025 +0200 +++ b/Discovery/Src/tMenuHardware.c Sat May 03 17:47:53 2025 +0200 @@ -29,6 +29,7 @@ /* Includes ------------------------------------------------------------------*/ #include "tMenu.h" #include "tMenuHardware.h" +#include "ostc.h" //#define NEXTLINE(text, textPointer) {text[(textPointer)++] = '\n'; text[textPointer++] = '\r'; text[textPointer] = 0;} // NEXTLINE(text,textPointer); @@ -140,18 +141,19 @@ } nextline(text,&textPointer); - if((line == 0) || (line == 5)) + if((isNewDisplay()) && ((line == 0) || (line == 5))) { - text[textPointer++] = TXT_2BYTE; - text[textPointer++] = TXT2BYTE_FLIPDISPLAY; - text[textPointer++] = '\t'; - if(settingsGetPointer()->FlipDisplay) - text[textPointer++] = '\005'; - else - text[textPointer++] = '\006'; - text[textPointer] = 0; - nextline(text,&textPointer); + text[textPointer++] = TXT_2BYTE; + text[textPointer++] = TXT2BYTE_BUZZER; + text[textPointer++] = ' '; + text[textPointer++] = TXT_Warning; + text[textPointer++] = '\t'; + if(settingsGetPointer()->warningBuzzer) + text[textPointer++] = '\005'; + else + text[textPointer++] = '\006'; } + nextline(text,&textPointer); return StMHARD; }