comparison Discovery/Src/data_exchange_main.c @ 1058:3c73180fde1d Icon_Integration tip

Added log entry for surface GF: The surface GF has been added to the logbook data. A function records the GF which is present while entering close to surface condition for later storage. This is needed to avoid that an already decreased GF (after dive mode exit time) GF is stored. The surface GF is shown at logbook page1 and is available in the header data for external logbook services.
author Ideenmodellierer
date Sat, 10 Jan 2026 19:53:01 +0100
parents 8c0134a287da
children
comparison
equal deleted inserted replaced
1057:24c1e3367a2e 1058:3c73180fde1d
843 } 843 }
844 844
845 void DataEX_copy_to_LifeData(_Bool *modeChangeFlag) 845 void DataEX_copy_to_LifeData(_Bool *modeChangeFlag)
846 { 846 {
847 static uint16_t getDeviceDataAfterStartOfMainCPU = 20; 847 static uint16_t getDeviceDataAfterStartOfMainCPU = 20;
848 static uint16_t lastcounterSecondsShallowDepth = 0;
848 849
849 SDiveState *pStateReal = stateRealGetPointerWrite(); 850 SDiveState *pStateReal = stateRealGetPointerWrite();
850 uint8_t idx; 851 uint8_t idx;
851 float meter = 0; 852 float meter = 0;
852 853
1187 -8.216*pow(10,-20)*pow(pStateReal->lifeData.CO2_data.CO2_ppm,3)+2.311*pow(10,-14)*pow(pStateReal->lifeData.CO2_data.CO2_ppm,2) - 2.195*pow(10,-9)*pStateReal->lifeData.CO2_data.CO2_ppm - 1.471*pow(10,-3); 1188 -8.216*pow(10,-20)*pow(pStateReal->lifeData.CO2_data.CO2_ppm,3)+2.311*pow(10,-14)*pow(pStateReal->lifeData.CO2_data.CO2_ppm,2) - 2.195*pow(10,-9)*pStateReal->lifeData.CO2_data.CO2_ppm - 1.471*pow(10,-3);
1188 pStateReal->lifeData.CO2_data.CO2_ppm = pStateReal->lifeData.CO2_data.CO2_ppm / (1.0 + (CO2Corr * ((stateRealGetPointer()->lifeData.pressure_surface_bar * 1000) - ((stateRealGetPointer()->lifeData.ppO2Sensor_bar[2] *1000))))); 1189 pStateReal->lifeData.CO2_data.CO2_ppm = pStateReal->lifeData.CO2_data.CO2_ppm / (1.0 + (CO2Corr * ((stateRealGetPointer()->lifeData.pressure_surface_bar * 1000) - ((stateRealGetPointer()->lifeData.ppO2Sensor_bar[2] *1000)))));
1189 #endif 1190 #endif
1190 } 1191 }
1191 1192
1193 /* close to surface ? */
1194 if((pStateReal->lifeData.counterSecondsShallowDepth != 0) && (lastcounterSecondsShallowDepth == 0))
1195 {
1196 if( (pStateReal->decolistBuehlmann.gf_surf * 100.0) < 255.0)
1197 {
1198 pStateReal->lifeData.gf_surf_log = pStateReal->decolistBuehlmann.gf_surf * 100.0;
1199 }
1200 else
1201 {
1202 pStateReal->lifeData.gf_surf_log = 255;
1203 }
1204 }
1205 lastcounterSecondsShallowDepth = pStateReal->lifeData.counterSecondsShallowDepth;
1206
1192 /* apnea specials 1207 /* apnea specials
1193 */ 1208 */
1194 if(pStateReal->diveSettings.diveMode == DIVEMODE_Apnea) 1209 if(pStateReal->diveSettings.diveMode == DIVEMODE_Apnea)
1195 { 1210 {
1196 if(pStateReal->mode != MODE_DIVE) 1211 if(pStateReal->mode != MODE_DIVE)