# HG changeset patch # User Ideenmodellierer # Date 1678215313 -3600 # Node ID ec7b62983a8c9e82c008100d577bcd4c2355094a # Parent 4a28402e4aca4d634a1c57f2ee5739ae87506178 Only show autodetection in sensor menu if external interface is present: In the previous version the autodetection was visible even if not supported by hardware. The autodetection will now only be shown if the ADC is available (new HW revision). A future improvment could be to make the decision based on a special HW number which indicates a OSTC4 version with external pin connector. diff -r 4a28402e4aca -r ec7b62983a8c Discovery/Src/tMenuEditHardware.c --- a/Discovery/Src/tMenuEditHardware.c Tue Mar 07 19:52:18 2023 +0100 +++ b/Discovery/Src/tMenuEditHardware.c Tue Mar 07 19:55:13 2023 +0100 @@ -425,7 +425,7 @@ else { if((pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) || (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG) -#ifdef ENABLE_CO2_SUPPORT +#ifdef ENABLE_SENTINEL_MODE || (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL) #endif ) @@ -439,11 +439,14 @@ } } - strSensorId[0] = TXT_2BYTE; - strSensorId[1] = TXT2BYTE_SensorDetect; - strSensorId[2] = 0; + if(DataEX_external_ADC_Present()) + { + strSensorId[0] = TXT_2BYTE; + strSensorId[1] = TXT2BYTE_SensorDetect; + strSensorId[2] = 0; - write_label_var( 30, 340, ME_Y_LINE6, &FontT48, strSensorId); + write_label_var( 30, 340, ME_Y_LINE6, &FontT48, strSensorId); + } if(haveSensorInfo == 1) { @@ -545,13 +548,16 @@ write_field_button(StMHARD3_Sensor_Info, 30, 800, ME_Y_LINE5, &FontT48, ""); } - text[0] = TXT_2BYTE; - text[1] = TXT2BYTE_SensorDetect; - text[2] = 0; + if(DataEX_external_ADC_Present()) + { + text[0] = TXT_2BYTE; + text[1] = TXT2BYTE_SensorDetect; + text[2] = 0; - write_label_var( 30, 340, ME_Y_LINE6, &FontT48, text); + write_label_var( 30, 340, ME_Y_LINE6, &FontT48, text); - write_field_button(StMHARD3_Sensor_Detect, 30, 800, ME_Y_LINE6, &FontT48, text); + write_field_button(StMHARD3_Sensor_Detect, 30, 800, ME_Y_LINE6, &FontT48, text); + } if((pSettings->ext_sensor_map[0] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[0] < SENSOR_TYPE_O2_END)) { @@ -580,7 +586,10 @@ setEvent(StMHARD3_Sensor_Info, (uint32_t)OnAction_Sensor_Info); } - setEvent(StMHARD3_Sensor_Detect, (uint32_t)OnAction_Sensor_Detect); + if(DataEX_external_ADC_Present()) + { + setEvent(StMHARD3_Sensor_Detect, (uint32_t)OnAction_Sensor_Detect); + } write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); }