comparison Discovery/Src/data_central.c @ 771:29d9b5bc7946

Revised automatic setpoint change. The proposed approach is essentially the approach used by most controllers of eCCR ('upshift' on descent, 'downshift' on ascent), so that the OSTC4 when used as a backup computer for eCCR will make the changes at the same time as the eCCR itself.
author heinrichsweikamp
date Fri, 21 Apr 2023 09:48:23 +0200
parents 8a2337c7af52
children 6169309d6eb9
comparison
equal deleted inserted replaced
770:8deb28b2d4da 771:29d9b5bc7946
499 lifeData->actualGas.helium_percentage = pSettings->gas[gasId].helium_percentage; 499 lifeData->actualGas.helium_percentage = pSettings->gas[gasId].helium_percentage;
500 lifeData->actualGas.setPoint_cbar = setpoint_cbar; 500 lifeData->actualGas.setPoint_cbar = setpoint_cbar;
501 lifeData->actualGas.change_during_ascent_depth_meter_otherwise_zero = 0; 501 lifeData->actualGas.change_during_ascent_depth_meter_otherwise_zero = 0;
502 lifeData->actualGas.AppliedDiveMode = stateUsed->diveSettings.diveMode; 502 lifeData->actualGas.AppliedDiveMode = stateUsed->diveSettings.diveMode;
503 lifeData->actualGas.pscr_factor = 1.0 / pSettings->pscr_lung_ratio * pSettings->pscr_o2_drop; 503 lifeData->actualGas.pscr_factor = 1.0 / pSettings->pscr_lung_ratio * pSettings->pscr_o2_drop;
504 if(isLoopMode(pSettings->dive_mode) && (gasId > NUM_OFFSET_DILUENT)) 504 if (isLoopMode(pSettings->dive_mode) && gasId > NUM_OFFSET_DILUENT) {
505 lifeData->lastDiluent_GasIdInSettings = gasId; 505 lifeData->lastDiluent_GasIdInSettings = gasId;
506 lifeData->lastSetpointChangeDepthM = lifeData->depth_meter;
507 }
506 } 508 }
507 509
508 510
509 void setActualGas_DM(SLifeData *lifeData, uint8_t gasId, uint8_t setpoint_cbar) 511 void setActualGas_DM(SLifeData *lifeData, uint8_t gasId, uint8_t setpoint_cbar)
510 { 512 {