Mercurial > public > ostc4
comparison Discovery/Src/tMenuSystem.c @ 851:9f487ad38170 Evo_2_23
Added line checks for System Menu:
In the previous version the Timer options were always active even if the view was disabled. It is now disabled (grey) in case the view is disabled.
author | Ideenmodellierer |
---|---|
date | Thu, 07 Mar 2024 21:42:23 +0100 |
parents | ce8f71217f45 |
children | 44599695df41 |
comparison
equal
deleted
inserted
replaced
850:bc2fcd002fc4 | 851:9f487ad38170 |
---|---|
28 | 28 |
29 /* Includes ------------------------------------------------------------------*/ | 29 /* Includes ------------------------------------------------------------------*/ |
30 #include "tMenu.h" | 30 #include "tMenu.h" |
31 #include "tMenuSystem.h" | 31 #include "tMenuSystem.h" |
32 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() | 32 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() |
33 #include "t7.h" | |
33 | 34 |
34 static uint8_t customviewsSubpage = 0; | 35 static uint8_t customviewsSubpage = 0; |
35 | 36 |
36 /* Private function prototypes -----------------------------------------------*/ | 37 /* Private function prototypes -----------------------------------------------*/ |
37 char customview_TXT2BYTE_helper(uint8_t customViewId); | 38 char customview_TXT2BYTE_helper(uint8_t customViewId); |
181 { | 182 { |
182 strcpy(&text[textPointer],"\n\r"); | 183 strcpy(&text[textPointer],"\n\r"); |
183 textPointer += 2; | 184 textPointer += 2; |
184 } | 185 } |
185 | 186 |
186 if (line == 0 || line == 2) { | 187 if (line == 0 || line == 2) |
187 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); | 188 { |
188 } else { | 189 if(t7_customview_disabled(CVIEW_Timer)) |
190 { | |
191 text[textPointer++] = '\031'; /* change text color */ | |
192 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); | |
193 disableLine(StMSYS_Timer); | |
194 text[textPointer++] = '\020'; /* restore text color */ | |
195 } | |
196 else | |
197 { | |
198 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); | |
199 } | |
200 } else | |
201 { | |
189 textPointer += snprintf(&text[textPointer], 3, "\n\r"); | 202 textPointer += snprintf(&text[textPointer], 3, "\n\r"); |
190 } | 203 } |
191 | 204 |
192 if((line == 0) || (line == 3)) | 205 if((line == 0) || (line == 3)) |
193 { | 206 { |
301 strcpy(&text[textPointer],"\n\r"); | 314 strcpy(&text[textPointer],"\n\r"); |
302 textPointer += 2; | 315 textPointer += 2; |
303 | 316 |
304 return StMSYS; | 317 return StMSYS; |
305 } | 318 } |
306 | 319 void tMSystem_checkLineStatus(void) |
320 { | |
321 uint8_t localLineMask = 0; | |
322 uint8_t lineMask = getLineMask(StMSYS); | |
323 | |
324 if(t7_customview_disabled(CVIEW_Timer)) | |
325 { | |
326 localLineMask |= 1 << 2; | |
327 } | |
328 if(lineMask != localLineMask) | |
329 { | |
330 updateMenu(); | |
331 } | |
332 } | |
307 | 333 |
308 /* Private functions ---------------------------------------------------------*/ | 334 /* Private functions ---------------------------------------------------------*/ |