comparison Discovery/Src/data_central.c @ 788:4abfb8a2a435

Define explicit setpoints for low / high / deco. Add an option to delay the switch to SPlow until all decompression has been cleared. (mikeller)
author heinrichsweikamp
date Tue, 04 Jul 2023 14:39:06 +0200
parents 45b8f3c2acce
children dd7ce655db26
comparison
equal deleted inserted replaced
787:aeb72882f30a 788:4abfb8a2a435
407 pSimData->vpm.repetitive_variables_not_valid = pVpmData->repetitive_variables_not_valid; 407 pSimData->vpm.repetitive_variables_not_valid = pVpmData->repetitive_variables_not_valid;
408 } 408 }
409 } 409 }
410 410
411 411
412
413
414 void updateSetpointStateUsed(void) 412 void updateSetpointStateUsed(void)
415 { 413 {
416 if(!isLoopMode(stateUsed->diveSettings.diveMode)) 414 if(!isLoopMode(stateUsed->diveSettings.diveMode))
417 { 415 {
418 stateUsedWrite->lifeData.actualGas.setPoint_cbar = 0; 416 stateUsedWrite->lifeData.actualGas.setPoint_cbar = 0;
468 gasId = i; 466 gasId = i;
469 break; 467 break;
470 } 468 }
471 } 469 }
472 setActualGas(lifeData, gasId, setpoint_cbar); 470 setActualGas(lifeData, gasId, setpoint_cbar);
471
472 lifeData->setpointDecoActivated = false;
473 lifeData->setpointLowDelayed = false;
473 } 474 }
474 475
475 void setActualGasAir(SLifeData *lifeData) 476 void setActualGasAir(SLifeData *lifeData)
476 { 477 {
477 uint8_t nitrogen; 478 uint8_t nitrogen;
873 874
874 // if heading == 0 set compassHeading to 360, because compassHeading == 0 means 'off' 875 // if heading == 0 set compassHeading to 360, because compassHeading == 0 means 'off'
875 876
876 stateUsedWrite->diveSettings.compassHeading = ((heading - 360) % 360) + 360; 877 stateUsedWrite->diveSettings.compassHeading = ((heading - 360) % 360) + 360;
877 } 878 }
879
880
881 const SDecoinfo *getDecoInfo(void)
882 {
883 const SDecoinfo *decoInfo;
884 if (stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) {
885 decoInfo = &stateUsed->decolistBuehlmann;
886 } else {
887 decoInfo = &stateUsed->decolistVPM;
888 }
889
890 return decoInfo;
891 }