Mercurial > public > ostc4
comparison Discovery/Src/tMenuEditSystem.c @ 988:d9290c76b840 GasConsumption
OSTC4/5 joined code:
In the previous version code differences between OSTC4/5 were identified using the ENABLE_GPIO_V2 compiler switch. In the new version this is done using the display version as indicator which OSTC model is in used. Since this is detected by Firmware the information is forwarded from there to the RTE. This causes a little delay in the GPIO initialization but this applies only to the cold start of the RTE which should not happen very often.
author | ideenmodellierer |
---|---|
date | Sun, 06 Apr 2025 21:02:17 +0200 (4 weeks ago) |
parents | 5d5fa0a3b409 |
children | ac25c35a3c97 |
comparison
equal
deleted
inserted
replaced
984:41136649b90d | 988:d9290c76b840 |
---|---|
245 uint8_t day,month,year,hour,minute; | 245 uint8_t day,month,year,hour,minute; |
246 char text[32]; | 246 char text[32]; |
247 char formatStr[20]; | 247 char formatStr[20]; |
248 SSettings *pSettings; | 248 SSettings *pSettings; |
249 const SFirmwareData *pFirmwareInfo; | 249 const SFirmwareData *pFirmwareInfo; |
250 #if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2 | 250 #if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN |
251 uint8_t localHours = 0; | 251 uint8_t localHours = 0; |
252 uint8_t localMinutes = 0; | 252 uint8_t localMinutes = 0; |
253 #endif | 253 #endif |
254 pFirmwareInfo = firmwareDataGetPointer(); | 254 pFirmwareInfo = firmwareDataGetPointer(); |
255 const SDiveState * pStateReal = stateRealGetPointer(); | 255 const SDiveState * pStateReal = stateRealGetPointer(); |
283 | 283 |
284 write_label_fix( 20, 340, ME_Y_LINE1, &FontT42, TXT_TimeConfig); | 284 write_label_fix( 20, 340, ME_Y_LINE1, &FontT42, TXT_TimeConfig); |
285 write_label_fix( 20, 340, ME_Y_LINE2, &FontT42, TXT_Format); | 285 write_label_fix( 20, 340, ME_Y_LINE2, &FontT42, TXT_Format); |
286 write_label_fix( 20, 340, ME_Y_LINE3, &FontT42, TXT_DateConfig); | 286 write_label_fix( 20, 340, ME_Y_LINE3, &FontT42, TXT_DateConfig); |
287 write_label_fix( 20, 790, ME_Y_LINE4, &FontT42, TXT_Format); | 287 write_label_fix( 20, 790, ME_Y_LINE4, &FontT42, TXT_Format); |
288 #if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2 | 288 #if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN |
289 write_label_var( 20, 340, ME_Y_LINE5, &FontT42, "GNSS"); | 289 write_label_var( 20, 340, ME_Y_LINE5, &FontT42, "GNSS"); |
290 snprintf(text, 32, "%c%c", TXT_2BYTE, TXT2BYTE_TIMEZONE); | 290 snprintf(text, 32, "%c%c", TXT_2BYTE, TXT2BYTE_TIMEZONE); |
291 write_label_var( 20, 340, ME_Y_LINE6, &FontT42, text); | 291 write_label_var( 20, 340, ME_Y_LINE6, &FontT42, text); |
292 #endif | 292 #endif |
293 | 293 |
305 case YYMMDD: tMenuEdit_newInput(StMSYS1_Date, year, month, day, 0); | 305 case YYMMDD: tMenuEdit_newInput(StMSYS1_Date, year, month, day, 0); |
306 break; | 306 break; |
307 } | 307 } |
308 tMenuEdit_newButtonText(StMSYS1_FORMAT, formatStr); | 308 tMenuEdit_newButtonText(StMSYS1_FORMAT, formatStr); |
309 | 309 |
310 #if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2 | 310 #if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN |
311 if(pStateReal->lifeData.gnssData.alive & GNSS_ALIVE_STATE_TIME) | 311 if(pStateReal->lifeData.gnssData.alive & GNSS_ALIVE_STATE_TIME) |
312 { | 312 { |
313 convertUTCToLocal(pStateReal->lifeData.gnssData.DateTime.hour, pStateReal->lifeData.gnssData.DateTime.min, &localHours, &localMinutes); | 313 convertUTCToLocal(pStateReal->lifeData.gnssData.DateTime.hour, pStateReal->lifeData.gnssData.DateTime.min, &localHours, &localMinutes); |
314 convertStringOfDate_DDMMYY(formatStr, 20, pStateReal->lifeData.gnssData.DateTime.day | 314 convertStringOfDate_DDMMYY(formatStr, 20, pStateReal->lifeData.gnssData.DateTime.day |
315 , pStateReal->lifeData.gnssData.DateTime.month | 315 , pStateReal->lifeData.gnssData.DateTime.month |
371 | 371 |
372 write_label_fix( 20, 340, ME_Y_LINE1, &FontT42, TXT_TimeConfig); | 372 write_label_fix( 20, 340, ME_Y_LINE1, &FontT42, TXT_TimeConfig); |
373 write_label_fix( 20, 340, ME_Y_LINE2, &FontT42, TXT_Format); | 373 write_label_fix( 20, 340, ME_Y_LINE2, &FontT42, TXT_Format); |
374 write_label_fix( 20, 340, ME_Y_LINE3, &FontT42, TXT_DateConfig); | 374 write_label_fix( 20, 340, ME_Y_LINE3, &FontT42, TXT_DateConfig); |
375 write_label_fix( 20, 790, ME_Y_LINE4, &FontT42, TXT_Format); | 375 write_label_fix( 20, 790, ME_Y_LINE4, &FontT42, TXT_Format); |
376 #if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2 | 376 #if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN |
377 write_label_var( 20, 340, ME_Y_LINE5, &FontT42, "GNSS"); | 377 write_label_var( 20, 340, ME_Y_LINE5, &FontT42, "GNSS"); |
378 snprintf(text, 32, "%c%c", TXT_2BYTE, TXT2BYTE_TIMEZONE); | 378 snprintf(text, 32, "%c%c", TXT_2BYTE, TXT2BYTE_TIMEZONE); |
379 write_label_var( 20, 340, ME_Y_LINE6, &FontT42, text); | 379 write_label_var( 20, 340, ME_Y_LINE6, &FontT42, text); |
380 #endif | 380 #endif |
381 | 381 |
393 break; | 393 break; |
394 } | 394 } |
395 | 395 |
396 write_field_button(StMSYS1_FORMAT, 320, 790, ME_Y_LINE4, &FontT48, formatStr); | 396 write_field_button(StMSYS1_FORMAT, 320, 790, ME_Y_LINE4, &FontT48, formatStr); |
397 | 397 |
398 #if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2 | 398 #if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN |
399 snprintf(text, 32, "--:--"); | 399 snprintf(text, 32, "--:--"); |
400 write_field_button(StMSYS1_GNSSDT, 320, 790, ME_Y_LINE5, &FontT48, text); | 400 write_field_button(StMSYS1_GNSSDT, 320, 790, ME_Y_LINE5, &FontT48, text); |
401 write_field_sdigit(StMSYS1_ZONE, 320, 780, ME_Y_LINE6, &FontT48, "UTC: ###:###", pSettings->timeZone.hours, pSettings->timeZone.minutes,0,0); | 401 write_field_sdigit(StMSYS1_ZONE, 320, 780, ME_Y_LINE6, &FontT48, "UTC: ###:###", pSettings->timeZone.hours, pSettings->timeZone.minutes,0,0); |
402 #endif | 402 #endif |
403 | 403 |
404 setEvent(StMSYS1_Date, (uint32_t)OnAction_Date); | 404 setEvent(StMSYS1_Date, (uint32_t)OnAction_Date); |
405 setEvent(StMSYS1_Time, (uint32_t)OnAction_Time); | 405 setEvent(StMSYS1_Time, (uint32_t)OnAction_Time); |
406 setEvent(StMSYS1_12HR, (uint32_t)OnAction_12HR); | 406 setEvent(StMSYS1_12HR, (uint32_t)OnAction_12HR); |
407 setEvent(StMSYS1_FORMAT, (uint32_t)OnAction_Format); | 407 setEvent(StMSYS1_FORMAT, (uint32_t)OnAction_Format); |
408 #if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2 | 408 #if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN |
409 setEvent(StMSYS1_GNSSDT, (uint32_t)OnAction_SetGnss); | 409 setEvent(StMSYS1_GNSSDT, (uint32_t)OnAction_SetGnss); |
410 setEvent(StMSYS1_ZONE, (uint32_t)OnAction_UTC); | 410 setEvent(StMSYS1_ZONE, (uint32_t)OnAction_UTC); |
411 #endif | 411 #endif |
412 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); | 412 write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); |
413 } | 413 } |