Mercurial > public > ostc4
changeset 999:ac25c35a3c97 GasConsumption
New Tab for dynamic configuration:
since more and more functions are added to the OSTC the space in the menus is getting short. To avoid problems a new Tab within the SYS menu has been added which shall focus an functions / views which are configuration dependend. In future this menu may have dynamic content dependend on which views are active or which sensors are connected. The Cview for compass and Timer have been moved to the new tab in the first step
author | Ideenmodellierer |
---|---|
date | Mon, 28 Apr 2025 19:47:41 +0200 (3 months ago) |
parents | 5a690195b6b7 |
children | c386ae6635e4 |
files | Discovery/Inc/gfx_colors.h Discovery/Inc/tMenuCvOption.h Discovery/Inc/tMenuEditCvOption.h Discovery/Inc/tStructure.h Discovery/Src/gfx_colors.c Discovery/Src/gfx_engine.c Discovery/Src/tMenu.c Discovery/Src/tMenuCustom.c Discovery/Src/tMenuCvOption.c Discovery/Src/tMenuEdit.c Discovery/Src/tMenuEditCvOption.c Discovery/Src/tMenuEditHardware.c Discovery/Src/tMenuEditSystem.c Discovery/Src/tMenuHardware.c Discovery/Src/tMenuSystem.c |
diffstat | 15 files changed, 627 insertions(+), 414 deletions(-) [+] |
line wrap: on
line diff
--- a/Discovery/Inc/gfx_colors.h Wed Apr 23 14:52:03 2025 +0200 +++ b/Discovery/Inc/gfx_colors.h Mon Apr 28 19:47:41 2025 +0200 @@ -87,8 +87,8 @@ CLUT_MenuPageHardware, CLUT_MenuPageSystem, CLUT_MenuPageCustomView, + CLUT_MenuPageCvOption, CLUT_MenuPageDivePlanner, - CLUT_MenuPage10, CLUT_ButtonSymbols, CLUT_InfoSurface, CLUT_InfoDive,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Discovery/Inc/tMenuCvOption.h Mon Apr 28 19:47:41 2025 +0200 @@ -0,0 +1,47 @@ +/////////////////////////////////////////////////////////////////////////////// +/// -*- coding: UTF-8 -*- +/// +/// \file Discovery/Inc/tMenuCvOption.h +/// \brief Header file of Menu Lines for System settings +/// \author heinrichs weikamp gmbh +/// \date 24-April-2025 +/// +/// $Id$ +/////////////////////////////////////////////////////////////////////////////// +/// \par Copyright (c) 2014-2025 Heinrichs Weikamp gmbh +/// +/// This program is free software: you can redistribute it and/or modify +/// it under the terms of the GNU General Public License as published by +/// the Free Software Foundation, either version 3 of the License, or +/// (at your option) any later version. +/// +/// This program is distributed in the hope that it will be useful, +/// but WITHOUT ANY WARRANTY; without even the implied warranty of +/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/// GNU General Public License for more details. +/// +/// You should have received a copy of the GNU General Public License +/// along with this program. If not, see <http://www.gnu.org/licenses/>. +////////////////////////////////////////////////////////////////////////////// + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef TMENU_CVOPTION_H +#define TMENU_CVOPTION_H + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal.h" +#include "gfx_engine.h" + +/** @addtogroup Template + * @{ + */ + +/* Exported variables --------------------------------------------------------*/ + + +/* Exported functions --------------------------------------------------------*/ + +uint32_t tMCvOption_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext); +void tMCvOption_checkLineStatus(void); + +#endif /* TMENU_CVOPTION_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Discovery/Inc/tMenuEditCvOption.h Mon Apr 28 19:47:41 2025 +0200 @@ -0,0 +1,42 @@ +/////////////////////////////////////////////////////////////////////////////// +/// -*- coding: UTF-8 -*- +/// +/// \file Discovery/Inc/tMenuEditCvOption.h +/// \brief Header file for editing Hardware Settings +/// \author heinrichs weikamp gmbh +/// \date 24-Apr-2025 +/// +/// $Id$ +/////////////////////////////////////////////////////////////////////////////// +/// \par Copyright (c) 2014-2025 Heinrichs Weikamp gmbh +/// +/// This program is free software: you can redistribute it and/or modify +/// it under the terms of the GNU General Public License as published by +/// the Free Software Foundation, either version 3 of the License, or +/// (at your option) any later version. +/// +/// This program is distributed in the hope that it will be useful, +/// but WITHOUT ANY WARRANTY; without even the implied warranty of +/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/// GNU General Public License for more details. +/// +/// You should have received a copy of the GNU General Public License +/// along with this program. If not, see <http://www.gnu.org/licenses/>. +////////////////////////////////////////////////////////////////////////////// + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef TMENU_EDIT_CVOPTION_H +#define TMENU_EDIT_CVOPTION_H + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal.h" +#include "gfx_engine.h" +#include "global_constants.h" +#include "settings.h" +#include "data_central.h" + +void openEdit_CvOption(uint8_t line); +void refresh_CompassEdit(void); +uint32_t tMCvOption_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext); + +#endif /* TMENU_EDIT_CVOPTION_H */
--- a/Discovery/Inc/tStructure.h Wed Apr 23 14:52:03 2025 +0200 +++ b/Discovery/Inc/tStructure.h Mon Apr 28 19:47:41 2025 +0200 @@ -222,10 +222,6 @@ #define StMXTRA_PSCR_LUNG_RATIO _MB(2,4,4,2,0) #define StMXTRA_Predive_Check _MB(2,4,5,1,0) - - - - /* PAGE 5 */ #define StMDECO _MB(2,5,0,0,0) @@ -274,13 +270,6 @@ #define StMHARD1_Bluetooth _MB(2,7,1,1,0) -#define StMHARD2_Compass _MB(2,7,2,0,0) -#define StMHARD2_Compass_SetCourse _MB(2,7,2,2,0) -#define StMHARD2_Compass_ResetCourse _MB(2,7,2,3,0) -#define StMHARD2_Compass_Calibrate _MB(2,7,2,4,0) -#define StMHARD2_Compass_Inertia _MB(2,7,2,5,0) -#define StMHARD2_Compass_Declination _MB(2,7,2,6,0) - //#define StMHARD2_Exit _MB(2,7,2,2,0) #define StMHARD3_Sensors _MB(2,7,3,0,0) @@ -322,35 +311,33 @@ #define StMSYS1_GNSSDT _MB(2,8,1,5,0) #define StMSYS1_ZONE _MB(2,8,1,6,0) -#define StMSYS_Timer _MB(2,8,2,1,0) +#define StMSYS2_English _MB(2,8,2,1,0) +#define StMSYS2_German _MB(2,8,2,2,0) +#define StMSYS2_French _MB(2,8,2,3,0) +#define StMSYS2_Italian _MB(2,8,2,4,0) +#define StMSYS2_Espanol _MB(2,8,2,5,0) -#define StMSYS2_English _MB(2,8,3,1,0) -#define StMSYS2_German _MB(2,8,3,2,0) -#define StMSYS2_French _MB(2,8,3,3,0) -#define StMSYS2_Italian _MB(2,8,3,4,0) -#define StMSYS2_Espanol _MB(2,8,3,5,0) +#define StMSYS3_Units _MB(2,8,3,1,0) +#define StMSYS3_Colors _MB(2,8,3,2,0) +#define StMSYS3_Debug _MB(2,8,3,3,0) -#define StMSYS3_Units _MB(2,8,4,1,0) -#define StMSYS3_Colors _MB(2,8,4,2,0) -#define StMSYS3_Debug _MB(2,8,4,3,0) - -#define StMSYS4_Info _MB(2,8,5,1,0) +#define StMSYS4_Info _MB(2,8,4,1,0) -#define StMSYS5_Exit _MB(2,8,6,1,0) -#define StMSYS5_LogbookOffset _MB(2,8,6,7,0) -#define StMSYS5_ResetAll _MB(2,8,6,2,0) -#define StMSYS5_ResetDeco _MB(2,8,6,3,0) -#define StMSYS5_Reboot _MB(2,8,6,4,0) -#define StMSYS5_Maintenance _MB(2,8,6,5,0) -#define StMSYS5_ResetLogbook _MB(2,8,6,6,0) -#define StMSYS5_SetBattCharge _MB(2,8,6,7,0) -#define StMSYS5_RebootRTE _MB(2,8,6,8,0) -#define StMSYS5_RebootMainCPU _MB(2,8,6,9,0) -#define StMSYS5_ScreenTest _MB(2,8,6,10,0) -#define StMSYS5_SetFactoryBC _MB(2,8,6,11,0) -#define StMSYS5_ResetBluetooth _MB(2,8,6,12,0) -#define StMSYS5_SetSampleIndx _MB(2,8,6,13,0) -#define StMSYS5_AdjustSurfPres _MB(2,8,6,14,0) +#define StMSYS5_Exit _MB(2,8,5,1,0) +#define StMSYS5_LogbookOffset _MB(2,8,5,7,0) +#define StMSYS5_ResetAll _MB(2,8,5,2,0) +#define StMSYS5_ResetDeco _MB(2,8,5,3,0) +#define StMSYS5_Reboot _MB(2,8,5,4,0) +#define StMSYS5_Maintenance _MB(2,8,5,5,0) +#define StMSYS5_ResetLogbook _MB(2,8,5,6,0) +#define StMSYS5_SetBattCharge _MB(2,8,5,7,0) +#define StMSYS5_RebootRTE _MB(2,8,5,8,0) +#define StMSYS5_RebootMainCPU _MB(2,8,5,9,0) +#define StMSYS5_ScreenTest _MB(2,8,5,10,0) +#define StMSYS5_SetFactoryBC _MB(2,8,5,11,0) +#define StMSYS5_ResetBluetooth _MB(2,8,5,12,0) +#define StMSYS5_SetSampleIndx _MB(2,8,5,13,0) +#define StMSYS5_AdjustSurfPres _MB(2,8,5,14,0) #define StMSYS_Custom0 _MB(2,8,1,0,0) #define StMSYS_Custom1 _MB(2,8,2,0,0) @@ -393,15 +380,28 @@ #endif #define StMCustom5_CViewWarningBuz _MB(2,9,5,1,0) -/* PAGE 10 */ -#define StMPLAN _MB(2,10,0,0,0) + +/* Page 10 */ +#define StMOption _MB(2,10,0,0,0) +#define StMOption_Compass _MB(2,10,1,0,0) +#define StMOption_Compass_SetCourse _MB(2,10,1,1,0) +#define StMOption_Compass_ResetCourse _MB(2,10,1,2,0) +#define StMOption_Compass_Calibrate _MB(2,10,1,3,0) +#define StMOption_Compass_Inertia _MB(2,10,1,4,0) +#define StMOption_Compass_Declination _MB(2,10,1,5,0) -/* PAGE 10 EDIT FIELD CONTENT */ -#define StMPLAN2_Interval _MB(2,10,2,1,0) -#define StMPLAN3_DiveTime _MB(2,10,3,1,0) -#define StMPLAN4_MaxDepth _MB(2,10,4,1,0) -#define StMPLAN5_ExitResult _MB(2,10,5,1,0) -#define StMPLAN4_Settings _MB(2,10,6,1,0) +#define StMOption_Timer _MB(2,10,2,0,0) + + +/* PAGE 11 */ +#define StMPLAN _MB(2,11,0,0,0) + +/* PAGE 11 EDIT FIELD CONTENT */ +#define StMPLAN2_Interval _MB(2,11,2,1,0) +#define StMPLAN3_DiveTime _MB(2,11,3,1,0) +#define StMPLAN4_MaxDepth _MB(2,11,4,1,0) +#define StMPLAN5_ExitResult _MB(2,11,5,1,0) +#define StMPLAN4_Settings _MB(2,11,6,1,0)
--- a/Discovery/Src/gfx_colors.c Wed Apr 23 14:52:03 2025 +0200 +++ b/Discovery/Src/gfx_colors.c Mon Apr 28 19:47:41 2025 +0200 @@ -89,8 +89,8 @@ 0x00AC00ff,//0x00E5AE18, // CLUT_MenuPageHardware 0x00ff00ff,//0x00E5AEFF, // CLUT_MenuPageSystem 0x00FF55FF,//0x00FFFF00, // CLUT_MenuPageCustomView + 0x00FFAAFF, // CLUT_MenuPageCVOption 0x00C4EACC, // CLUT_MenuPageDivePlanner - 0x00000000, // CLUT_MenuPage10 - UNUSED 0x00FFFFFF, // CLUT_ButtonSymbols 0x000092D0, // CLUT_InfoSurface 0x000092D0, // CLUT_InfoDive - UNUSED
--- a/Discovery/Src/gfx_engine.c Wed Apr 23 14:52:03 2025 +0200 +++ b/Discovery/Src/gfx_engine.c Mon Apr 28 19:47:41 2025 +0200 @@ -3828,7 +3828,7 @@ hgfx.WindowX1 = 779; if(Font == &FontT24) { - hgfx.WindowX0 = hgfx.WindowX1 - (Font->spacesize*3); + hgfx.WindowX0 = hgfx.WindowX1 - (Font->spacesize*7); } else {
--- a/Discovery/Src/tMenu.c Wed Apr 23 14:52:03 2025 +0200 +++ b/Discovery/Src/tMenu.c Mon Apr 28 19:47:41 2025 +0200 @@ -42,6 +42,7 @@ #include "tMenuEditSystem.h" #include "tMenuEditXtra.h" #include "tMenuEditCustom.h" +#include "tMenuEditCvOption.h" #include "tMenuGas.h" #include "tMenuHardware.h" #include "tMenuPlanner.h" @@ -51,13 +52,16 @@ #include "tMenuCustom.h" /* Private types -------------------------------------------------------------*/ -#define MAXPAGES 11 +#define MAXPAGES 12 #define CURSOR_HIGH 25 #define TAB_HEADER_HIGH 25 #define TAB_BAR_HIGH 5 #define MENU_WDW_HIGH 390 #define KEY_LABEL_HIGH 25 /* Height of the label used for the the user keys */ +#define TAB_BAR_WIDTH 50 +#define TAB_BAR_SPACING 5 + #define SLOW_UPDATE_CNT 10 /* Some content shall not be update in short intervals => add prescalar */ #define MAXLINES 6 @@ -580,6 +584,7 @@ tM_add(StMDECO); tM_add(StMHARD); tM_add(StMCustom); + tM_add(StMOption); // tM_add(StMSYS); now in both modes } else @@ -649,6 +654,9 @@ id = tMCustom_refresh(0, text, &tabPosition, subtext); tM_build_page(id, text, tabPosition, subtext); + + id = tMCvOption_refresh(0, text, &tabPosition, subtext); + tM_build_page(id, text, tabPosition, subtext); } @@ -1153,6 +1161,9 @@ case StMCustom: openEdit_Custom(line); break; + case StMOption: + openEdit_CvOption(line); + break; default: break; } @@ -1350,19 +1361,20 @@ { "", "OC", "CC", - "SP", + "", "DATA", "DECO", "", "SYS", "", "", + "", "SIM" }; _Bool spacing[MAXPAGES+1] = { 0, - 0, // behind OC + 1, // behind OC 0, // behind CC 1, // behind SP 1, // behind DATA @@ -1370,7 +1382,8 @@ 1, // behind DECO2 0, // behind SYS1 0, // behind SYS2 - 1, // behind SYS3 + 0, // behind SYS3 + 1, // behind SYS4 1, // behind SIM 0 }; @@ -1378,7 +1391,7 @@ if(actual_menu_content == MENU_SURFACE) { spacing[3] = 0; /* Display extra menu directly after setpoint */ - sprintf(text8max[4],"OP"); + memset(text8max[4],0,8); } pBackup = tMscreen.FBStartAdress; @@ -1430,9 +1443,9 @@ /* Draw color bars */ if(!settingsGetPointer()->FlipDisplay) { - pDestination += 5 * 480; + pDestination += TAB_BAR_SPACING * 480; - for(j = 60; j > 0; j--) + for(j = TAB_BAR_WIDTH; j > 0; j--) { pDestination += (390 + 26); @@ -1443,13 +1456,13 @@ pDestination += 48; } - pDestination += 5 * 480; - positionText += 70; + pDestination += TAB_BAR_SPACING * 480; + positionText += TAB_BAR_WIDTH + 2* TAB_BAR_SPACING; if(((k == 4) && (actual_menu_content != MENU_SURFACE)) || ((k == 6) && (menu.pageCountNumber[5] == 0))) { - pDestination += 70 * 480; - positionText += 70; + pDestination += (TAB_BAR_WIDTH + 2* TAB_BAR_SPACING) * 480; + positionText += TAB_BAR_WIDTH + 2* TAB_BAR_SPACING; } if(spacing[k])
--- a/Discovery/Src/tMenuCustom.c Wed Apr 23 14:52:03 2025 +0200 +++ b/Discovery/Src/tMenuCustom.c Mon Apr 28 19:47:41 2025 +0200 @@ -39,6 +39,7 @@ #include "gfx_fonts.h" #include "tInfo.h" #include "motion.h" +#include "ostc.h" /* Exported functions --------------------------------------------------------*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Discovery/Src/tMenuCvOption.c Mon Apr 28 19:47:41 2025 +0200 @@ -0,0 +1,98 @@ +/////////////////////////////////////////////////////////////////////////////// +/// -*- coding: UTF-8 -*- +/// +/// \file Discovery/Src/tMenuCvOption.c +/// \brief Main Template file for Menu Page System settings +/// \author heinrichs weikamp gmbh +/// \date 24-Apr-2025 +/// +/// \details +/// +/// $Id$ +/////////////////////////////////////////////////////////////////////////////// +/// \par Copyright (c) 2014-2025 Heinrichs Weikamp gmbh +/// +/// This program is free software: you can redistribute it and/or modify +/// it under the terms of the GNU General Public License as published by +/// the Free Software Foundation, either version 3 of the License, or +/// (at your option) any later version. +/// +/// This program is distributed in the hope that it will be useful, +/// but WITHOUT ANY WARRANTY; without even the implied warranty of +/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/// GNU General Public License for more details. +/// +/// You should have received a copy of the GNU General Public License +/// along with this program. If not, see <http://www.gnu.org/licenses/>. +////////////////////////////////////////////////////////////////////////////// + +/* Includes ------------------------------------------------------------------*/ +#include "tMenu.h" +#include "tMenuCvOption.h" +#include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() +#include "t7.h" + +/* Private function prototypes -----------------------------------------------*/ + +/* Exported functions --------------------------------------------------------*/ + +uint32_t tMCvOption_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext) +{ + SSettings *data; + uint8_t textPointer; + + data = settingsGetPointer(); + textPointer = 0; + *tab = 300; + *subtext = 0; + + resetLineMask(StMOption); + + if((line == 0) || (line == 1)) + { + text[textPointer++] = TXT_2BYTE; + text[textPointer++] = TXT2BYTE_Compass; + text[textPointer++] = '\t'; + + if(settingsGetPointer()->compassBearing != 0) + { + textPointer += snprintf(&text[textPointer], 20, "(%03u`)", settingsGetPointer()->compassBearing % 360); + } + text[textPointer] = 0; + } + nextline(text,&textPointer); + if (line == 0 || line == 2) + { + if(t7_customview_disabled(CVIEW_Timer)) + { + text[textPointer++] = '\031'; /* change text color */ + textPointer += snprintf(&text[textPointer], 21, "%c%c\t%u:%02u \016\016[m:ss]\017", TXT_2BYTE, TXT2BYTE_Timer, data->timerDurationS / 60, data->timerDurationS % 60); + disableLine(StMOption_Timer); + text[textPointer++] = '\020'; /* restore text color */ + } + else + { + textPointer += snprintf(&text[textPointer], 21, "%c%c\t%u:%02u \016\016[m:ss]\017", TXT_2BYTE, TXT2BYTE_Timer, data->timerDurationS / 60, data->timerDurationS % 60); + } + } + nextline(text,&textPointer); + + return StMOption; +} +void tMCvOption_checkLineStatus(void) +{ + uint8_t localLineMask = 0; + uint8_t lineMask = getLineMask(StMSYS); +#if 0 + if(t7_customview_disabled(CVIEW_Timer)) + { + localLineMask |= 1 << 2; + } +#endif + if(lineMask != localLineMask) + { + updateMenu(); + } +} + +/* Private functions ---------------------------------------------------------*/
--- a/Discovery/Src/tMenuEdit.c Wed Apr 23 14:52:03 2025 +0200 +++ b/Discovery/Src/tMenuEdit.c Mon Apr 28 19:47:41 2025 +0200 @@ -229,7 +229,7 @@ case (StMHARD3_Sensor_Detect): case (StMHARD3_Sensor_Info): refreshFct = refresh_O2Sensors; break; - case (StMHARD2_Compass & MaskFieldDigit): + case (StMOption_Compass & MaskFieldDigit): refreshFct = refresh_CompassEdit; break; case (StMXTRA_CompassHeading & MaskFieldDigit):
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Discovery/Src/tMenuEditCvOption.c Mon Apr 28 19:47:41 2025 +0200 @@ -0,0 +1,353 @@ +/////////////////////////////////////////////////////////////////////////////// +/// -*- coding: UTF-8 -*- +/// +/// \file Discovery/Src/tMenuEditCvOption.c +/// \brief Menu for configuration depended items +/// \author heinrichs weikamp gmbh +/// \date 24-Apr-2025 +/// +/// \details +/// +/// $Id$ +/////////////////////////////////////////////////////////////////////////////// +/// \par Copyright (c) 2014-2025 Heinrichs Weikamp gmbh +/// +/// This program is free software: you can redistribute it and/or modify +/// it under the terms of the GNU General Public License as published by +/// the Free Software Foundation, either version 3 of the License, or +/// (at your option) any later version. +/// +/// This program is distributed in the hope that it will be useful, +/// but WITHOUT ANY WARRANTY; without even the implied warranty of +/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/// GNU General Public License for more details. +/// +/// You should have received a copy of the GNU General Public License +/// along with this program. If not, see <http://www.gnu.org/licenses/>. +////////////////////////////////////////////////////////////////////////////// + +/* Includes ------------------------------------------------------------------*/ +#include "tMenuEditCvOption.h" +#include "tMenuEdit.h" + +#include "gfx_fonts.h" +#include "ostc.h" +#include "tMenuEdit.h" +#include "tHome.h" + +/* Private function prototypes -----------------------------------------------*/ +static void openEdit_Timer(void); +void openEdit_Compass(void); + +/* Announced function prototypes -----------------------------------------------*/ +uint8_t OnAction_Compass (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); +static uint8_t OnAction_CompassDeclination(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); +uint8_t OnAction_Bearing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); +uint8_t OnAction_BearingClear (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); +uint8_t OnAction_InertiaLevel (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); +static uint8_t OnAction_Timer(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); + +/* Exported functions --------------------------------------------------------*/ + +void openEdit_CvOption(uint8_t line) +{ + set_globalState_Menu_Line(line); + + switch(line) + { + case 1: + default: + resetMenuEdit(CLUT_MenuPageHardware); + openEdit_Compass(); + break; + case 2: + openEdit_Timer(); + break; + } +} + +/* Private functions ---------------------------------------------------------*/ + +static uint8_t OnAction_CompassDeclination(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +{ + SSettings *settings = settingsGetPointer(); + uint8_t digitContentNew; + switch (action) { + case ACTION_BUTTON_ENTER: + + return digitContent; + case ACTION_BUTTON_ENTER_FINAL: + { + int32_t compassDeclinationDeg; + evaluateNewString(editId, (uint32_t *)&compassDeclinationDeg, NULL, NULL, NULL); + + if (compassDeclinationDeg > 99) { + compassDeclinationDeg = 99; + } else if (compassDeclinationDeg < -99) { + compassDeclinationDeg = -99; + } + + settings->compassDeclinationDeg = compassDeclinationDeg; + + tMenuEdit_newInput(editId, ((input_u)compassDeclinationDeg).uint32, 0, 0, 0); + } + + break; + case ACTION_BUTTON_NEXT: + if (digitNumber == 0) { + digitContentNew = togglePlusMinus(digitContent); + } else { + digitContentNew = digitContent + 1; + if (digitContentNew > '9') { + digitContentNew = '0'; + } + } + + return digitContentNew; + case ACTION_BUTTON_BACK: + if (digitNumber == 0) { + digitContentNew = togglePlusMinus(digitContent); + } else { + digitContentNew = digitContent - 1; + if (digitContentNew < '0') { + digitContentNew = '9'; + } + } + + return digitContentNew; + } + + return UNSPECIFIC_RETURN; +} + + +static void showCompassDeclination(SSettings *settings, bool isRefresh) +{ + char text[16]; + snprintf(text, 16, "%c%c:", TXT_2BYTE, TXT2BYTE_CompassDeclination); + write_label_var(30, 800, ME_Y_LINE6, &FontT48, text); + if (isRefresh) { + tMenuEdit_refresh_field(StMOption_Compass_Declination); + } else { + write_field_sdigit(StMOption_Compass_Declination, 500, 800, ME_Y_LINE6, &FontT48, "\034###`", settings->compassDeclinationDeg, 0, 0, 0); + } +} + + +void refresh_CompassEdit(void) +{ + SSettings *settings = settingsGetPointer(); + + uint16_t heading; + char text[32]; + uint8_t textIndex = 0; + + text[0] = '\001'; + text[1] = TXT_2BYTE; + text[2] = TXT2BYTE_Compass; + text[3] = 0; + write_topline(text); + + if(settings->compassInertia) + { + heading = (uint16_t)compass_getCompensated(); + } + else + { + heading = (uint16_t)stateUsed->lifeData.compass_heading; + } + snprintf(text,32,"\001%03i`",heading); + write_label_var( 0, 800, ME_Y_LINE1, &FontT54, text); + + tMenuEdit_refresh_field(StMOption_Compass_SetCourse); + tMenuEdit_refresh_field(StMOption_Compass_Calibrate); + tMenuEdit_refresh_field(StMOption_Compass_ResetCourse); + text[textIndex++] = TXT_2BYTE; + text[textIndex++] = TXT2BYTE_CompassInertia; + text[textIndex++] = ':'; + text[textIndex++] = ' '; + text[textIndex++] = '0' + settings->compassInertia; + + write_label_var(30, 800, ME_Y_LINE5, &FontT48, text); + + showCompassDeclination(settings, true); + + write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); +} + + +void openEdit_Compass(void) +{ + SSettings *settings = settingsGetPointer(); + + char text[10]; + uint8_t textIndex = 0; + + + set_globalState(StMOption_Compass); + resetMenuEdit(CLUT_MenuPageHardware); + + text[textIndex++] = '\001'; + text[textIndex++] = TXT_2BYTE; + text[textIndex++] = TXT2BYTE_Compass; + text[textIndex++] = 0; + write_topline(text); + + text[0] = TXT_2BYTE; + text[2] = 0; + + text[1] = TXT2BYTE_SetBearing; + write_field_button(StMOption_Compass_SetCourse, 30, 800, ME_Y_LINE2, &FontT48, text); + + text[1] = TXT2BYTE_ResetBearing; + write_field_button(StMOption_Compass_ResetCourse, 30, 800, ME_Y_LINE3, &FontT48, text); + + text[1] = TXT2BYTE_CompassCalib; + write_field_button(StMOption_Compass_Calibrate, 30, 800, ME_Y_LINE4, &FontT48, text); + + text[1] = TXT2BYTE_CompassInertia; + textIndex = 2; + text[textIndex++] = ':'; + text[textIndex++] = ' '; + text[textIndex++] = '0' + settings->compassInertia; + text[textIndex++] = 0; + + write_field_button(StMOption_Compass_Inertia, 30, 800, ME_Y_LINE5, &FontT48, text); + + showCompassDeclination(settings, false); + + setEvent(StMOption_Compass_SetCourse, (uint32_t)OnAction_Bearing); + setEvent(StMOption_Compass_ResetCourse, (uint32_t)OnAction_BearingClear); + setEvent(StMOption_Compass_Calibrate, (uint32_t)OnAction_Compass); + setEvent(StMOption_Compass_Inertia, (uint32_t)OnAction_InertiaLevel); + setEvent(StMOption_Compass_Declination, (uint32_t)OnAction_CompassDeclination); + + tMenuEdit_select(StMOption_Compass_SetCourse); + + write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); +} + + +uint8_t OnAction_Compass (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +{ + calibrateCompass(); + return EXIT_TO_INFO_COMPASS; +} + + +uint8_t OnAction_Bearing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +{ + if((int16_t)stateUsed->lifeData.compass_heading != -1) + { + settingsGetPointer()->compassBearing = (int16_t)stateUsed->lifeData.compass_heading; + } + else + { + settingsGetPointer()->compassBearing = 0; + } + + if(settingsGetPointer()->compassBearing == 0) + settingsGetPointer()->compassBearing = 360; + return UPDATE_AND_EXIT_TO_MENU; +} + + +uint8_t OnAction_BearingClear (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +{ + settingsGetPointer()->compassBearing = 0; + return UPDATE_AND_EXIT_TO_MENU; +} + + +uint8_t OnAction_InertiaLevel (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +{ + uint8_t newLevel = 0; + + newLevel = settingsGetPointer()->compassInertia + 1; + if(newLevel > MAX_COMPASS_COMP) + { + newLevel = 0; + } + settingsGetPointer()->compassInertia = newLevel; + return UPDATE_DIVESETTINGS; +} + +static void openEdit_Timer(void) +{ + SSettings *settings = settingsGetPointer(); + + char text[32]; + snprintf(text, 32, "\001%c%c", TXT_2BYTE, TXT2BYTE_Timer); + write_topline(text); + + 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_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); + startEdit(); +} +static uint8_t OnAction_Timer(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +{ + SSettings *settings = settingsGetPointer(); + uint8_t digitContentNew; + switch (action) { + case ACTION_BUTTON_ENTER: + + return digitContent; + case ACTION_BUTTON_ENTER_FINAL: + { + uint32_t timerM; + uint32_t timerS; + evaluateNewString(editId, &timerM, &timerS, 0, 0); + if (timerM > 9) { + timerM = 9; + } + if (timerS > 59) { + timerS = 59; + } + + uint16_t timerDurationS = 60 * timerM + timerS; + + if (timerDurationS < 1) { + timerDurationS = 1; + } + + if (timerDurationS != settings->timerDurationS) { + settings->timerDurationS = timerDurationS; + + disableTimer(); + + tMenuEdit_newInput(editId, settings->timerDurationS / 60, settings->timerDurationS % 60, 0, 0); + } + + return EXIT_TO_MENU; + } + case ACTION_BUTTON_NEXT: + digitContentNew = digitContent + 1; + if ((blockNumber == 1 && digitNumber == 0 && digitContentNew > '5') || digitContentNew > '9') { + digitContentNew = '0'; + } + + return digitContentNew; + case ACTION_BUTTON_BACK: + digitContentNew = digitContent - 1; + if (digitContentNew < '0') { + if (blockNumber == 1 && digitNumber == 0) { + digitContentNew = '5'; + } else { + digitContentNew = '9'; + } + } + + return digitContentNew; + } + + return EXIT_TO_MENU; +} + +
--- a/Discovery/Src/tMenuEditHardware.c Wed Apr 23 14:52:03 2025 +0200 +++ b/Discovery/Src/tMenuEditHardware.c Mon Apr 28 19:47:41 2025 +0200 @@ -34,10 +34,17 @@ #include "gfx_fonts.h" #include "ostc.h" #include "tCCR.h" +#include "tMenuEdit.h" +#include "tHome.h" +#include "tInfo.h" +#include "tInfoLog.h" +#include "tInfoSensor.h" #include "tComm.h" #include "data_exchange_main.h" +extern void tM_build_pages(void); + /* Private function prototypes -----------------------------------------------*/ void openEdit_Bluetooth(void); void openEdit_Compass(void); @@ -48,22 +55,15 @@ void openEdit_FlipDisplay(void); /* Announced function prototypes -----------------------------------------------*/ -uint8_t OnAction_Compass (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -uint8_t OnAction_Bearing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -uint8_t OnAction_BearingClear (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -uint8_t OnAction_InertiaLevel (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -//uint8_t OnAction_ExitHardw (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_Sensor1 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_Sensor2 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_Sensor3 (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_O2_Calibrate (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -//uint8_t OnAction_O2_Source (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_Sensor_Info (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_Sensor_Detect (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_Button (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_ButtonBalance (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_ButtonLock (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -// not required uint8_t OnAction_Bluetooth (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); /* Exported functions --------------------------------------------------------*/ @@ -136,217 +136,6 @@ exitMenuEdit_to_Home(); } -static uint8_t OnAction_CompassDeclination(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - SSettings *settings = settingsGetPointer(); - uint8_t digitContentNew; - switch (action) { - case ACTION_BUTTON_ENTER: - - return digitContent; - case ACTION_BUTTON_ENTER_FINAL: - { - int32_t compassDeclinationDeg; - evaluateNewString(editId, (uint32_t *)&compassDeclinationDeg, NULL, NULL, NULL); - - if (compassDeclinationDeg > MAX_COMPASS_DECLINATION_DEG) { - compassDeclinationDeg = MAX_COMPASS_DECLINATION_DEG; - } else if (compassDeclinationDeg < -MAX_COMPASS_DECLINATION_DEG) { - compassDeclinationDeg = -MAX_COMPASS_DECLINATION_DEG; - } - - settings->compassDeclinationDeg = compassDeclinationDeg; - - tMenuEdit_newInput(editId, ((input_u)compassDeclinationDeg).uint32, 0, 0, 0); - } - - break; - case ACTION_BUTTON_NEXT: - if (digitNumber == 0) { - digitContentNew = togglePlusMinus(digitContent); - } else { - digitContentNew = digitContent + 1; - if (digitContentNew > '9') { - digitContentNew = '0'; - } - } - - return digitContentNew; - case ACTION_BUTTON_BACK: - if (digitNumber == 0) { - digitContentNew = togglePlusMinus(digitContent); - } else { - digitContentNew = digitContent - 1; - if (digitContentNew < '0') { - digitContentNew = '9'; - } - } - - return digitContentNew; - } - - return UNSPECIFIC_RETURN; -} - - -static void showCompassDeclination(SSettings *settings, bool isRefresh) -{ - char text[16]; - snprintf(text, 16, "%c%c:", TXT_2BYTE, TXT2BYTE_CompassDeclination); - write_label_var(30, 800, ME_Y_LINE6, &FontT48, text); - if (isRefresh) { - tMenuEdit_refresh_field(StMHARD2_Compass_Declination); - } else { - write_field_sdigit(StMHARD2_Compass_Declination, 500, 800, ME_Y_LINE6, &FontT48, "\034###`", settings->compassDeclinationDeg, 0, 0, 0); - } -} - - -void refresh_CompassEdit(void) -{ - SSettings *settings = settingsGetPointer(); - - uint16_t heading; - char text[32]; - uint8_t textIndex = 0; - - text[0] = '\001'; - text[1] = TXT_2BYTE; - text[2] = TXT2BYTE_Compass; - text[3] = 0; - write_topline(text); - - if(settings->compassInertia) - { - heading = (uint16_t)compass_getCompensated(); - } - else - { - heading = (uint16_t)stateUsed->lifeData.compass_heading; - } - snprintf(text,32,"\001%03i`",heading); - write_label_var( 0, 800, ME_Y_LINE1, &FontT54, text); - - tMenuEdit_refresh_field(StMHARD2_Compass_SetCourse); - tMenuEdit_refresh_field(StMHARD2_Compass_Calibrate); - tMenuEdit_refresh_field(StMHARD2_Compass_ResetCourse); - text[textIndex++] = TXT_2BYTE; - text[textIndex++] = TXT2BYTE_CompassInertia; - text[textIndex++] = ':'; - text[textIndex++] = ' '; - text[textIndex++] = '0' + settings->compassInertia; - - write_label_var(30, 800, ME_Y_LINE5, &FontT48, text); - - showCompassDeclination(settings, true); - - write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); -} - - -void openEdit_Compass(void) -{ - SSettings *settings = settingsGetPointer(); - - char text[10]; - uint8_t textIndex = 0; - - - set_globalState(StMHARD2_Compass); - resetMenuEdit(CLUT_MenuPageHardware); - - text[textIndex++] = '\001'; - text[textIndex++] = TXT_2BYTE; - text[textIndex++] = TXT2BYTE_Compass; - text[textIndex++] = 0; - write_topline(text); - - text[0] = TXT_2BYTE; - text[2] = 0; - - text[1] = TXT2BYTE_SetBearing; - write_field_button(StMHARD2_Compass_SetCourse, 30, 800, ME_Y_LINE2, &FontT48, text); - - text[1] = TXT2BYTE_ResetBearing; - write_field_button(StMHARD2_Compass_ResetCourse, 30, 800, ME_Y_LINE3, &FontT48, text); - - text[1] = TXT2BYTE_CompassCalib; - write_field_button(StMHARD2_Compass_Calibrate, 30, 800, ME_Y_LINE4, &FontT48, text); - - text[1] = TXT2BYTE_CompassInertia; - textIndex = 2; - text[textIndex++] = ':'; - text[textIndex++] = ' '; - text[textIndex++] = '0' + settings->compassInertia; - text[textIndex++] = 0; - - write_field_button(StMHARD2_Compass_Inertia, 30, 800, ME_Y_LINE5, &FontT48, text); - - showCompassDeclination(settings, false); - - setEvent(StMHARD2_Compass_SetCourse, (uint32_t)OnAction_Bearing); - setEvent(StMHARD2_Compass_ResetCourse, (uint32_t)OnAction_BearingClear); - setEvent(StMHARD2_Compass_Calibrate, (uint32_t)OnAction_Compass); - setEvent(StMHARD2_Compass_Inertia, (uint32_t)OnAction_InertiaLevel); - setEvent(StMHARD2_Compass_Declination, (uint32_t)OnAction_CompassDeclination); - - tMenuEdit_select(StMHARD2_Compass_SetCourse); - - write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); -} - - -uint8_t OnAction_Compass (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - calibrateCompass(); - return EXIT_TO_INFO_COMPASS; -} - - -uint8_t OnAction_Bearing (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - if((int16_t)stateUsed->lifeData.compass_heading != -1) - { - settingsGetPointer()->compassBearing = (int16_t)stateUsed->lifeData.compass_heading; - } - else - { - settingsGetPointer()->compassBearing = 0; - } - - if(settingsGetPointer()->compassBearing == 0) - settingsGetPointer()->compassBearing = 360; - return UPDATE_AND_EXIT_TO_MENU; -} - - -uint8_t OnAction_BearingClear (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - settingsGetPointer()->compassBearing = 0; - return UPDATE_AND_EXIT_TO_MENU; -} - - -uint8_t OnAction_InertiaLevel (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - uint8_t newLevel = 0; - - newLevel = settingsGetPointer()->compassInertia + 1; - if(newLevel > MAX_COMPASS_COMP) - { - newLevel = 0; - } - settingsGetPointer()->compassInertia = newLevel; - return UPDATE_DIVESETTINGS; -} - -/* -uint8_t OnAction_ExitHardw (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - return EXIT_TO_MENU; -} -*/ - void refresh_O2Sensors(void) { char strSensorId[20];
--- a/Discovery/Src/tMenuEditSystem.c Wed Apr 23 14:52:03 2025 +0200 +++ b/Discovery/Src/tMenuEditSystem.c Mon Apr 28 19:47:41 2025 +0200 @@ -109,87 +109,6 @@ /* Exported functions --------------------------------------------------------*/ -static uint8_t OnAction_Timer(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - SSettings *settings = settingsGetPointer(); - uint8_t digitContentNew; - switch (action) { - case ACTION_BUTTON_ENTER: - - return digitContent; - case ACTION_BUTTON_ENTER_FINAL: - { - uint32_t timerM; - uint32_t timerS; - evaluateNewString(editId, &timerM, &timerS, 0, 0); - if (timerM > 9) { - timerM = 9; - } - if (timerS > 59) { - timerS = 59; - } - - uint16_t timerDurationS = 60 * timerM + timerS; - - if (timerDurationS < 1) { - timerDurationS = 1; - } - - if (timerDurationS != settings->timerDurationS) { - settings->timerDurationS = timerDurationS; - - disableTimer(); - - tMenuEdit_newInput(editId, settings->timerDurationS / 60, settings->timerDurationS % 60, 0, 0); - } - - return EXIT_TO_MENU; - } - case ACTION_BUTTON_NEXT: - digitContentNew = digitContent + 1; - if ((blockNumber == 1 && digitNumber == 0 && digitContentNew > '5') || digitContentNew > '9') { - digitContentNew = '0'; - } - - return digitContentNew; - case ACTION_BUTTON_BACK: - digitContentNew = digitContent - 1; - if (digitContentNew < '0') { - if (blockNumber == 1 && digitNumber == 0) { - digitContentNew = '5'; - } else { - digitContentNew = '9'; - } - } - - return digitContentNew; - } - - return EXIT_TO_MENU; -} - - -static void openEdit_Timer(void) -{ - SSettings *settings = settingsGetPointer(); - - char text[32]; - snprintf(text, 32, "\001%c%c", TXT_2BYTE, TXT2BYTE_Timer); - write_topline(text); - - 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(StMSYS_Timer, 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(StMSYS_Timer, (uint32_t)OnAction_Timer); - startEdit(); -} - - void openEdit_System(uint8_t line) { set_globalState_Menu_Line(line); @@ -204,28 +123,17 @@ openEdit_DateTime(); break; case 2: - openEdit_Timer(); - break; - case 3: openEdit_Language(); break; - case 4: + case 3: openEdit_Design(); break; - case 5: + case 4: openEdit_Information(); break; - case 6: + case 5: openEdit_Reset(); break; -/* - case 3: - openEdit_DecoFutureTTS(); - break; - case 4: - openEdit_DecoLastStop(); - break; -*/ } } else
--- a/Discovery/Src/tMenuHardware.c Wed Apr 23 14:52:03 2025 +0200 +++ b/Discovery/Src/tMenuHardware.c Mon Apr 28 19:47:41 2025 +0200 @@ -75,26 +75,6 @@ if((line == 0) || (line == 2)) { - text[textPointer++] = TXT_2BYTE; - text[textPointer++] = TXT2BYTE_Compass; - text[textPointer++] = '\t'; - - if(settingsGetPointer()->compassBearing != 0) - { - textPointer += snprintf(&text[textPointer], 20, "(%03u`)", settingsGetPointer()->compassBearing % 360); - } - text[textPointer] = 0; -/* - textPointer += snprintf(&text[textPointer],20,"%i %i %i" - ,stateUsed->lifeData.compass_DX_f - ,stateUsed->lifeData.compass_DY_f - ,stateUsed->lifeData.compass_DZ_f); -*/ - } - nextline(text,&textPointer); - - if((line == 0) || (line == 3)) - { text[textPointer++] = TXT_o2Sensors; if((stateUsed->lifeData.ppO2Sensor_bar[0] != 0) || (stateUsed->lifeData.ppO2Sensor_bar[1] != 0) || (stateUsed->lifeData.ppO2Sensor_bar[2] != 0)) { @@ -118,7 +98,7 @@ } nextline(text,&textPointer); - if((line == 0) || (line == 4)) + if((line == 0) || (line == 3)) { text[textPointer++] = TXT_Brightness; text[textPointer++] = '\t'; @@ -140,7 +120,7 @@ } nextline(text,&textPointer); - if((line == 0) || (line == 5)) + if((line == 0) || (line == 4)) { text[textPointer++] = TXT_2BYTE; text[textPointer++] = TXT2BYTE_ButtonSensitivity; @@ -160,7 +140,7 @@ } nextline(text,&textPointer); - if((line == 0) || (line == 6)) + if((line == 0) || (line == 5)) { text[textPointer++] = TXT_2BYTE; text[textPointer++] = TXT2BYTE_FLIPDISPLAY;
--- a/Discovery/Src/tMenuSystem.c Wed Apr 23 14:52:03 2025 +0200 +++ b/Discovery/Src/tMenuSystem.c Mon Apr 28 19:47:41 2025 +0200 @@ -146,24 +146,6 @@ textPointer += 2; } - if (line == 0 || line == 2) - { - if(t7_customview_disabled(CVIEW_Timer)) - { - text[textPointer++] = '\031'; /* change text color */ - textPointer += snprintf(&text[textPointer], 21, "%c%c\t%u:%02u \016\016[m:ss]\017\n\r", TXT_2BYTE, TXT2BYTE_Timer, data->timerDurationS / 60, data->timerDurationS % 60); - disableLine(StMSYS_Timer); - text[textPointer++] = '\020'; /* restore text color */ - } - else - { - textPointer += snprintf(&text[textPointer], 21, "%c%c\t%u:%02u \016\016[m:ss]\017\n\r", TXT_2BYTE, TXT2BYTE_Timer, data->timerDurationS / 60, data->timerDurationS % 60); - } - } else - { - textPointer += snprintf(&text[textPointer], 3, "\n\r"); - } - if((line == 0) || (line == 3)) { text[textPointer++] = TXT_Language;