Mercurial > public > ostc4
diff Discovery/Src/tMenuEditHardware.c @ 696:cc542448fb28
Merge
author | heinrichsweikamp |
---|---|
date | Fri, 19 Aug 2022 11:30:24 +0200 |
parents | 4dd487b407f7 |
children | 2f457024049b |
line wrap: on
line diff
--- a/Discovery/Src/tMenuEditHardware.c Mon Nov 01 12:39:34 2021 +0100 +++ b/Discovery/Src/tMenuEditHardware.c Fri Aug 19 11:30:24 2022 +0200 @@ -336,11 +336,18 @@ switch(settingsGetPointer()->ppo2sensors_source) { default: - case O2_SENSOR_SOURCE_OPTIC: text[1] = TXT2BYTE_O2IFOptic; + case O2_SENSOR_SOURCE_OPTIC: text[1] = TXT2BYTE_O2IFOptic; + text[2] = 0; + break; + case O2_SENSOR_SOURCE_ANALOG: text[1] = TXT2BYTE_O2IFAnalog; + text[2] = 0; break; - case O2_SENSOR_SOURCE_ANALOG: text[1] = TXT2BYTE_O2IFAnalog; +#ifdef ENABLE_SENTINEL_MODE + case O2_SENSOR_SOURCE_SENTINEL: snprintf(text, 10,"Sentinel"); + break; +#endif } - text[2] = 0; + write_label_var( 400, 800, ME_Y_LINE6, &FontT48, text); } tMenuEdit_refresh_field(StMHARD3_O2_Sensor1); @@ -378,12 +385,16 @@ write_field_on_off(StMHARD3_O2_Sensor2, 30, 95, ME_Y_LINE2, &FontT48, "", sensorActive[1]); write_field_on_off(StMHARD3_O2_Sensor3, 30, 95, ME_Y_LINE3, &FontT48, "", sensorActive[2]); - if(settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) + if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) +#ifdef ENABLE_SENTINEL_MODE + || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL) +#endif + ) { write_label_fix( 30, 800, ME_Y_LINE4, &FontT48, TXT2BYTE_O2Calib); write_label_var( 400, 800, ME_Y_LINE4, &FontT48, "\016\016 %\017"); - write_field_toggle(StMHARD3_O2_Calibrate, 400, 800, ME_Y_LINE4, &FontT48, "", 21, 100); + write_field_toggle(StMHARD3_O2_Calibrate, 400, 800, ME_Y_LINE4, &FontT48, "", 21, 98); } text[0] = TXT_Fallback; @@ -399,7 +410,11 @@ setEvent(StMHARD3_O2_Sensor1, (uint32_t)OnAction_Sensor1); setEvent(StMHARD3_O2_Sensor2, (uint32_t)OnAction_Sensor2); setEvent(StMHARD3_O2_Sensor3, (uint32_t)OnAction_Sensor3); - if(settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) + if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) +#ifdef ENABLE_SENTINEL_MODE + || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL) +#endif + ) { setEvent(StMHARD3_O2_Calibrate, (uint32_t)OnAction_O2_Calibrate); } @@ -517,7 +532,7 @@ { if(O2_calib_gas == 21) { - O2_calib_gas = 100; + O2_calib_gas = 98; } else { @@ -537,11 +552,8 @@ { uint8_t source = settingsGetPointer()->ppo2sensors_source; - if(source == O2_SENSOR_SOURCE_OPTIC) - { - source = O2_SENSOR_SOURCE_ANALOG; - } - else + source++; + if(source == O2_SENSOR_SOURCE_MAX) { source = O2_SENSOR_SOURCE_OPTIC; }