Mercurial > public > ostc4
diff Discovery/Src/tMenuEditXtra.c @ 827:ffb1036c27c2 Evo_2_23
Moved CO2 Menu from Xtra to Hardware:
The first CO2 sensor menu implementation was placed within the Xtra menu. In the new version the CO2 options may be accessed using the sensor overview menu of the Hardware page. With this change it is no longer necessary to take care for compile switches in the menus because the menu will only be shown if a CO2 sensor is detected.
author | Ideenmodellierer |
---|---|
date | Sun, 05 Nov 2023 20:19:08 +0100 |
parents | c4ee952b9425 |
children | 17d9d6eddd8d |
line wrap: on
line diff
--- a/Discovery/Src/tMenuEditXtra.c Wed Oct 11 17:49:19 2023 +0200 +++ b/Discovery/Src/tMenuEditXtra.c Sun Nov 05 20:19:08 2023 +0100 @@ -54,9 +54,6 @@ #ifdef ENABLE_PSCR_MODE static void openEdit_PSCR(void); #endif -#ifdef ENABLE_CO2_SUPPORT -static void openEdit_CO2Sensor(void); -#endif /* Announced function prototypes -----------------------------------------------*/ uint8_t OnAction_CompassHeading (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); @@ -69,11 +66,6 @@ static uint8_t OnAction_PSCRLungRation(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); #endif -#ifdef ENABLE_CO2_SUPPORT -static uint8_t OnAction_CO2OnOff(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -static uint8_t OnAction_CO2Calib(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -#endif - /* Exported functions --------------------------------------------------------*/ @@ -132,10 +124,6 @@ case 4: openEdit_PSCR(); break; #endif -#ifdef ENABLE_CO2_SUPPORT - case 6: openEdit_CO2Sensor(); - break; -#endif default: break; } @@ -321,42 +309,6 @@ } -#ifdef ENABLE_CO2_SUPPORT -static void openEdit_CO2Sensor() -{ - char text[32]; - - resetMenuEdit(CLUT_MenuPageXtra); - - snprintf(text,32,"\001%c",TXT_CO2Sensor); - write_topline(text); - - refresh_CO2Data(); - if(settingsGetPointer()->co2_sensor_active) - { - text[0] = '\005'; - } - else - { - text[0] = '\006'; - } - text[0] = TXT_CO2Sensor; - text[1] = 0; - - write_field_on_off(StMXTRA_CO2_Sensor, 30, 95, ME_Y_LINE3, &FontT48, text, settingsGetPointer()->co2_sensor_active); - - text[0] = TXT_2BYTE; - text[1] = TXT2BYTE_O2Calib; - text[2] = 0; - write_field_button(StMXTRA_CO2_Sensor_Calib,30, 800, ME_Y_LINE4, &FontT48, text); - - setEvent(StMXTRA_CO2_Sensor, (uint32_t)OnAction_CO2OnOff); - setEvent(StMXTRA_CO2_Sensor_Calib, (uint32_t)OnAction_CO2Calib); - - write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); -} -#endif - static uint8_t OnAction_CompassHeadingClear(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) { @@ -684,26 +636,4 @@ } #endif -#ifdef ENABLE_CO2_SUPPORT -static uint8_t OnAction_CO2OnOff(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - SSettings *pSettings = settingsGetPointer(); - if(pSettings->co2_sensor_active) - { - pSettings->co2_sensor_active = 0; - tMenuEdit_set_on_off(StMXTRA_CO2_Sensor,0); - } - else - { - pSettings->co2_sensor_active = 1; - tMenuEdit_set_on_off(StMXTRA_CO2_Sensor,1); - } - return UPDATE_DIVESETTINGS; -} -static uint8_t OnAction_CO2Calib(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - DataEX_setExtInterface_Cmd(EXT_INTERFACE_CO2_CALIB); - return UPDATE_DIVESETTINGS; -} -#endif