comparison Discovery/Src/settings.c @ 820:7322adb00305

Split definition of custom views: In the previous version the T7 and T3 custom views were defined using the same enum. As result an ID shift may happen causing errors in the selection of the big font views. The second reason to split the definition is that shift operations are used in uint32_t variable (limit 32). The total number of current views is 27 => splitting will avoid ID problems in case new views are added.
author Ideenmodellierer
date Sun, 24 Sep 2023 18:43:12 +0200
parents 40e951cfa443
children b7d93ff6b3b2
comparison
equal deleted inserted replaced
819:24b39a432bc2 820:7322adb00305
36 #include "motion.h" 36 #include "motion.h"
37 #include "t7.h" 37 #include "t7.h"
38 #include "data_central.h" 38 #include "data_central.h"
39 39
40 static uint8_t settingsWarning = 0; /* Active if setting values have been corrected */ 40 static uint8_t settingsWarning = 0; /* Active if setting values have been corrected */
41 static SSettingsStatus SettingsStatus; /* Structure containing number of corrections and first occurrence */
41 42
42 SSettings Settings; 43 SSettings Settings;
43 44
44 const uint8_t RTErequiredHigh = 3; 45 const uint8_t RTErequiredHigh = 3;
45 const uint8_t RTErequiredLow = 2; 46 const uint8_t RTErequiredLow = 2;
59 60
60 const SFirmwareData firmware_FirmwareData __attribute__( (section(".firmware_firmware_data")) ) = 61 const SFirmwareData firmware_FirmwareData __attribute__( (section(".firmware_firmware_data")) ) =
61 { 62 {
62 .versionFirst = 1, 63 .versionFirst = 1,
63 .versionSecond = 6, 64 .versionSecond = 6,
64 .versionThird = 4, 65 .versionThird = 5,
65 .versionBeta = 0, 66 .versionBeta = 0,
66 67
67 /* 4 bytes with trailing 0 */ 68 /* 4 bytes with trailing 0 */
68 .signature = "mh", 69 .signature = "mh",
69 70
70 .release_year = 23, 71 .release_year = 23,
71 .release_month = 9, 72 .release_month = 8,
72 .release_day = 14, 73 .release_day = 26,
73 .release_sub = 0, 74 .release_sub = 0,
74 75
75 /* max 48 with trailing 0 */ 76 /* max 48 with trailing 0 */
76 //release_info ="12345678901234567890123456789012345678901" 77 //release_info ="12345678901234567890123456789012345678901"
77 .release_info ="gcc_2nd", 78 .release_info ="gcc_2nd",
86 87
87 /* always adjust check_and_correct_settings() accordingly 88 /* always adjust check_and_correct_settings() accordingly
88 * There might even be entries with fixed values that have no range 89 * There might even be entries with fixed values that have no range
89 */ 90 */
90 const SSettings SettingsStandard = { 91 const SSettings SettingsStandard = {
91 .header = 0xFFFF0027, 92 .header = 0xFFFF0028,
92 .warning_blink_dsec = 8 * 2, 93 .warning_blink_dsec = 8 * 2,
93 .lastDiveLogId = 0, 94 .lastDiveLogId = 0,
94 .logFlashNextSampleStartAddress = SAMPLESTART, 95 .logFlashNextSampleStartAddress = SAMPLESTART,
95 96
96 .gas[0].oxygen_percentage = 21, 97 .gas[0].oxygen_percentage = 21,
352 /// or/and change what has changed in the meantime 353 /// or/and change what has changed in the meantime
353 /// 354 ///
354 /// Additionally update the serial number if written via bluetooth 355 /// Additionally update the serial number if written via bluetooth
355 /// 356 ///
356 // =============================================================================== 357 // ===============================================================================
358 SSettings* pSettings;
357 void set_new_settings_missing_in_ext_flash(void) 359 void set_new_settings_missing_in_ext_flash(void)
358 { 360 {
361 uint32_t tmp = 0;
362
359 // never delete this part setting the serial 363 // never delete this part setting the serial
360 if(hardwareDataGetPointer()->secondarySerial != 0xFFFF) 364 if(hardwareDataGetPointer()->secondarySerial != 0xFFFF)
361 { 365 {
362 settingsGetPointer()->serialHigh = (hardwareDataGetPointer()->secondarySerial / 256); 366 settingsGetPointer()->serialHigh = (hardwareDataGetPointer()->secondarySerial / 256);
363 settingsGetPointer()->serialLow = (hardwareDataGetPointer()->secondarySerial & 0xFF); 367 settingsGetPointer()->serialLow = (hardwareDataGetPointer()->secondarySerial & 0xFF);
377 settingsGetPointer()->firmwareVersion[0] = firmware_FirmwareData.versionFirst; 381 settingsGetPointer()->firmwareVersion[0] = firmware_FirmwareData.versionFirst;
378 settingsGetPointer()->firmwareVersion[1] = firmware_FirmwareData.versionSecond; 382 settingsGetPointer()->firmwareVersion[1] = firmware_FirmwareData.versionSecond;
379 settingsGetPointer()->firmwareVersion[2] = firmware_FirmwareData.versionThird; 383 settingsGetPointer()->firmwareVersion[2] = firmware_FirmwareData.versionThird;
380 settingsGetPointer()->firmwareVersion[3] = firmware_FirmwareData.versionBeta; 384 settingsGetPointer()->firmwareVersion[3] = firmware_FirmwareData.versionBeta;
381 385
382 SSettings* pSettings = settingsGetPointer(); 386 pSettings = settingsGetPointer();
383 const SSettings* pStandard = settingsGetPointerStandard(); 387 const SSettings* pStandard = settingsGetPointerStandard();
384 388
385 /* Pointing to the old header data => set new data depending on what had been added since last version */ 389 /* Pointing to the old header data => set new data depending on what had been added since last version */
386 switch(pSettings->header) 390 switch(pSettings->header)
387 { 391 {
476 pSettings->MotionDetection = MOTION_DETECT_OFF; 480 pSettings->MotionDetection = MOTION_DETECT_OFF;
477 // no break 481 // no break
478 case 0xFFFF001A: 482 case 0xFFFF001A:
479 /* deactivate new views => to be activated by customer */ 483 /* deactivate new views => to be activated by customer */
480 pSettings->cv_config_BigScreen = 0xFFFFFFFF; 484 pSettings->cv_config_BigScreen = 0xFFFFFFFF;
481 pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << CVIEW_T3_Navigation; 485 pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << (CVIEW_T3_Navigation + LEGACY_T3_START_ID_PRE_TIMER);
482 pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << CVIEW_T3_DepthData; 486 pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << (CVIEW_T3_DepthData + LEGACY_T3_START_ID_PRE_TIMER);
483 // no break 487 // no break
484 case 0xFFFF001B: 488 case 0xFFFF001B:
485 pSettings->compassInertia = 0; /* no inertia */ 489 pSettings->compassInertia = 0; /* no inertia */
486 pSettings->tX_customViewPrimaryBF = CVIEW_T3_Decostop; 490 pSettings->tX_customViewPrimaryBF = CVIEW_T3_Decostop;
487 pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << CVIEW_T3_DecoTTS; 491 pSettings->cv_config_BigScreen &= pSettings->cv_configuration ^= 1 << (CVIEW_T3_DecoTTS + LEGACY_T3_START_ID_PRE_TIMER);
488 // no break 492 // no break
489 case 0xFFFF001C: 493 case 0xFFFF001C:
490 pSettings->viewPortMode = 0; 494 pSettings->viewPortMode = 0;
491 pSettings->viewRoll = 0; 495 pSettings->viewRoll = 0;
492 pSettings->viewPitch = 0; 496 pSettings->viewPitch = 0;
558 pSettings->ext_sensor_map[5] = SENSOR_NONE; 562 pSettings->ext_sensor_map[5] = SENSOR_NONE;
559 pSettings->ext_sensor_map[6] = SENSOR_NONE; 563 pSettings->ext_sensor_map[6] = SENSOR_NONE;
560 pSettings->ext_sensor_map[7] = SENSOR_NONE; 564 pSettings->ext_sensor_map[7] = SENSOR_NONE;
561 565
562 // no break; 566 // no break;
567 case 0xFFFF0027:
568 tmp = pSettings->cv_config_BigScreen & 0x00000007; /* position of first three view is keeps the same */
569 /* Identify from which data version was in use before the update */
570 if(pSettings->tX_customViewPrimaryBF == LEGACY_CV_END_POST_TIMER) /* data version after introduction of timer (ID shift problem) */
571 {
572 pSettings->tX_customViewPrimaryBF = CVIEW_T3_Decostop;
573 }
574 else
575 {
576 if(pSettings->tX_customViewPrimaryBF >= 3)
577 {
578 pSettings->tX_customViewPrimaryBF -= LEGACY_T3_START_ID_PRE_TIMER - 3;
579 }
580 }
581 pSettings->cv_config_BigScreen = pSettings->cv_config_BigScreen >> (LEGACY_T3_START_ID_PRE_TIMER - 3);
582 pSettings->cv_config_BigScreen &= ~0x00000007; /* just to be sure: clear lower three bits */
583 pSettings->cv_config_BigScreen |= tmp;
584
585 // no break;
563 default: 586 default:
564 pSettings->header = pStandard->header; 587 pSettings->header = pStandard->header;
565 break; // no break before!! 588 break; // no break before!!
566 } 589 }
567 } 590 }
656 } 679 }
657 680
658 return fixed; 681 return fixed;
659 } 682 }
660 683
684 static void setFirstCorrection(uint8_t Id)
685 {
686 if(SettingsStatus.FirstCorrection == 0xFF)
687 {
688 SettingsStatus.FirstCorrection = Id;
689 }
690 }
691
692 void get_CorrectionStatus(SSettingsStatus* Status)
693 {
694 if(Status != NULL)
695 {
696 memcpy(Status, &SettingsStatus,2);
697 }
698 }
661 699
662 uint8_t check_and_correct_settings(void) 700 uint8_t check_and_correct_settings(void)
663 { 701 {
664 uint32_t corrections = 0; 702 uint32_t corrections = 0;
665 uint8_t firstGasFoundOC = 0; 703 uint8_t firstGasFoundOC = 0;
666 uint8_t firstGasFoundCCR = 0; 704 uint8_t firstGasFoundCCR = 0;
705 uint8_t parameterId = 0;
667 706
668 707
669 settingsWarning = 0; /* reset warning indicator */ 708 settingsWarning = 0; /* reset warning indicator */
709 SettingsStatus.FirstCorrection = 0xFF;
670 710
671 /* uint32_t header; 711 /* uint32_t header;
672 */ 712 */
673 713
674 /* uint8_t warning_blink_dsec; 1/10 seconds 714 /* uint8_t warning_blink_dsec; 1/10 seconds
675 */ 715 */
676 if((Settings.warning_blink_dsec < 1) || (Settings.warning_blink_dsec > 100)) 716 if((Settings.warning_blink_dsec < 1) || (Settings.warning_blink_dsec > 100))
677 { 717 {
678 Settings.warning_blink_dsec = SettingsStandard.warning_blink_dsec; 718 Settings.warning_blink_dsec = SettingsStandard.warning_blink_dsec;
679 corrections++; 719 corrections++;
680 } 720 setFirstCorrection(parameterId);
681 721 }
722 parameterId++;
682 /* uint8_t lastDiveLogId; 723 /* uint8_t lastDiveLogId;
683 */ 724 */
684 725
685 /* uint32_t logFlashNextSampleStartAddress; 726 /* uint32_t logFlashNextSampleStartAddress;
686 */ 727 */
687 if((Settings.logFlashNextSampleStartAddress < SAMPLESTART) || (Settings.logFlashNextSampleStartAddress > SAMPLESTOP)) 728 if((Settings.logFlashNextSampleStartAddress < SAMPLESTART) || (Settings.logFlashNextSampleStartAddress > SAMPLESTOP))
688 { 729 {
689 Settings.logFlashNextSampleStartAddress = SAMPLESTART; 730 Settings.logFlashNextSampleStartAddress = SAMPLESTART;
690 corrections++; 731 corrections++;
691 } 732 setFirstCorrection(parameterId);
692 733 }
734 parameterId++;
693 735
694 /* uint8_t dive_mode; has to before the gases 736 /* uint8_t dive_mode; has to before the gases
695 */ 737 */
696 if( (Settings.dive_mode != DIVEMODE_OC) && 738 if( (Settings.dive_mode != DIVEMODE_OC) &&
697 (Settings.dive_mode != DIVEMODE_CCR) && 739 (Settings.dive_mode != DIVEMODE_CCR) &&
699 (Settings.dive_mode != DIVEMODE_Apnea) && 741 (Settings.dive_mode != DIVEMODE_Apnea) &&
700 (Settings.dive_mode != DIVEMODE_PSCR)) 742 (Settings.dive_mode != DIVEMODE_PSCR))
701 { 743 {
702 Settings.dive_mode = DIVEMODE_OC; 744 Settings.dive_mode = DIVEMODE_OC;
703 corrections++; 745 corrections++;
704 } 746 setFirstCorrection(parameterId);
705 747 }
748 parameterId++;
706 749
707 /* SGasLine gas[1 + (2*NUM_GASES)]; 750 /* SGasLine gas[1 + (2*NUM_GASES)];
708 */ 751 */
709 for(int i=1; i<=2*NUM_GASES;i++) 752 for(int i=1; i<=2*NUM_GASES;i++)
710 { 753 {
711 if(Settings.gas[i].oxygen_percentage < 4) 754 if(Settings.gas[i].oxygen_percentage < 4)
712 { 755 {
713 Settings.gas[i].oxygen_percentage = 4; 756 Settings.gas[i].oxygen_percentage = 4;
714 corrections++; 757 corrections++;
758 setFirstCorrection(parameterId);
715 } 759 }
716 if(Settings.gas[i].oxygen_percentage > 100) 760 if(Settings.gas[i].oxygen_percentage > 100)
717 { 761 {
718 Settings.gas[i].oxygen_percentage = 100; 762 Settings.gas[i].oxygen_percentage = 100;
719 corrections++; 763 corrections++;
764 setFirstCorrection(parameterId);
720 } 765 }
721 if((Settings.gas[i].oxygen_percentage + Settings.gas[i].helium_percentage) > 100) 766 if((Settings.gas[i].oxygen_percentage + Settings.gas[i].helium_percentage) > 100)
722 { 767 {
723 Settings.gas[i].helium_percentage = 100 - Settings.gas[i].oxygen_percentage; 768 Settings.gas[i].helium_percentage = 100 - Settings.gas[i].oxygen_percentage;
724 corrections++; 769 corrections++;
770 setFirstCorrection(parameterId);
725 } 771 }
726 if(Settings.gas[i].note.ub.deco) 772 if(Settings.gas[i].note.ub.deco)
727 { 773 {
728 if(Settings.gas[i].note.ub.active != 1) 774 if(Settings.gas[i].note.ub.active != 1)
729 { 775 {
730 Settings.gas[i].note.ub.active = 1; 776 Settings.gas[i].note.ub.active = 1;
731 corrections++; 777 corrections++;
778 setFirstCorrection(parameterId);
732 } 779 }
733 if(Settings.gas[i].note.ub.travel == 1) 780 if(Settings.gas[i].note.ub.travel == 1)
734 { 781 {
735 Settings.gas[i].note.ub.travel = 0; 782 Settings.gas[i].note.ub.travel = 0;
736 corrections++; 783 corrections++;
784 setFirstCorrection(parameterId);
737 } 785 }
738 } 786 }
739 if(Settings.gas[i].note.ub.travel) 787 if(Settings.gas[i].note.ub.travel)
740 { 788 {
741 if(Settings.gas[i].note.ub.active != 1) 789 if(Settings.gas[i].note.ub.active != 1)
742 { 790 {
743 Settings.gas[i].note.ub.active = 1; 791 Settings.gas[i].note.ub.active = 1;
744 corrections++; 792 corrections++;
793 setFirstCorrection(parameterId);
745 } 794 }
746 if(Settings.gas[i].note.ub.deco == 1) 795 if(Settings.gas[i].note.ub.deco == 1)
747 { 796 {
748 Settings.gas[i].note.ub.deco = 0; 797 Settings.gas[i].note.ub.deco = 0;
749 corrections++; 798 corrections++;
799 setFirstCorrection(parameterId);
750 } 800 }
751 } 801 }
752 if(Settings.gas[i].note.ub.first) 802 if(Settings.gas[i].note.ub.first)
753 { 803 {
754 if(Settings.gas[i].note.ub.active != 1) 804 if(Settings.gas[i].note.ub.active != 1)
755 { 805 {
756 Settings.gas[i].note.ub.active = 1; 806 Settings.gas[i].note.ub.active = 1;
757 corrections++; 807 corrections++;
808 setFirstCorrection(parameterId);
758 } 809 }
759 if(Settings.gas[i].note.ub.travel == 1) 810 if(Settings.gas[i].note.ub.travel == 1)
760 { 811 {
761 Settings.gas[i].note.ub.travel = 0; 812 Settings.gas[i].note.ub.travel = 0;
762 corrections++; 813 corrections++;
814 setFirstCorrection(parameterId);
763 } 815 }
764 if(Settings.gas[i].note.ub.deco == 1) 816 if(Settings.gas[i].note.ub.deco == 1)
765 { 817 {
766 Settings.gas[i].note.ub.deco = 0; 818 Settings.gas[i].note.ub.deco = 0;
767 corrections++; 819 corrections++;
820 setFirstCorrection(parameterId);
768 } 821 }
769 if((i<=NUM_GASES) && (!firstGasFoundOC)) 822 if((i<=NUM_GASES) && (!firstGasFoundOC))
770 firstGasFoundOC = 1; 823 firstGasFoundOC = 1;
771 else 824 else
772 if((i>NUM_GASES) && (!firstGasFoundCCR)) 825 if((i>NUM_GASES) && (!firstGasFoundCCR))
776 } 829 }
777 if(Settings.gas[i].bottle_size_liter > 40) 830 if(Settings.gas[i].bottle_size_liter > 40)
778 { 831 {
779 Settings.gas[i].bottle_size_liter = 40; 832 Settings.gas[i].bottle_size_liter = 40;
780 corrections++; 833 corrections++;
834 setFirstCorrection(parameterId);
781 } 835 }
782 if(Settings.gas[i].depth_meter > 250) 836 if(Settings.gas[i].depth_meter > 250)
783 { 837 {
784 Settings.gas[i].depth_meter = 250; 838 Settings.gas[i].depth_meter = 250;
785 corrections++; 839 corrections++;
840 setFirstCorrection(parameterId);
786 } 841 }
787 if(Settings.gas[i].depth_meter_travel > 250) 842 if(Settings.gas[i].depth_meter_travel > 250)
788 { 843 {
789 Settings.gas[i].depth_meter_travel = 250; 844 Settings.gas[i].depth_meter_travel = 250;
790 corrections++; 845 corrections++;
846 setFirstCorrection(parameterId);
791 } 847 }
792 /*if(Settings.gas[i].note.ub.senderCode) 848 /*if(Settings.gas[i].note.ub.senderCode)
793 { 849 {
794 } 850 }
795 if(Settings.gas[i].bottle_wireless_id) 851 if(Settings.gas[i].bottle_wireless_id)
796 { 852 {
797 } 853 }
798 */ 854 */
799 } // for(int i=1; i<=2*NUM_GASES;i++) 855 } // for(int i=1; i<=2*NUM_GASES;i++)
800 856 parameterId++;
801 if(!firstGasFoundOC) 857 if(!firstGasFoundOC)
802 { 858 {
803 Settings.gas[1].note.ub.active = 1; 859 Settings.gas[1].note.ub.active = 1;
804 Settings.gas[1].note.ub.first = 1; 860 Settings.gas[1].note.ub.first = 1;
805 Settings.gas[1].note.ub.travel = 0; 861 Settings.gas[1].note.ub.travel = 0;
806 Settings.gas[1].note.ub.deco = 0; 862 Settings.gas[1].note.ub.deco = 0;
807 corrections++; 863 corrections++;
808 } 864 setFirstCorrection(parameterId);
865 }
866 parameterId++;
809 if(!firstGasFoundCCR) 867 if(!firstGasFoundCCR)
810 { 868 {
811 Settings.gas[1 + NUM_GASES].note.ub.active = 1; 869 Settings.gas[1 + NUM_GASES].note.ub.active = 1;
812 Settings.gas[1 + NUM_GASES].note.ub.first = 1; 870 Settings.gas[1 + NUM_GASES].note.ub.first = 1;
813 Settings.gas[1 + NUM_GASES].note.ub.travel = 0; 871 Settings.gas[1 + NUM_GASES].note.ub.travel = 0;
814 Settings.gas[1 + NUM_GASES].note.ub.deco = 0; 872 Settings.gas[1 + NUM_GASES].note.ub.deco = 0;
815 corrections++; 873 corrections++;
816 } 874 setFirstCorrection(parameterId);
875 }
876 parameterId++;
817 /* SSetpointLine setpoint[1 + NUM_GASES]; 877 /* SSetpointLine setpoint[1 + NUM_GASES];
818 */ 878 */
819 for(int i=1; i<=NUM_GASES;i++) 879 for(int i=1; i<=NUM_GASES;i++)
820 { 880 {
821 if(Settings.setpoint[i].setpoint_cbar < MIN_PPO2_SP_CBAR) 881 if(Settings.setpoint[i].setpoint_cbar < MIN_PPO2_SP_CBAR)
822 { 882 {
823 Settings.setpoint[i].setpoint_cbar = MIN_PPO2_SP_CBAR; 883 Settings.setpoint[i].setpoint_cbar = MIN_PPO2_SP_CBAR;
824 corrections++; 884 corrections++;
885 setFirstCorrection(parameterId);
825 } 886 }
826 if(Settings.setpoint[i].setpoint_cbar > 160) 887 if(Settings.setpoint[i].setpoint_cbar > 160)
827 { 888 {
828 Settings.setpoint[i].setpoint_cbar = 160; 889 Settings.setpoint[i].setpoint_cbar = 160;
829 corrections++; 890 corrections++;
891 setFirstCorrection(parameterId);
830 } 892 }
831 if(Settings.setpoint[i].depth_meter > 250) 893 if(Settings.setpoint[i].depth_meter > 250)
832 { 894 {
833 Settings.setpoint[i].depth_meter = 250; 895 Settings.setpoint[i].depth_meter = 250;
834 corrections++; 896 corrections++;
897 setFirstCorrection(parameterId);
835 } 898 }
836 } // for(int i=1; i<=NUM_GASES;i++) 899 } // for(int i=1; i<=NUM_GASES;i++)
837 900 parameterId++;
838 if (checkAndFixSetpointSettings()) { 901 if (checkAndFixSetpointSettings()) {
839 corrections++; 902 corrections++;
840 } 903 setFirstCorrection(parameterId);
841 904 }
905 parameterId++;
842 /* uint8_t CCR_Mode; 906 /* uint8_t CCR_Mode;
843 */ 907 */
844 if( (Settings.CCR_Mode != CCRMODE_Sensors) && 908 if( (Settings.CCR_Mode != CCRMODE_Sensors) &&
845 (Settings.CCR_Mode != CCRMODE_Simulation) && 909 (Settings.CCR_Mode != CCRMODE_Simulation) &&
846 (Settings.CCR_Mode != CCRMODE_FixedSetpoint)) 910 (Settings.CCR_Mode != CCRMODE_FixedSetpoint))
847 { 911 {
848 Settings.CCR_Mode = CCRMODE_FixedSetpoint; 912 Settings.CCR_Mode = CCRMODE_FixedSetpoint;
849 corrections++; 913 corrections++;
850 } 914 setFirstCorrection(parameterId);
851 915 }
916 parameterId++;
852 /* split2x4_Type deco_type; 917 /* split2x4_Type deco_type;
853 */ 918 */
854 if( (Settings.deco_type.ub.standard != GF_MODE) && 919 if( (Settings.deco_type.ub.standard != GF_MODE) &&
855 (Settings.deco_type.ub.standard != VPM_MODE)) 920 (Settings.deco_type.ub.standard != VPM_MODE))
856 { 921 {
857 Settings.deco_type.ub.standard = VPM_MODE; 922 Settings.deco_type.ub.standard = VPM_MODE;
858 corrections++; 923 corrections++;
859 } 924 setFirstCorrection(parameterId);
925 }
926 parameterId++;
860 if(Settings.deco_type.ub.alternative != GF_MODE) 927 if(Settings.deco_type.ub.alternative != GF_MODE)
861 { 928 {
862 Settings.deco_type.ub.alternative = GF_MODE; 929 Settings.deco_type.ub.alternative = GF_MODE;
863 corrections++; 930 corrections++;
864 } 931 setFirstCorrection(parameterId);
865 932 }
933 parameterId++;
866 /* uint8_t ppO2_max_deco; 934 /* uint8_t ppO2_max_deco;
867 */ 935 */
868 if(Settings.ppO2_max_deco > 190) 936 if(Settings.ppO2_max_deco > 190)
869 { 937 {
870 Settings.ppO2_max_deco = 190; 938 Settings.ppO2_max_deco = 190;
871 corrections++; 939 corrections++;
872 } 940 setFirstCorrection(parameterId);
941 }
942 parameterId++;
873 if(Settings.ppO2_max_deco < 100) 943 if(Settings.ppO2_max_deco < 100)
874 { 944 {
875 Settings.ppO2_max_deco = 100; 945 Settings.ppO2_max_deco = 100;
876 corrections++; 946 corrections++;
877 } 947 setFirstCorrection(parameterId);
948 }
949 parameterId++;
878 950
879 /* uint8_t ppO2_max_std; 951 /* uint8_t ppO2_max_std;
880 */ 952 */
881 if(Settings.ppO2_max_std > 190) 953 if(Settings.ppO2_max_std > 190)
882 { 954 {
883 Settings.ppO2_max_std = 190; 955 Settings.ppO2_max_std = 190;
884 corrections++; 956 corrections++;
885 } 957 setFirstCorrection(parameterId);
958 }
959 parameterId++;
886 if(Settings.ppO2_max_std < 100) 960 if(Settings.ppO2_max_std < 100)
887 { 961 {
888 Settings.ppO2_max_std = 100; 962 Settings.ppO2_max_std = 100;
889 corrections++; 963 corrections++;
890 } 964 setFirstCorrection(parameterId);
891 965 }
966 parameterId++;
892 /* uint8_t ppO2_min; 967 /* uint8_t ppO2_min;
893 */ 968 */
894 if(Settings.ppO2_min != 15) 969 if(Settings.ppO2_min != 15)
895 { 970 {
896 Settings.ppO2_min = 15; 971 Settings.ppO2_min = 15;
897 corrections++; 972 corrections++;
898 } 973 setFirstCorrection(parameterId);
899 974 }
975 parameterId++;
900 /* uint8_t CNS_max; 976 /* uint8_t CNS_max;
901 */ 977 */
902 if(Settings.CNS_max != 90) 978 if(Settings.CNS_max != 90)
903 { 979 {
904 Settings.CNS_max = 90; 980 Settings.CNS_max = 90;
905 corrections++; 981 corrections++;
906 } 982 setFirstCorrection(parameterId);
907 983 }
984 parameterId++;
908 /* uint8_t ascent_MeterPerMinute_max; 985 /* uint8_t ascent_MeterPerMinute_max;
909 */ 986 */
910 if(Settings.ascent_MeterPerMinute_max != 30) 987 if(Settings.ascent_MeterPerMinute_max != 30)
911 { 988 {
912 Settings.ascent_MeterPerMinute_max = 30; 989 Settings.ascent_MeterPerMinute_max = 30;
913 corrections++; 990 corrections++;
914 } 991 setFirstCorrection(parameterId);
915 992 }
993 parameterId++;
916 /* uint8_t ascent_MeterPerMinute_showGraph; 994 /* uint8_t ascent_MeterPerMinute_showGraph;
917 */ 995 */
918 if(Settings.ascent_MeterPerMinute_showGraph != 30) 996 if(Settings.ascent_MeterPerMinute_showGraph != 30)
919 { 997 {
920 Settings.ascent_MeterPerMinute_showGraph = 30; 998 Settings.ascent_MeterPerMinute_showGraph = 30;
921 corrections++; 999 corrections++;
922 } 1000 setFirstCorrection(parameterId);
923 1001 }
1002 parameterId++;
924 /* uint8_t future_TTS; 1003 /* uint8_t future_TTS;
925 */ 1004 */
926 if(Settings.future_TTS > 15) 1005 if(Settings.future_TTS > 15)
927 { 1006 {
928 Settings.future_TTS = 15; 1007 Settings.future_TTS = 15;
929 corrections++; 1008 corrections++;
930 } 1009 setFirstCorrection(parameterId);
931 1010 }
1011 parameterId++;
932 /* uint8_t GF_high; 1012 /* uint8_t GF_high;
933 */ 1013 */
934 if(Settings.GF_high > 99) 1014 if(Settings.GF_high > 99)
935 { 1015 {
936 Settings.GF_high = 99; 1016 Settings.GF_high = 99;
937 corrections++; 1017 corrections++;
938 } 1018 setFirstCorrection(parameterId);
1019 }
1020 parameterId++;
939 if(Settings.GF_high < 45) 1021 if(Settings.GF_high < 45)
940 { 1022 {
941 Settings.GF_high = 45; 1023 Settings.GF_high = 45;
942 corrections++; 1024 corrections++;
943 } 1025 setFirstCorrection(parameterId);
944 1026 }
1027 parameterId++;
945 /* uint8_t GF_low; 1028 /* uint8_t GF_low;
946 */ 1029 */
947 if(Settings.GF_low > 99) 1030 if(Settings.GF_low > 99)
948 { 1031 {
949 Settings.GF_low = 99; 1032 Settings.GF_low = 99;
950 corrections++; 1033 corrections++;
951 } 1034 setFirstCorrection(parameterId);
1035 }
1036 parameterId++;
952 if(Settings.GF_low < 10) 1037 if(Settings.GF_low < 10)
953 { 1038 {
954 Settings.GF_low = 10; 1039 Settings.GF_low = 10;
955 corrections++; 1040 corrections++;
956 } 1041 setFirstCorrection(parameterId);
1042 }
1043 parameterId++;
957 if(Settings.GF_low > Settings.GF_high) 1044 if(Settings.GF_low > Settings.GF_high)
958 { 1045 {
959 Settings.GF_low = Settings.GF_high; 1046 Settings.GF_low = Settings.GF_high;
960 corrections++; 1047 corrections++;
961 } 1048 setFirstCorrection(parameterId);
962 1049 }
1050 parameterId++;
963 /* uint8_t aGF_high; 1051 /* uint8_t aGF_high;
964 */ 1052 */
965 if(Settings.aGF_high > 99) 1053 if(Settings.aGF_high > 99)
966 { 1054 {
967 Settings.aGF_high = 99; 1055 Settings.aGF_high = 99;
968 corrections++; 1056 corrections++;
969 } 1057 setFirstCorrection(parameterId);
1058 }
1059 parameterId++;
970 if(Settings.aGF_high < 45) 1060 if(Settings.aGF_high < 45)
971 { 1061 {
972 Settings.aGF_high = 45; 1062 Settings.aGF_high = 45;
973 corrections++; 1063 corrections++;
974 } 1064 setFirstCorrection(parameterId);
975 1065 }
1066 parameterId++;
976 /* uint8_t aGF_low; 1067 /* uint8_t aGF_low;
977 */ 1068 */
978 if(Settings.aGF_low > 99) 1069 if(Settings.aGF_low > 99)
979 { 1070 {
980 Settings.aGF_low = 99; 1071 Settings.aGF_low = 99;
981 corrections++; 1072 corrections++;
982 } 1073 setFirstCorrection(parameterId);
1074 }
1075 parameterId++;
983 if(Settings.aGF_low < 10) 1076 if(Settings.aGF_low < 10)
984 { 1077 {
985 Settings.aGF_low = 10; 1078 Settings.aGF_low = 10;
986 corrections++; 1079 corrections++;
987 } 1080 setFirstCorrection(parameterId);
1081 }
1082 parameterId++;
988 if(Settings.aGF_low > Settings.aGF_high) 1083 if(Settings.aGF_low > Settings.aGF_high)
989 { 1084 {
990 Settings.aGF_low = Settings.aGF_high; 1085 Settings.aGF_low = Settings.aGF_high;
991 corrections++; 1086 corrections++;
992 } 1087 setFirstCorrection(parameterId);
993 1088 }
1089 parameterId++;
994 /* split2x4_Type VPM_conservatism; 1090 /* split2x4_Type VPM_conservatism;
995 */ 1091 */
996 if(Settings.VPM_conservatism.ub.standard > 5) 1092 if(Settings.VPM_conservatism.ub.standard > 5)
997 { 1093 {
998 Settings.VPM_conservatism.ub.standard = 5; 1094 Settings.VPM_conservatism.ub.standard = 5;
999 corrections++; 1095 corrections++;
1000 } 1096 setFirstCorrection(parameterId);
1097 }
1098 parameterId++;
1001 if(Settings.VPM_conservatism.ub.alternative > 5) 1099 if(Settings.VPM_conservatism.ub.alternative > 5)
1002 { 1100 {
1003 Settings.VPM_conservatism.ub.alternative = 5; 1101 Settings.VPM_conservatism.ub.alternative = 5;
1004 corrections++; 1102 corrections++;
1005 } 1103 setFirstCorrection(parameterId);
1006 1104 }
1105 parameterId++;
1007 /* uint8_t safetystopDuration; 1106 /* uint8_t safetystopDuration;
1008 */ 1107 */
1009 if(Settings.safetystopDuration > 5) 1108 if(Settings.safetystopDuration > 5)
1010 { 1109 {
1011 Settings.safetystopDuration = 5; 1110 Settings.safetystopDuration = 5;
1012 corrections++; 1111 corrections++;
1013 } 1112 setFirstCorrection(parameterId);
1014 1113 }
1114 parameterId++;
1015 /* uint8_t AtemMinutenVolumenLiter; 1115 /* uint8_t AtemMinutenVolumenLiter;
1016 */ 1116 */
1017 if(Settings.AtemMinutenVolumenLiter != 25) 1117 if(Settings.AtemMinutenVolumenLiter != 25)
1018 { 1118 {
1019 Settings.AtemMinutenVolumenLiter = 25; 1119 Settings.AtemMinutenVolumenLiter = 25;
1020 corrections++; 1120 corrections++;
1021 } 1121 setFirstCorrection(parameterId);
1022 1122 }
1123 parameterId++;
1023 /* uint8_t ReserveFractionDenominator; 1124 /* uint8_t ReserveFractionDenominator;
1024 */ 1125 */
1025 if(Settings.ReserveFractionDenominator != 4) 1126 if(Settings.ReserveFractionDenominator != 4)
1026 { 1127 {
1027 Settings.ReserveFractionDenominator = 4; 1128 Settings.ReserveFractionDenominator = 4;
1028 corrections++; 1129 corrections++;
1029 } 1130 setFirstCorrection(parameterId);
1030 1131 }
1132 parameterId++;
1031 /* uint8_t salinity; 1133 /* uint8_t salinity;
1032 */ 1134 */
1033 if(Settings.salinity > 4) 1135 if(Settings.salinity > 4)
1034 { 1136 {
1035 Settings.salinity = 4; 1137 Settings.salinity = 4;
1036 corrections++; 1138 corrections++;
1037 } 1139 setFirstCorrection(parameterId);
1038 1140 }
1141 parameterId++;
1039 /* uint8_t last_stop_depth_meter; 1142 /* uint8_t last_stop_depth_meter;
1040 */ 1143 */
1041 if(Settings.last_stop_depth_meter > 9) 1144 if(Settings.last_stop_depth_meter > 9)
1042 { 1145 {
1043 Settings.last_stop_depth_meter = 9; 1146 Settings.last_stop_depth_meter = 9;
1044 corrections++; 1147 corrections++;
1045 } 1148 setFirstCorrection(parameterId);
1149 }
1150 parameterId++;
1046 if(Settings.last_stop_depth_meter < 3) 1151 if(Settings.last_stop_depth_meter < 3)
1047 { 1152 {
1048 Settings.last_stop_depth_meter = 3; 1153 Settings.last_stop_depth_meter = 3;
1049 corrections++; 1154 corrections++;
1050 } 1155 setFirstCorrection(parameterId);
1051 1156 }
1157 parameterId++;
1052 /* uint8_t stop_increment_depth_meter; 1158 /* uint8_t stop_increment_depth_meter;
1053 */ 1159 */
1054 if(Settings.stop_increment_depth_meter != 3) 1160 if(Settings.stop_increment_depth_meter != 3)
1055 { 1161 {
1056 Settings.stop_increment_depth_meter = 3; 1162 Settings.stop_increment_depth_meter = 3;
1057 corrections++; 1163 corrections++;
1058 } 1164 setFirstCorrection(parameterId);
1059 1165 }
1166 parameterId++;
1060 /* uint8_t brightness; 1167 /* uint8_t brightness;
1061 */ 1168 */
1062 if(Settings.brightness > 4) 1169 if(Settings.brightness > 4)
1063 { 1170 {
1064 Settings.brightness = 4; 1171 Settings.brightness = 4;
1065 corrections++; 1172 corrections++;
1066 } 1173 setFirstCorrection(parameterId);
1067 1174 }
1175 parameterId++;
1068 /* uint8_t date_format; 1176 /* uint8_t date_format;
1069 */ 1177 */
1070 if( (Settings.date_format != DDMMYY) && 1178 if( (Settings.date_format != DDMMYY) &&
1071 (Settings.date_format != MMDDYY) && 1179 (Settings.date_format != MMDDYY) &&
1072 (Settings.date_format != YYMMDD)) 1180 (Settings.date_format != YYMMDD))
1073 { 1181 {
1074 Settings.date_format = DDMMYY; 1182 Settings.date_format = DDMMYY;
1075 corrections++; 1183 corrections++;
1076 } 1184 setFirstCorrection(parameterId);
1077 1185 }
1186 parameterId++;
1078 /* uint8_t selected_language; 1187 /* uint8_t selected_language;
1079 */ 1188 */
1080 if(Settings.selected_language >= LANGUAGE_END) 1189 if(Settings.selected_language >= LANGUAGE_END)
1081 { 1190 {
1082 Settings.selected_language = LANGUAGE_English; 1191 Settings.selected_language = LANGUAGE_English;
1083 corrections++; 1192 corrections++;
1084 } 1193 setFirstCorrection(parameterId);
1085 1194 }
1195 parameterId++;
1086 /* char customtext[60]; 1196 /* char customtext[60];
1087 */ 1197 */
1088 if(Settings.customtext[59] != 0) 1198 if(Settings.customtext[59] != 0)
1089 { 1199 {
1090 Settings.customtext[59] = 0; 1200 Settings.customtext[59] = 0;
1091 corrections++; 1201 corrections++;
1092 } 1202 setFirstCorrection(parameterId);
1093 1203 }
1204 parameterId++;
1094 /* uint16_t timeoutSurfacemode; 1205 /* uint16_t timeoutSurfacemode;
1095 */ 1206 */
1096 if( (Settings.timeoutSurfacemode != 20) && // Quick Sleep Option 1207 if( (Settings.timeoutSurfacemode != 20) && // Quick Sleep Option
1097 (Settings.timeoutSurfacemode != 120)) 1208 (Settings.timeoutSurfacemode != 120))
1098 { 1209 {
1099 Settings.timeoutSurfacemode = 120; 1210 Settings.timeoutSurfacemode = 120;
1100 corrections++; 1211 corrections++;
1101 } 1212 setFirstCorrection(parameterId);
1102 1213 }
1214 parameterId++;
1103 /* uint8_t timeoutMenuSurface; 1215 /* uint8_t timeoutMenuSurface;
1104 */ 1216 */
1105 if(Settings.timeoutMenuSurface != 120) 1217 if(Settings.timeoutMenuSurface != 120)
1106 { 1218 {
1107 Settings.timeoutMenuSurface = 120; 1219 Settings.timeoutMenuSurface = 120;
1108 corrections++; 1220 corrections++;
1109 } 1221 setFirstCorrection(parameterId);
1110 1222 }
1223 parameterId++;
1111 /* uint8_t timeoutMenuDive; 1224 /* uint8_t timeoutMenuDive;
1112 */ 1225 */
1113 if(Settings.timeoutMenuDive != 120) 1226 if(Settings.timeoutMenuDive != 120)
1114 { 1227 {
1115 Settings.timeoutMenuDive = 120; 1228 Settings.timeoutMenuDive = 120;
1116 corrections++; 1229 corrections++;
1117 } 1230 setFirstCorrection(parameterId);
1118 1231 }
1232 parameterId++;
1119 /* uint8_t timeoutMenuEdit; 1233 /* uint8_t timeoutMenuEdit;
1120 */ 1234 */
1121 if(Settings.timeoutMenuEdit != 120) 1235 if(Settings.timeoutMenuEdit != 120)
1122 { 1236 {
1123 Settings.timeoutMenuEdit = 120; 1237 Settings.timeoutMenuEdit = 120;
1124 corrections++; 1238 corrections++;
1125 } 1239 setFirstCorrection(parameterId);
1126 1240 }
1241 parameterId++;
1127 /* uint8_t timeoutInfo; 1242 /* uint8_t timeoutInfo;
1128 */ 1243 */
1129 if(Settings.timeoutInfo != 120) 1244 if(Settings.timeoutInfo != 120)
1130 { 1245 {
1131 Settings.timeoutInfo = 120; 1246 Settings.timeoutInfo = 120;
1132 corrections++; 1247 corrections++;
1133 } 1248 setFirstCorrection(parameterId);
1134 1249 }
1250 parameterId++;
1135 /* uint8_t timeoutInfoCompass; 1251 /* uint8_t timeoutInfoCompass;
1136 */ 1252 */
1137 if(Settings.timeoutInfoCompass != 60) 1253 if(Settings.timeoutInfoCompass != 60)
1138 { 1254 {
1139 Settings.timeoutInfoCompass = 60; 1255 Settings.timeoutInfoCompass = 60;
1140 corrections++; 1256 corrections++;
1141 } 1257 setFirstCorrection(parameterId);
1142 1258 }
1259 parameterId++;
1143 /* uint8_t design; 1260 /* uint8_t design;
1144 */ 1261 */
1145 if(Settings.design != 7) 1262 if(Settings.design != 7)
1146 { 1263 {
1147 Settings.design = 7; 1264 Settings.design = 7;
1148 corrections++; 1265 corrections++;
1149 } 1266 setFirstCorrection(parameterId);
1150 1267 }
1268 parameterId++;
1151 /* uint16_t timeoutDiveReachedZeroDepth; 1269 /* uint16_t timeoutDiveReachedZeroDepth;
1152 */ 1270 */
1153 if(Settings.timeoutDiveReachedZeroDepth != 300) 1271 if(Settings.timeoutDiveReachedZeroDepth != 300)
1154 { 1272 {
1155 Settings.timeoutDiveReachedZeroDepth = 300; 1273 Settings.timeoutDiveReachedZeroDepth = 300;
1156 corrections++; 1274 corrections++;
1157 } 1275 setFirstCorrection(parameterId);
1158 1276 }
1277 parameterId++;
1159 /* uint16_t divetimeToCreateLogbook; 1278 /* uint16_t divetimeToCreateLogbook;
1160 */ 1279 */
1161 if(Settings.divetimeToCreateLogbook != 60) 1280 if(Settings.divetimeToCreateLogbook != 60)
1162 { 1281 {
1163 Settings.divetimeToCreateLogbook = 60; 1282 Settings.divetimeToCreateLogbook = 60;
1164 corrections++; 1283 corrections++;
1165 } 1284 setFirstCorrection(parameterId);
1166 1285 }
1286 parameterId++;
1167 /* uint8_t serialHigh; 1287 /* uint8_t serialHigh;
1168 */ 1288 */
1169 1289
1170 /* uint8_t serialLow; 1290 /* uint8_t serialLow;
1171 */ 1291 */
1203 // Base value, index 3 1323 // Base value, index 3
1204 if(Settings.ButtonResponsiveness[3] < MIN_BUTTONRESPONSIVENESS_GUI) 1324 if(Settings.ButtonResponsiveness[3] < MIN_BUTTONRESPONSIVENESS_GUI)
1205 { 1325 {
1206 Settings.ButtonResponsiveness[3] = MIN_BUTTONRESPONSIVENESS_GUI; 1326 Settings.ButtonResponsiveness[3] = MIN_BUTTONRESPONSIVENESS_GUI;
1207 corrections++; 1327 corrections++;
1328 setFirstCorrection(parameterId);
1208 } 1329 }
1209 else 1330 else
1210 if(Settings.ButtonResponsiveness[3] > MAX_BUTTONRESPONSIVENESS_GUI) 1331 if(Settings.ButtonResponsiveness[3] > MAX_BUTTONRESPONSIVENESS_GUI)
1211 { 1332 {
1212 Settings.ButtonResponsiveness[3] = MAX_BUTTONRESPONSIVENESS_GUI; 1333 Settings.ButtonResponsiveness[3] = MAX_BUTTONRESPONSIVENESS_GUI;
1213 corrections++; 1334 corrections++;
1214 } 1335 setFirstCorrection(parameterId);
1336 }
1337 parameterId++;
1215 // flex values 0, 1, 2 1338 // flex values 0, 1, 2
1216 for(int i=0; i<3;i++) 1339 for(int i=0; i<3;i++)
1217 { 1340 {
1218 if(Settings.ButtonResponsiveness[i] < MIN_BUTTONRESPONSIVENESS) // 50-10 //Fix for broken buttons. :) 1341 if(Settings.ButtonResponsiveness[i] < MIN_BUTTONRESPONSIVENESS) // 50-10 //Fix for broken buttons. :)
1219 { 1342 {
1220 Settings.ButtonResponsiveness[i] = MIN_BUTTONRESPONSIVENESS; 1343 Settings.ButtonResponsiveness[i] = MIN_BUTTONRESPONSIVENESS;
1221 corrections++; 1344 corrections++;
1345 setFirstCorrection(parameterId);
1222 } 1346 }
1223 else 1347 else
1224 if(Settings.ButtonResponsiveness[i] > MAX_BUTTONRESPONSIVENESS) // 110+20 1348 if(Settings.ButtonResponsiveness[i] > MAX_BUTTONRESPONSIVENESS) // 110+20
1225 { 1349 {
1226 Settings.ButtonResponsiveness[i] = MAX_BUTTONRESPONSIVENESS; 1350 Settings.ButtonResponsiveness[i] = MAX_BUTTONRESPONSIVENESS;
1227 corrections++; 1351 corrections++;
1228 } 1352 setFirstCorrection(parameterId);
1229 } 1353 }
1230 1354 }
1355 parameterId++;
1231 /* uint8_t buttonBalance[3]; 1356 /* uint8_t buttonBalance[3];
1232 */ 1357 */
1233 for(int i=0; i<3;i++) 1358 for(int i=0; i<3;i++)
1234 { 1359 {
1235 if(Settings.buttonBalance[i] < 2) // 2 = -10 1360 if(Settings.buttonBalance[i] < 2) // 2 = -10
1236 { 1361 {
1237 Settings.buttonBalance[i] = 2; 1362 Settings.buttonBalance[i] = 2;
1238 corrections++; 1363 corrections++;
1364 setFirstCorrection(parameterId);
1239 } 1365 }
1240 else 1366 else
1241 if(Settings.buttonBalance[i] > 5) // 3 = 0, 4 = +10, 5 = +20 1367 if(Settings.buttonBalance[i] > 5) // 3 = 0, 4 = +10, 5 = +20
1242 { 1368 {
1243 Settings.buttonBalance[i] = 5; 1369 Settings.buttonBalance[i] = 5;
1244 corrections++; 1370 corrections++;
1245 } 1371 setFirstCorrection(parameterId);
1246 } 1372 }
1247 1373 }
1374 parameterId++;
1248 /* uint8_t nonMetricalSystem; 1375 /* uint8_t nonMetricalSystem;
1249 */ 1376 */
1250 if(Settings.nonMetricalSystem > 1) 1377 if(Settings.nonMetricalSystem > 1)
1251 { 1378 {
1252 Settings.nonMetricalSystem = 1; 1379 Settings.nonMetricalSystem = 1;
1253 corrections++; 1380 corrections++;
1254 } 1381 setFirstCorrection(parameterId);
1255 1382 }
1383 parameterId++;
1256 /* uint8_t fallbackToFixedSetpoint; 1384 /* uint8_t fallbackToFixedSetpoint;
1257 */ 1385 */
1258 if(Settings.fallbackToFixedSetpoint > 1) 1386 if(Settings.fallbackToFixedSetpoint > 1)
1259 { 1387 {
1260 Settings.fallbackToFixedSetpoint = 1; 1388 Settings.fallbackToFixedSetpoint = 1;
1261 corrections++; 1389 corrections++;
1262 } 1390 setFirstCorrection(parameterId);
1263 1391 }
1392 parameterId++;
1264 /* uint8_t bluetoothActive; 1393 /* uint8_t bluetoothActive;
1265 */ 1394 */
1266 if(Settings.bluetoothActive > 1) 1395 if(Settings.bluetoothActive > 1)
1267 { 1396 {
1268 Settings.bluetoothActive = 1; 1397 Settings.bluetoothActive = 1;
1269 corrections++; 1398 corrections++;
1270 } 1399 setFirstCorrection(parameterId);
1271 1400 }
1401 parameterId++;
1272 /* uint8_t safetystopDepth; 1402 /* uint8_t safetystopDepth;
1273 */ 1403 */
1274 if(Settings.safetystopDepth > 6) 1404 if(Settings.safetystopDepth > 6)
1275 { 1405 {
1276 Settings.safetystopDepth = 6; 1406 Settings.safetystopDepth = 6;
1277 corrections++; 1407 corrections++;
1278 } 1408 setFirstCorrection(parameterId);
1409 }
1410 parameterId++;
1279 if(Settings.safetystopDepth < 3) 1411 if(Settings.safetystopDepth < 3)
1280 { 1412 {
1281 Settings.safetystopDepth = 3; 1413 Settings.safetystopDepth = 3;
1282 corrections++; 1414 corrections++;
1283 } 1415 setFirstCorrection(parameterId);
1284 1416 }
1417 parameterId++;
1285 /* uint32_t updateSettingsAllowedFromHeader; 1418 /* uint32_t updateSettingsAllowedFromHeader;
1286 */ 1419 */
1287 1420
1288 /* uint8_t ppo2sensors_deactivated; 1421 /* uint8_t ppo2sensors_deactivated;
1289 */ 1422 */
1290 if(Settings.ppo2sensors_deactivated > (1+2+4)) 1423 if(Settings.ppo2sensors_deactivated > (1+2+4))
1291 { 1424 {
1292 Settings.ppo2sensors_deactivated = 0; 1425 Settings.ppo2sensors_deactivated = 0;
1293 corrections++; 1426 corrections++;
1294 } 1427 setFirstCorrection(parameterId);
1295 1428 }
1429 parameterId++;
1296 /* uint8_t tX_colorscheme; 1430 /* uint8_t tX_colorscheme;
1297 */ 1431 */
1298 if(Settings.tX_colorscheme > 3) 1432 if(Settings.tX_colorscheme > 3)
1299 { 1433 {
1300 Settings.tX_colorscheme = 0; 1434 Settings.tX_colorscheme = 0;
1301 corrections++; 1435 corrections++;
1302 } 1436 setFirstCorrection(parameterId);
1303 1437 }
1438 parameterId++;
1304 /* uint8_t tX_userselectedLeftLowerCornerPrimary; 1439 /* uint8_t tX_userselectedLeftLowerCornerPrimary;
1305 */ 1440 */
1306 if(Settings.tX_userselectedLeftLowerCornerPrimary >= LLC_END) 1441 if(Settings.tX_userselectedLeftLowerCornerPrimary >= LLC_END)
1307 { 1442 {
1308 Settings.tX_userselectedLeftLowerCornerPrimary = LLC_Temperature; 1443 Settings.tX_userselectedLeftLowerCornerPrimary = LLC_Temperature;
1309 corrections++; 1444 corrections++;
1310 } 1445 setFirstCorrection(parameterId);
1311 1446 }
1447 parameterId++;
1312 /* uint8_t tX_userselectedLeftLowerCornerTimeout; 1448 /* uint8_t tX_userselectedLeftLowerCornerTimeout;
1313 */ 1449 */
1314 if(Settings.tX_userselectedLeftLowerCornerTimeout > 60) 1450 if(Settings.tX_userselectedLeftLowerCornerTimeout > 60)
1315 { 1451 {
1316 Settings.tX_userselectedLeftLowerCornerTimeout = 0; 1452 Settings.tX_userselectedLeftLowerCornerTimeout = 0;
1317 corrections++; 1453 corrections++;
1318 } 1454 setFirstCorrection(parameterId);
1319 1455 }
1456 parameterId++;
1320 /* uint8_t tX_customViewPrimary; 1457 /* uint8_t tX_customViewPrimary;
1321 */ 1458 */
1322 if(Settings.tX_customViewPrimary >= CVIEW_END) 1459 if(Settings.tX_customViewPrimary >= CVIEW_END)
1323 { 1460 {
1324 Settings.tX_customViewPrimary = 1; 1461 Settings.tX_customViewPrimary = 1;
1325 corrections++; 1462 corrections++;
1326 } 1463 setFirstCorrection(parameterId);
1327 1464 }
1465 parameterId++;
1328 /* uint8_t tX_customViewTimeout; 1466 /* uint8_t tX_customViewTimeout;
1329 */ 1467 */
1330 if(Settings.tX_customViewTimeout > 60) 1468 if(Settings.tX_customViewTimeout > 60)
1331 { 1469 {
1332 Settings.tX_customViewTimeout = 0; 1470 Settings.tX_customViewTimeout = 0;
1333 corrections++; 1471 corrections++;
1334 } 1472 setFirstCorrection(parameterId);
1335 1473 }
1474 parameterId++;
1336 /* uint8_t timeoutEnterButtonSelectDive; 1475 /* uint8_t timeoutEnterButtonSelectDive;
1337 */ 1476 */
1338 if(Settings.timeoutEnterButtonSelectDive != 10) 1477 if(Settings.timeoutEnterButtonSelectDive != 10)
1339 { 1478 {
1340 Settings.timeoutEnterButtonSelectDive = 10; 1479 Settings.timeoutEnterButtonSelectDive = 10;
1341 corrections++; 1480 corrections++;
1342 } 1481 setFirstCorrection(parameterId);
1343 1482 }
1483 parameterId++;
1344 /* uint8_t logbookOffset; 1484 /* uint8_t logbookOffset;
1345 */ 1485 */
1346 if(Settings.logbookOffset > 9000) 1486 if(Settings.logbookOffset > 9000)
1347 { 1487 {
1348 Settings.logbookOffset = 0; 1488 Settings.logbookOffset = 0;
1349 corrections++; 1489 corrections++;
1350 } 1490 setFirstCorrection(parameterId);
1351 1491 }
1492 parameterId++;
1352 /* uint8_t alwaysShowPPO2; 1493 /* uint8_t alwaysShowPPO2;
1353 */ 1494 */
1354 if(Settings.alwaysShowPPO2 > 1) 1495 if(Settings.alwaysShowPPO2 > 1)
1355 { 1496 {
1356 Settings.alwaysShowPPO2 = 0; 1497 Settings.alwaysShowPPO2 = 0;
1357 corrections++; 1498 corrections++;
1358 } 1499 setFirstCorrection(parameterId);
1359 1500 }
1501 parameterId++;
1360 /* uint8_t extraDisplay; 1502 /* uint8_t extraDisplay;
1361 */ 1503 */
1362 if(Settings.extraDisplay >= EXTRADISPLAY_END) 1504 if(Settings.extraDisplay >= EXTRADISPLAY_END)
1363 { 1505 {
1364 Settings.extraDisplay = EXTRADISPLAY_BIGFONT; 1506 Settings.extraDisplay = EXTRADISPLAY_BIGFONT;
1365 corrections++; 1507 corrections++;
1366 } 1508 setFirstCorrection(parameterId);
1367 1509 }
1510 parameterId++;
1368 /* int8_t offsetPressure_mbar; 1511 /* int8_t offsetPressure_mbar;
1369 */ 1512 */
1370 if((Settings.offsetPressure_mbar > PRESSURE_OFFSET_LIMIT_MBAR) || 1513 if((Settings.offsetPressure_mbar > PRESSURE_OFFSET_LIMIT_MBAR) ||
1371 (Settings.offsetPressure_mbar < -1 * PRESSURE_OFFSET_LIMIT_MBAR)) 1514 (Settings.offsetPressure_mbar < -1 * PRESSURE_OFFSET_LIMIT_MBAR))
1372 { 1515 {
1373 Settings.offsetPressure_mbar = 0; 1516 Settings.offsetPressure_mbar = 0;
1374 corrections++; 1517 corrections++;
1375 } 1518 setFirstCorrection(parameterId);
1376 1519 }
1520 parameterId++;
1377 /* int8_t offsetTemperature_centigrad; 1521 /* int8_t offsetTemperature_centigrad;
1378 */ 1522 */
1379 if((Settings.offsetTemperature_centigrad > 20) || 1523 if((Settings.offsetTemperature_centigrad > 20) ||
1380 (Settings.offsetTemperature_centigrad < -20)) 1524 (Settings.offsetTemperature_centigrad < -20))
1381 { 1525 {
1382 Settings.offsetTemperature_centigrad = 0; 1526 Settings.offsetTemperature_centigrad = 0;
1383 corrections++; 1527 corrections++;
1384 } 1528 setFirstCorrection(parameterId);
1385 1529 }
1530 parameterId++;
1386 /* uint8_t gasConsumption_travel_l_min; 1531 /* uint8_t gasConsumption_travel_l_min;
1387 */ 1532 */
1388 if((Settings.gasConsumption_travel_l_min < 5) || 1533 if((Settings.gasConsumption_travel_l_min < 5) ||
1389 (Settings.gasConsumption_travel_l_min > 50)) 1534 (Settings.gasConsumption_travel_l_min > 50))
1390 { 1535 {
1391 Settings.gasConsumption_travel_l_min = 20; 1536 Settings.gasConsumption_travel_l_min = 20;
1392 corrections++; 1537 corrections++;
1393 } 1538 setFirstCorrection(parameterId);
1394 1539 }
1540 parameterId++;
1395 /* uint8_t gasConsumption_bottom_l_min; 1541 /* uint8_t gasConsumption_bottom_l_min;
1396 */ 1542 */
1397 if((Settings.gasConsumption_bottom_l_min < 5) || 1543 if((Settings.gasConsumption_bottom_l_min < 5) ||
1398 (Settings.gasConsumption_bottom_l_min > 50)) 1544 (Settings.gasConsumption_bottom_l_min > 50))
1399 { 1545 {
1400 Settings.gasConsumption_bottom_l_min = 20; 1546 Settings.gasConsumption_bottom_l_min = 20;
1401 corrections++; 1547 corrections++;
1402 } 1548 setFirstCorrection(parameterId);
1403 1549 }
1550 parameterId++;
1404 /* uint8_t gasConsumption_deco_l_min; 1551 /* uint8_t gasConsumption_deco_l_min;
1405 */ 1552 */
1406 if((Settings.gasConsumption_deco_l_min < 5) || 1553 if((Settings.gasConsumption_deco_l_min < 5) ||
1407 (Settings.gasConsumption_deco_l_min > 50)) 1554 (Settings.gasConsumption_deco_l_min > 50))
1408 { 1555 {
1409 Settings.gasConsumption_deco_l_min = 20; 1556 Settings.gasConsumption_deco_l_min = 20;
1410 corrections++; 1557 corrections++;
1411 } 1558 setFirstCorrection(parameterId);
1412 1559 }
1560 parameterId++;
1413 /* uint8_t showDebugInfo; 1561 /* uint8_t showDebugInfo;
1414 */ 1562 */
1415 #ifdef BOOT16 1563 #ifdef BOOT16
1416 Settings.showDebugInfo = 0; 1564 Settings.showDebugInfo = 0;
1417 #else 1565 #else
1435 */ 1583 */
1436 if((Settings.display_toogle_desc < 20) || (Settings.display_toogle_desc > 600)) 1584 if((Settings.display_toogle_desc < 20) || (Settings.display_toogle_desc > 600))
1437 { 1585 {
1438 Settings.display_toogle_desc = SettingsStandard.display_toogle_desc; 1586 Settings.display_toogle_desc = SettingsStandard.display_toogle_desc;
1439 corrections++; 1587 corrections++;
1440 } 1588 setFirstCorrection(parameterId);
1441 1589 }
1590 parameterId++;
1442 /* uint8_t debugModeOnStart; 1591 /* uint8_t debugModeOnStart;
1443 */ 1592 */
1444 if(Settings.debugModeOnStart > 1) 1593 if(Settings.debugModeOnStart > 1)
1445 { 1594 {
1446 Settings.debugModeOnStart = 0; 1595 Settings.debugModeOnStart = 0;
1447 corrections++; 1596 corrections++;
1448 } 1597 setFirstCorrection(parameterId);
1449 1598 }
1599 parameterId++;
1450 1600
1451 /* uint8_t IAmStolenPleaseKillMe; 1601 /* uint8_t IAmStolenPleaseKillMe;
1452 */ 1602 */
1453 1603
1454 if(hardwareDataGetPointer()->primarySerial == 90) 1604 if(hardwareDataGetPointer()->primarySerial == 90)
1461 */ 1611 */
1462 if(Settings.compassBearing > 360) 1612 if(Settings.compassBearing > 360)
1463 { 1613 {
1464 Settings.compassBearing = 0; 1614 Settings.compassBearing = 0;
1465 corrections++; 1615 corrections++;
1466 } 1616 setFirstCorrection(parameterId);
1467 1617 }
1468 1618
1619 parameterId++;
1469 /* uint8_t lastKnownBatteryPercentage; 1620 /* uint8_t lastKnownBatteryPercentage;
1470 */ 1621 */
1471 if(Settings.lastKnownBatteryPercentage > 100) 1622 if(Settings.lastKnownBatteryPercentage > 100)
1472 { 1623 {
1473 Settings.lastKnownBatteryPercentage = 100; 1624 Settings.lastKnownBatteryPercentage = 100;
1474 corrections++; 1625 corrections++;
1475 } 1626 setFirstCorrection(parameterId);
1476 1627 }
1628 parameterId++;
1477 /* uint8_t VPM_model 1629 /* uint8_t VPM_model
1478 */ 1630 */
1479 if((Settings.VPM_model != VPM_FROM_FORTRAN) && (Settings.VPM_model != VPM_BACHELORWORK)) 1631 if((Settings.VPM_model != VPM_FROM_FORTRAN) && (Settings.VPM_model != VPM_BACHELORWORK))
1480 { 1632 {
1481 Settings.VPM_model = VPM_FROM_FORTRAN; 1633 Settings.VPM_model = VPM_FROM_FORTRAN;
1482 corrections++; 1634 corrections++;
1483 } 1635 setFirstCorrection(parameterId);
1484 1636 }
1637 parameterId++;
1485 /* uint8_t Buehlmann_model 1638 /* uint8_t Buehlmann_model
1486 */ 1639 */
1487 if((Settings.GF_model != BUEHLMANN_OSTC4) && (Settings.GF_model != BUEHLMANN_hwOS)) 1640 if((Settings.GF_model != BUEHLMANN_OSTC4) && (Settings.GF_model != BUEHLMANN_hwOS))
1488 { 1641 {
1489 Settings.GF_model = BUEHLMANN_OSTC4; 1642 Settings.GF_model = BUEHLMANN_OSTC4;
1490 corrections++; 1643 corrections++;
1491 } 1644 setFirstCorrection(parameterId);
1492 1645 }
1646 parameterId++;
1493 if(Settings.FlipDisplay > 1) /* only boolean values allowed */ 1647 if(Settings.FlipDisplay > 1) /* only boolean values allowed */
1494 { 1648 {
1495 Settings.FlipDisplay = 0; 1649 Settings.FlipDisplay = 0;
1496 corrections++; 1650 corrections++;
1651 setFirstCorrection(parameterId);
1497 } 1652 }
1498 1653 parameterId++;
1499 #ifdef ENABLE_MOTION_CONTROL 1654 #ifdef ENABLE_MOTION_CONTROL
1500 if(Settings.MotionDetection >= MOTION_DETECT_END) 1655 if(Settings.MotionDetection >= MOTION_DETECT_END)
1501 { 1656 {
1502 Settings.MotionDetection = MOTION_DETECT_OFF; 1657 Settings.MotionDetection = MOTION_DETECT_OFF;
1503 corrections++; 1658 corrections++;
1659 setFirstCorrection(parameterId);
1504 } 1660 }
1505 #else 1661 #else
1506 Settings.MotionDetection = MOTION_DETECT_OFF; 1662 Settings.MotionDetection = MOTION_DETECT_OFF;
1507 Settings.viewPortMode = 0; 1663 Settings.viewPortMode = 0;
1508 Settings.viewRoll = 0.0; 1664 Settings.viewRoll = 0.0;
1509 Settings.viewPitch = 0.0; 1665 Settings.viewPitch = 0.0;
1510 Settings.viewYaw = 0.0; 1666 Settings.viewYaw = 0.0;
1511 #endif 1667 #endif
1512 1668 parameterId++;
1513 if(Settings.compassInertia > MAX_COMPASS_COMP) 1669 if(Settings.compassInertia > MAX_COMPASS_COMP)
1514 { 1670 {
1515 Settings.compassInertia = 0; 1671 Settings.compassInertia = 0;
1516 corrections++; 1672 corrections++;
1673 setFirstCorrection(parameterId);
1517 } 1674 }
1675 parameterId++;
1518 if(Settings.tX_customViewPrimaryBF > CVIEW_T3_END) 1676 if(Settings.tX_customViewPrimaryBF > CVIEW_T3_END)
1519 { 1677 {
1520 Settings.tX_customViewPrimaryBF = CVIEW_T3_Decostop; 1678 Settings.tX_customViewPrimaryBF = CVIEW_T3_Decostop;
1521 corrections++; 1679 corrections++;
1522 } 1680 setFirstCorrection(parameterId);
1681 }
1682 parameterId++;
1523 if(Settings.viewPortMode > MAX_VIEWPORT_MODE) 1683 if(Settings.viewPortMode > MAX_VIEWPORT_MODE)
1524 { 1684 {
1525 Settings.viewPortMode = 0; 1685 Settings.viewPortMode = 0;
1526 corrections++; 1686 corrections++;
1527 } 1687 setFirstCorrection(parameterId);
1688 }
1689 parameterId++;
1528 if(Settings.ppo2sensors_source >= O2_SENSOR_SOURCE_MAX) 1690 if(Settings.ppo2sensors_source >= O2_SENSOR_SOURCE_MAX)
1529 { 1691 {
1530 Settings.ppo2sensors_source = O2_SENSOR_SOURCE_OPTIC; 1692 Settings.ppo2sensors_source = O2_SENSOR_SOURCE_OPTIC;
1531 Settings.ppo2sensors_calibCoeff[0] = 0.0; 1693 Settings.ppo2sensors_calibCoeff[0] = 0.0;
1532 Settings.ppo2sensors_calibCoeff[1] = 0.0; 1694 Settings.ppo2sensors_calibCoeff[1] = 0.0;
1533 Settings.ppo2sensors_calibCoeff[2] = 0.0; 1695 Settings.ppo2sensors_calibCoeff[2] = 0.0;
1534 corrections++; 1696 corrections++;
1535 } 1697 setFirstCorrection(parameterId);
1536 1698 }
1699 parameterId++;
1537 if(Settings.amPMTime > 1) /* only boolean values allowed */ 1700 if(Settings.amPMTime > 1) /* only boolean values allowed */
1538 { 1701 {
1539 Settings.amPMTime = 0; 1702 Settings.amPMTime = 0;
1540 corrections++; 1703 corrections++;
1541 } 1704 setFirstCorrection(parameterId);
1542 1705 }
1706 parameterId++;
1543 if(Settings.autoSetpoint > 1) /* only boolean values allowed */ 1707 if(Settings.autoSetpoint > 1) /* only boolean values allowed */
1544 { 1708 {
1545 Settings.autoSetpoint = 0; 1709 Settings.autoSetpoint = 0;
1546 corrections++; 1710 corrections++;
1547 } 1711 setFirstCorrection(parameterId);
1548 1712 }
1713 parameterId++;
1549 if(Settings.scubberActiveId > 1) 1714 if(Settings.scubberActiveId > 1)
1550 { 1715 {
1551 Settings.scubberActiveId = 0; 1716 Settings.scubberActiveId = 0;
1552 corrections++; 1717 corrections++;
1553 } 1718 setFirstCorrection(parameterId);
1719 }
1720 parameterId++;
1554 if((Settings.scrubberData[0].TimerMax > MAX_SCRUBBER_TIME) || Settings.scrubberData[0].TimerCur < MIN_SCRUBBER_TIME || Settings.scrubberData[0].TimerCur > (int16_t)MAX_SCRUBBER_TIME) 1721 if((Settings.scrubberData[0].TimerMax > MAX_SCRUBBER_TIME) || Settings.scrubberData[0].TimerCur < MIN_SCRUBBER_TIME || Settings.scrubberData[0].TimerCur > (int16_t)MAX_SCRUBBER_TIME)
1555 { 1722 {
1556 Settings.scrubberData[0].TimerMax = 0; 1723 Settings.scrubberData[0].TimerMax = 0;
1557 Settings.scrubberData[0].TimerCur = 0; 1724 Settings.scrubberData[0].TimerCur = 0;
1558 corrections++; 1725 corrections++;
1559 } 1726 setFirstCorrection(parameterId);
1727 }
1728 parameterId++;
1560 if((Settings.scrubberData[1].TimerMax > MAX_SCRUBBER_TIME) || Settings.scrubberData[1].TimerCur < MIN_SCRUBBER_TIME || Settings.scrubberData[1].TimerCur > (int16_t)MAX_SCRUBBER_TIME) 1729 if((Settings.scrubberData[1].TimerMax > MAX_SCRUBBER_TIME) || Settings.scrubberData[1].TimerCur < MIN_SCRUBBER_TIME || Settings.scrubberData[1].TimerCur > (int16_t)MAX_SCRUBBER_TIME)
1561 { 1730 {
1562 Settings.scrubberData[1].TimerMax = 0; 1731 Settings.scrubberData[1].TimerMax = 0;
1563 Settings.scrubberData[1].TimerCur = 0; 1732 Settings.scrubberData[1].TimerCur = 0;
1564 corrections++; 1733 corrections++;
1565 } 1734 setFirstCorrection(parameterId);
1735 }
1736 parameterId++;
1566 if(Settings.scrubTimerMode > SCRUB_TIMER_END) 1737 if(Settings.scrubTimerMode > SCRUB_TIMER_END)
1567 { 1738 {
1568 Settings.scrubTimerMode = SCRUB_TIMER_OFF; 1739 Settings.scrubTimerMode = SCRUB_TIMER_OFF;
1569 corrections++; 1740 corrections++;
1570 } 1741 setFirstCorrection(parameterId);
1571 1742 }
1743 parameterId++;
1572 if((Settings.pscr_lung_ratio > PSCR_MAX_LUNG_RATIO) || (Settings.pscr_lung_ratio < PSCR_MIN_LUNG_RATIO)) 1744 if((Settings.pscr_lung_ratio > PSCR_MAX_LUNG_RATIO) || (Settings.pscr_lung_ratio < PSCR_MIN_LUNG_RATIO))
1573 { 1745 {
1574 Settings.pscr_lung_ratio = 10; 1746 Settings.pscr_lung_ratio = 10;
1575 corrections++; 1747 corrections++;
1576 } 1748 setFirstCorrection(parameterId);
1749 }
1750 parameterId++;
1577 if(Settings.pscr_o2_drop > PSCR_MAX_O2_DROP) 1751 if(Settings.pscr_o2_drop > PSCR_MAX_O2_DROP)
1578 { 1752 {
1579 Settings.pscr_o2_drop = 4; 1753 Settings.pscr_o2_drop = 4;
1580 corrections++; 1754 corrections++;
1581 } 1755 setFirstCorrection(parameterId);
1582 1756 }
1757 parameterId++;
1583 if(Settings.co2_sensor_active > 1) 1758 if(Settings.co2_sensor_active > 1)
1584 { 1759 {
1585 Settings.co2_sensor_active = 0; 1760 Settings.co2_sensor_active = 0;
1586 corrections++; 1761 corrections++;
1587 } 1762 setFirstCorrection(parameterId);
1763 }
1764 parameterId++;
1588 if(Settings.ext_uart_protocol > UART_MAX_PROTOCOL) 1765 if(Settings.ext_uart_protocol > UART_MAX_PROTOCOL)
1589 { 1766 {
1590 Settings.ext_uart_protocol = 0; 1767 Settings.ext_uart_protocol = 0;
1591 corrections++; 1768 corrections++;
1592 } 1769 setFirstCorrection(parameterId);
1770 }
1771 parameterId++;
1593 if((Settings.ext_sensor_map[0] >= SENSOR_END) 1772 if((Settings.ext_sensor_map[0] >= SENSOR_END)
1594 || (Settings.ext_sensor_map[1] >= SENSOR_END) 1773 || (Settings.ext_sensor_map[1] >= SENSOR_END)
1595 || (Settings.ext_sensor_map[2] >= SENSOR_END) 1774 || (Settings.ext_sensor_map[2] >= SENSOR_END)
1596 || (Settings.ext_sensor_map[3] >= SENSOR_END) 1775 || (Settings.ext_sensor_map[3] >= SENSOR_END)
1597 || (Settings.ext_sensor_map[4] >= SENSOR_END) 1776 || (Settings.ext_sensor_map[4] >= SENSOR_END)
1606 Settings.ext_sensor_map[4] = SENSOR_NONE; 1785 Settings.ext_sensor_map[4] = SENSOR_NONE;
1607 Settings.ext_sensor_map[5] = SENSOR_NONE; 1786 Settings.ext_sensor_map[5] = SENSOR_NONE;
1608 Settings.ext_sensor_map[6] = SENSOR_NONE; 1787 Settings.ext_sensor_map[6] = SENSOR_NONE;
1609 Settings.ext_sensor_map[7] = SENSOR_NONE; 1788 Settings.ext_sensor_map[7] = SENSOR_NONE;
1610 corrections++; 1789 corrections++;
1611 } 1790 setFirstCorrection(parameterId);
1612 1791 }
1792 parameterId++;
1613 if(Settings.buttonLockActive > 1) 1793 if(Settings.buttonLockActive > 1)
1614 { 1794 {
1615 Settings.buttonLockActive = 1; 1795 Settings.buttonLockActive = 1;
1616 corrections++; 1796 corrections++;
1617 } 1797 setFirstCorrection(parameterId);
1618 1798 }
1799 parameterId++;
1619 if (Settings.compassDeclinationDeg > 99) { 1800 if (Settings.compassDeclinationDeg > 99) {
1620 Settings.compassDeclinationDeg = 99; 1801 Settings.compassDeclinationDeg = 99;
1621 1802
1622 corrections++; 1803 corrections++;
1804 setFirstCorrection(parameterId);
1623 } else if (Settings.compassDeclinationDeg < -99) { 1805 } else if (Settings.compassDeclinationDeg < -99) {
1624 Settings.compassDeclinationDeg = -99; 1806 Settings.compassDeclinationDeg = -99;
1625 1807
1626 corrections++; 1808 corrections++;
1627 } 1809 setFirstCorrection(parameterId);
1628 1810 }
1811 parameterId++;
1629 if (Settings.timerDurationS > 599) { 1812 if (Settings.timerDurationS > 599) {
1630 Settings.timerDurationS = 599; 1813 Settings.timerDurationS = 599;
1631 1814
1632 corrections++; 1815 corrections++;
1816 setFirstCorrection(parameterId);
1633 } else if (Settings.timerDurationS < 1) { 1817 } else if (Settings.timerDurationS < 1) {
1634 Settings.timerDurationS = 1; 1818 Settings.timerDurationS = 1;
1635 1819
1636 corrections++; 1820 corrections++;
1637 } 1821 setFirstCorrection(parameterId);
1638 1822 }
1823 parameterId++;
1639 if(corrections) 1824 if(corrections)
1640 { 1825 {
1641 settingsWarning = 1; 1826 settingsWarning = 1;
1642 } 1827 }
1643 else 1828 else
1645 if(corrections > 255) 1830 if(corrections > 255)
1646 { 1831 {
1647 corrections = 255; 1832 corrections = 255;
1648 } 1833 }
1649 1834
1835 SettingsStatus.Corrections = corrections;
1650 return (uint8_t)corrections; 1836 return (uint8_t)corrections;
1651 } 1837 }
1652 1838
1653 1839
1654 /* always at 0x8080000, do not move -> bootloader access */ 1840 /* always at 0x8080000, do not move -> bootloader access */