Mercurial > public > ostc4
comparison Discovery/Src/tMenuEditHardware.c @ 703:2f457024049b
Added selection of digital o2 sensor source to HW menu:
Beside analog sensing a pure digital and a mixed mode (analag + digital) may now be selected by the HW sensor menu.
Bugfix: cursor was jumping to the first menu item in case the sensor source was changed. This was fixed and the cursor now stays at the sensor input selection.
author | Ideenmodellierer |
---|---|
date | Fri, 28 Oct 2022 20:32:24 +0200 |
parents | 4dd487b407f7 |
children | 7e3bf2c0cd40 |
comparison
equal
deleted
inserted
replaced
702:6d7c812fc173 | 703:2f457024049b |
---|---|
340 text[2] = 0; | 340 text[2] = 0; |
341 break; | 341 break; |
342 case O2_SENSOR_SOURCE_ANALOG: text[1] = TXT2BYTE_O2IFAnalog; | 342 case O2_SENSOR_SOURCE_ANALOG: text[1] = TXT2BYTE_O2IFAnalog; |
343 text[2] = 0; | 343 text[2] = 0; |
344 break; | 344 break; |
345 case O2_SENSOR_SOURCE_DIGITAL: text[1] = TXT2BYTE_O2IFDigital; | |
346 text[2] = 0; | |
347 break; | |
348 case O2_SENSOR_SOURCE_ANADIG: text[1] = TXT2BYTE_O2IFAnalog; | |
349 text[2] = ' '; | |
350 text[3] = '+'; | |
351 text[4] = ' '; | |
352 text[5] = TXT_2BYTE; | |
353 text[6] = TXT2BYTE_O2IFDigital; | |
354 text[7] = 0; | |
355 break; | |
345 #ifdef ENABLE_SENTINEL_MODE | 356 #ifdef ENABLE_SENTINEL_MODE |
346 case O2_SENSOR_SOURCE_SENTINEL: snprintf(text, 10,"Sentinel"); | 357 case O2_SENSOR_SOURCE_SENTINEL: snprintf(text, 10,"Sentinel"); |
347 break; | 358 break; |
348 #endif | 359 #endif |
349 } | 360 } |
383 | 394 |
384 write_field_on_off(StMHARD3_O2_Sensor1, 30, 95, ME_Y_LINE1, &FontT48, "", sensorActive[0]); | 395 write_field_on_off(StMHARD3_O2_Sensor1, 30, 95, ME_Y_LINE1, &FontT48, "", sensorActive[0]); |
385 write_field_on_off(StMHARD3_O2_Sensor2, 30, 95, ME_Y_LINE2, &FontT48, "", sensorActive[1]); | 396 write_field_on_off(StMHARD3_O2_Sensor2, 30, 95, ME_Y_LINE2, &FontT48, "", sensorActive[1]); |
386 write_field_on_off(StMHARD3_O2_Sensor3, 30, 95, ME_Y_LINE3, &FontT48, "", sensorActive[2]); | 397 write_field_on_off(StMHARD3_O2_Sensor3, 30, 95, ME_Y_LINE3, &FontT48, "", sensorActive[2]); |
387 | 398 |
388 if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) | 399 if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG) |
389 #ifdef ENABLE_SENTINEL_MODE | 400 #ifdef ENABLE_SENTINEL_MODE |
390 || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL) | 401 || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL) |
391 #endif | 402 #endif |
392 ) | 403 ) |
393 { | 404 { |
408 } | 419 } |
409 | 420 |
410 setEvent(StMHARD3_O2_Sensor1, (uint32_t)OnAction_Sensor1); | 421 setEvent(StMHARD3_O2_Sensor1, (uint32_t)OnAction_Sensor1); |
411 setEvent(StMHARD3_O2_Sensor2, (uint32_t)OnAction_Sensor2); | 422 setEvent(StMHARD3_O2_Sensor2, (uint32_t)OnAction_Sensor2); |
412 setEvent(StMHARD3_O2_Sensor3, (uint32_t)OnAction_Sensor3); | 423 setEvent(StMHARD3_O2_Sensor3, (uint32_t)OnAction_Sensor3); |
413 if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) | 424 if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG) |
414 #ifdef ENABLE_SENTINEL_MODE | 425 #ifdef ENABLE_SENTINEL_MODE |
415 || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL) | 426 || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL) |
416 #endif | 427 #endif |
417 ) | 428 ) |
418 { | 429 { |
560 | 571 |
561 settingsGetPointer()->ppo2sensors_source = source; | 572 settingsGetPointer()->ppo2sensors_source = source; |
562 | 573 |
563 resetMenuEdit(CLUT_MenuPageHardware); /* rebuild menu structure (Hide HUD <=> Show Calibrate) */ | 574 resetMenuEdit(CLUT_MenuPageHardware); /* rebuild menu structure (Hide HUD <=> Show Calibrate) */ |
564 openEdit_O2Sensors(); | 575 openEdit_O2Sensors(); |
576 tMenuEdit_select(StMHARD3_O2_Source); | |
565 return UPDATE_DIVESETTINGS; | 577 return UPDATE_DIVESETTINGS; |
566 } | 578 } |
567 | 579 |
568 void openEdit_Brightness(void) | 580 void openEdit_Brightness(void) |
569 { | 581 { |