Mercurial > public > ostc4
annotate Discovery/Src/tMenuCvOption.c @ 1064:449e0f8f23d0 Icon_Integration
Code cleanup co2 sensor:
In the very first implementation the co2 sensor was directly switch by the main CPU via command request. Since the sensor map implementation this function was replaced and the old function are no longer needed => have been removed.
| author | Ideenmodellierer |
|---|---|
| date | Mon, 16 Feb 2026 21:11:59 +0100 |
| parents | 33b91584d827 |
| children |
| rev | line source |
|---|---|
| 999 | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 /// -*- coding: UTF-8 -*- | |
| 3 /// | |
| 4 /// \file Discovery/Src/tMenuCvOption.c | |
| 5 /// \brief Main Template file for Menu Page System settings | |
| 6 /// \author heinrichs weikamp gmbh | |
| 7 /// \date 24-Apr-2025 | |
| 8 /// | |
| 9 /// \details | |
| 10 /// | |
| 11 /// $Id$ | |
| 12 /////////////////////////////////////////////////////////////////////////////// | |
| 13 /// \par Copyright (c) 2014-2025 Heinrichs Weikamp gmbh | |
| 14 /// | |
| 15 /// This program is free software: you can redistribute it and/or modify | |
| 16 /// it under the terms of the GNU General Public License as published by | |
| 17 /// the Free Software Foundation, either version 3 of the License, or | |
| 18 /// (at your option) any later version. | |
| 19 /// | |
| 20 /// This program is distributed in the hope that it will be useful, | |
| 21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 23 /// GNU General Public License for more details. | |
| 24 /// | |
| 25 /// You should have received a copy of the GNU General Public License | |
| 26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 27 ////////////////////////////////////////////////////////////////////////////// | |
| 28 | |
| 29 /* Includes ------------------------------------------------------------------*/ | |
| 30 #include "tMenu.h" | |
| 31 #include "tMenuCvOption.h" | |
| 32 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() | |
| 33 #include "t7.h" | |
| 34 | |
| 35 /* Private function prototypes -----------------------------------------------*/ | |
| 36 | |
| 37 /* Exported functions --------------------------------------------------------*/ | |
| 38 | |
| 39 uint32_t tMCvOption_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext) | |
| 40 { | |
| 41 SSettings *data; | |
| 42 uint8_t textPointer; | |
| 43 | |
| 44 data = settingsGetPointer(); | |
| 45 textPointer = 0; | |
| 46 *tab = 300; | |
| 47 *subtext = 0; | |
| 48 | |
| 49 resetLineMask(StMOption); | |
| 50 | |
| 51 if((line == 0) || (line == 1)) | |
| 52 { | |
| 53 text[textPointer++] = TXT_2BYTE; | |
| 54 text[textPointer++] = TXT2BYTE_Compass; | |
| 55 text[textPointer++] = '\t'; | |
| 56 | |
| 57 if(settingsGetPointer()->compassBearing != 0) | |
| 58 { | |
| 59 textPointer += snprintf(&text[textPointer], 20, "(%03u`)", settingsGetPointer()->compassBearing % 360); | |
| 60 } | |
| 61 text[textPointer] = 0; | |
| 62 } | |
| 63 nextline(text,&textPointer); | |
| 64 if (line == 0 || line == 2) | |
| 65 { | |
| 66 if(t7_customview_disabled(CVIEW_Timer)) | |
| 67 { | |
| 68 text[textPointer++] = '\031'; /* change text color */ | |
| 69 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); | |
| 70 text[textPointer++] = '\020'; /* restore text color */ | |
| 71 } | |
| 72 else | |
| 73 { | |
| 74 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); | |
| 75 } | |
| 76 } | |
| 77 nextline(text,&textPointer); | |
| 78 | |
| 1032 | 79 #ifdef ENABLE_PULSE_SENSOR_BT |
| 80 if (line == 0 || line == 3) | |
| 81 { | |
| 82 textPointer += snprintf(&text[textPointer], 21, "%c%c", TXT_2BYTE, TXT2BYTE_Pulse); | |
| 83 } | |
| 84 nextline(text,&textPointer); | |
| 85 | |
| 86 #endif | |
| 87 | |
| 999 | 88 return StMOption; |
| 89 } | |
| 90 void tMCvOption_checkLineStatus(void) | |
| 91 { | |
| 92 uint8_t localLineMask = 0; | |
|
1001
21142f4fa968
Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents:
999
diff
changeset
|
93 uint8_t lineMask = getLineMask(StMOption); |
|
21142f4fa968
Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents:
999
diff
changeset
|
94 |
| 999 | 95 if(t7_customview_disabled(CVIEW_Timer)) |
| 96 { | |
| 97 localLineMask |= 1 << 2; | |
| 98 } | |
|
1001
21142f4fa968
Cleanup menu structucture afer menu shift:
Ideenmodellierer
parents:
999
diff
changeset
|
99 |
| 999 | 100 if(lineMask != localLineMask) |
| 101 { | |
| 102 updateMenu(); | |
| 103 } | |
| 104 } | |
| 105 | |
| 106 /* Private functions ---------------------------------------------------------*/ |
