comparison Discovery/Src/test_vpm.c @ 273:5fe136480a47

Merged in janlmulder/ostc4/write-from-sim (pull request #20) Cleanup and debug capabilty to write logbook from simulator
author heinrichsweikamp <bitbucket@heinrichsweikamp.com>
date Sun, 28 Apr 2019 07:05:23 +0000
parents 6e78137952af
children 54d14bc2083c
comparison
equal deleted inserted replaced
267:cf6ad20380fb 273:5fe136480a47
525 else 525 else
526 { 526 {
527 input.events.gasChange = 0; 527 input.events.gasChange = 0;
528 input.events.info_GasChange = 0; 528 input.events.info_GasChange = 0;
529 } 529 }
530 logbook_writeSample(input); 530 logbook_writeSample(&input);
531 } 531 }
532 volatile SLogbookHeader* logbookHeader = logbook_getCurrentHeader(); 532 volatile SLogbookHeader* logbookHeader = logbook_getCurrentHeader();
533 533
534 logbookHeader->total_diveTime_seconds = input.lifeData.dive_time_seconds; 534 logbookHeader->total_diveTime_seconds = input.lifeData.dive_time_seconds;
535 logbookHeader->maxDepth = input.lifeData.max_depth_meter * 100; 535 logbookHeader->maxDepth = input.lifeData.max_depth_meter * 100;
588 else 588 else
589 { 589 {
590 input.events.gasChange = 0; 590 input.events.gasChange = 0;
591 input.events.info_GasChange = 0; 591 input.events.info_GasChange = 0;
592 } 592 }
593 logbook_writeSample(input); 593 logbook_writeSample(&input);
594 } 594 }
595 volatile SLogbookHeader* logbookHeader = logbook_getCurrentHeader(); 595 volatile SLogbookHeader* logbookHeader = logbook_getCurrentHeader();
596 596
597 logbookHeader->total_diveTime_seconds = input.lifeData.dive_time_seconds; 597 logbookHeader->total_diveTime_seconds = input.lifeData.dive_time_seconds;
598 logbookHeader->maxDepth = input.lifeData.max_depth_meter * 100; 598 logbookHeader->maxDepth = input.lifeData.max_depth_meter * 100;
650 else 650 else
651 { 651 {
652 input.events.gasChange = 0; 652 input.events.gasChange = 0;
653 input.events.info_GasChange = 0; 653 input.events.info_GasChange = 0;
654 } 654 }
655 logbook_writeSample(input); 655 logbook_writeSample(&input);
656 } 656 }
657 volatile SLogbookHeader* logbookHeader = logbook_getCurrentHeader(); 657 volatile SLogbookHeader* logbookHeader = logbook_getCurrentHeader();
658 658
659 logbookHeader->total_diveTime_seconds = input.lifeData.dive_time_seconds; 659 logbookHeader->total_diveTime_seconds = input.lifeData.dive_time_seconds;
660 logbookHeader->maxDepth = input.lifeData.max_depth_meter * 100; 660 logbookHeader->maxDepth = input.lifeData.max_depth_meter * 100;
706 input.lifeData.depth_meter -= ascendrate_seconds; 706 input.lifeData.depth_meter -= ascendrate_seconds;
707 if(input.lifeData.depth_meter < 0) 707 if(input.lifeData.depth_meter < 0)
708 input.lifeData.depth_meter = 0; 708 input.lifeData.depth_meter = 0;
709 } 709 }
710 710
711 logbook_writeSample(input); 711 logbook_writeSample(&input);
712 } 712 }
713 volatile SLogbookHeader* logbookHeader = logbook_getCurrentHeader(); 713 volatile SLogbookHeader* logbookHeader = logbook_getCurrentHeader();
714 logbookHeader->total_diveTime_seconds = input.lifeData.dive_time_seconds; 714 logbookHeader->total_diveTime_seconds = input.lifeData.dive_time_seconds;
715 logbookHeader->maxDepth = input.lifeData.max_depth_meter * 100; 715 logbookHeader->maxDepth = input.lifeData.max_depth_meter * 100;
716 logbook_EndDive(); 716 logbook_EndDive();