comparison Discovery/Src/simulation.c @ 678:05cdd367dbd0 Betatest

Bugfix: deco planner did not initialize properly Redoing a deco calculation in the planner, after a change in used gasses, did result in wrong gas usage figures. And a restart after sleep made things right again. This all feels like some initialization problem. Nothing very important as it's only a desktop planner, but a bug it is. Code reading, I found the not correctly initialized data. Reported-by: Teun (forum user tdewilt2) Signed-off-by: Jan Mulder <jan@jlmulder.nl>
author Jan Mulder <jan@jlmulder.nl>
date Thu, 21 Apr 2022 21:02:50 +0200
parents 55a9aa740f13
children 01f40cb1057e
comparison
equal deleted inserted replaced
677:1953cd9145b3 678:05cdd367dbd0
389 389
390 SDecoinfo* simulation_decoplaner(uint16_t depth_meter, uint16_t intervall_time_minutes, uint16_t dive_time_minutes, uint8_t *gasChangeListDepthGas20x2) 390 SDecoinfo* simulation_decoplaner(uint16_t depth_meter, uint16_t intervall_time_minutes, uint16_t dive_time_minutes, uint8_t *gasChangeListDepthGas20x2)
391 { 391 {
392 uint8_t ptrGasChangeList = 0; // new hw 160704 392 uint8_t ptrGasChangeList = 0; // new hw 160704
393 393
394 for (int i = 0; i < 40; i++)
395 gasChangeListDepthGas20x2[i] = 0;
396
394 SDiveState * pDiveState = &stateSim; 397 SDiveState * pDiveState = &stateSim;
395 copyDiveSettingsToSim(); 398 copyDiveSettingsToSim();
396 vpm_init(&pDiveState->vpm, pDiveState->diveSettings.vpm_conservatism, 0, 0); 399 vpm_init(&pDiveState->vpm, pDiveState->diveSettings.vpm_conservatism, 0, 0);
397 //buehlmann_init(); 400 //buehlmann_init();
398 //timer_init(); 401 //timer_init();