Mercurial > public > ostc4
comparison Discovery/Src/settings.c @ 997:2f7531a8e922 GasConsumption
Rework default settings:
A factory reset of the settings could lead to a corruption of the profile view of the log entries because the storage pointer was reset as well. This has been corrected together with the default settings of the cviews and the OSTC5 customer name.
| author | Ideenmodellierer |
|---|---|
| date | Wed, 23 Apr 2025 14:47:42 +0200 |
| parents | bad5561c0c59 |
| children | 21142f4fa968 |
comparison
equal
deleted
inserted
replaced
| 996:8507a87f6401 | 997:2f7531a8e922 |
|---|---|
| 499 case 0xFFFF0017: | 499 case 0xFFFF0017: |
| 500 setFlipDisplay(0); | 500 setFlipDisplay(0); |
| 501 // no break | 501 // no break |
| 502 case 0xFFFF0018: | 502 case 0xFFFF0018: |
| 503 pSettings->cv_configuration = 0xFFFFFFFF; | 503 pSettings->cv_configuration = 0xFFFFFFFF; |
| 504 pSettings->cv_configuration &= pSettings->cv_configuration ^= 1 << (CVIEW_Timer); | |
| 504 // no break | 505 // no break |
| 505 case 0xFFFF0019: | 506 case 0xFFFF0019: |
| 506 pSettings->MotionDetection = MOTION_DETECT_OFF; | 507 pSettings->MotionDetection = MOTION_DETECT_OFF; |
| 507 // no break | 508 // no break |
| 508 case 0xFFFF001A: | 509 case 0xFFFF001A: |
| 755 { | 756 { |
| 756 Settings.warning_blink_dsec = SettingsStandard.warning_blink_dsec; | 757 Settings.warning_blink_dsec = SettingsStandard.warning_blink_dsec; |
| 757 corrections++; | 758 corrections++; |
| 758 setFirstCorrection(parameterId); | 759 setFirstCorrection(parameterId); |
| 759 } | 760 } |
| 760 parameterId++; | 761 parameterId++; /* 1 */ |
| 761 /* uint8_t lastDiveLogId; | 762 /* uint8_t lastDiveLogId; |
| 762 */ | 763 */ |
| 763 | 764 |
| 764 /* uint32_t logFlashNextSampleStartAddress; | 765 /* uint32_t logFlashNextSampleStartAddress; |
| 765 */ | 766 */ |
| 767 { | 768 { |
| 768 Settings.logFlashNextSampleStartAddress = SAMPLESTART; | 769 Settings.logFlashNextSampleStartAddress = SAMPLESTART; |
| 769 corrections++; | 770 corrections++; |
| 770 setFirstCorrection(parameterId); | 771 setFirstCorrection(parameterId); |
| 771 } | 772 } |
| 772 parameterId++; | 773 parameterId++; /* 2 */ |
| 773 | 774 |
| 774 /* uint8_t dive_mode; has to before the gases | 775 /* uint8_t dive_mode; has to before the gases |
| 775 */ | 776 */ |
| 776 if( (Settings.dive_mode != DIVEMODE_OC) && | 777 if( (Settings.dive_mode != DIVEMODE_OC) && |
| 777 (Settings.dive_mode != DIVEMODE_CCR) && | 778 (Settings.dive_mode != DIVEMODE_CCR) && |
| 781 { | 782 { |
| 782 Settings.dive_mode = DIVEMODE_OC; | 783 Settings.dive_mode = DIVEMODE_OC; |
| 783 corrections++; | 784 corrections++; |
| 784 setFirstCorrection(parameterId); | 785 setFirstCorrection(parameterId); |
| 785 } | 786 } |
| 786 parameterId++; | 787 parameterId++;/* 3 */ |
| 787 | 788 |
| 788 /* SGasLine gas[1 + (2*NUM_GASES)]; | 789 /* SGasLine gas[1 + (2*NUM_GASES)]; |
| 789 */ | 790 */ |
| 790 for(int i=1; i<=2*NUM_GASES;i++) | 791 for(int i=1; i<=2*NUM_GASES;i++) |
| 791 { | 792 { |
| 889 if(Settings.gas[i].bottle_wireless_id) | 890 if(Settings.gas[i].bottle_wireless_id) |
| 890 { | 891 { |
| 891 } | 892 } |
| 892 */ | 893 */ |
| 893 } // for(int i=1; i<=2*NUM_GASES;i++) | 894 } // for(int i=1; i<=2*NUM_GASES;i++) |
| 894 parameterId++; | 895 parameterId++; /* 4 */ |
| 895 if(!firstGasFoundOC) | 896 if(!firstGasFoundOC) |
| 896 { | 897 { |
| 897 Settings.gas[1].note.ub.active = 1; | 898 Settings.gas[1].note.ub.active = 1; |
| 898 Settings.gas[1].note.ub.first = 1; | 899 Settings.gas[1].note.ub.first = 1; |
| 899 Settings.gas[1].note.ub.travel = 0; | 900 Settings.gas[1].note.ub.travel = 0; |
| 900 Settings.gas[1].note.ub.deco = 0; | 901 Settings.gas[1].note.ub.deco = 0; |
| 901 corrections++; | 902 corrections++; |
| 902 setFirstCorrection(parameterId); | 903 setFirstCorrection(parameterId); |
| 903 } | 904 } |
| 904 parameterId++; | 905 parameterId++; /* 5 */ |
| 905 if(!firstGasFoundCCR) | 906 if(!firstGasFoundCCR) |
| 906 { | 907 { |
| 907 Settings.gas[1 + NUM_GASES].note.ub.active = 1; | 908 Settings.gas[1 + NUM_GASES].note.ub.active = 1; |
| 908 Settings.gas[1 + NUM_GASES].note.ub.first = 1; | 909 Settings.gas[1 + NUM_GASES].note.ub.first = 1; |
| 909 Settings.gas[1 + NUM_GASES].note.ub.travel = 0; | 910 Settings.gas[1 + NUM_GASES].note.ub.travel = 0; |
| 910 Settings.gas[1 + NUM_GASES].note.ub.deco = 0; | 911 Settings.gas[1 + NUM_GASES].note.ub.deco = 0; |
| 911 corrections++; | 912 corrections++; |
| 912 setFirstCorrection(parameterId); | 913 setFirstCorrection(parameterId); |
| 913 } | 914 } |
| 914 parameterId++; | 915 parameterId++; /* 6 */ |
| 915 /* SSetpointLine setpoint[1 + NUM_GASES]; | 916 /* SSetpointLine setpoint[1 + NUM_GASES]; |
| 916 */ | 917 */ |
| 917 for(int i=1; i<=NUM_GASES;i++) | 918 for(int i=1; i<=NUM_GASES;i++) |
| 918 { | 919 { |
| 919 if(Settings.setpoint[i].setpoint_cbar < MIN_PPO2_SP_CBAR) | 920 if(Settings.setpoint[i].setpoint_cbar < MIN_PPO2_SP_CBAR) |
| 933 Settings.setpoint[i].depth_meter = 250; | 934 Settings.setpoint[i].depth_meter = 250; |
| 934 corrections++; | 935 corrections++; |
| 935 setFirstCorrection(parameterId); | 936 setFirstCorrection(parameterId); |
| 936 } | 937 } |
| 937 } // for(int i=1; i<=NUM_GASES;i++) | 938 } // for(int i=1; i<=NUM_GASES;i++) |
| 938 parameterId++; | 939 parameterId++; /* 7 */ |
| 939 if (checkAndFixSetpointSettings()) { | 940 if (checkAndFixSetpointSettings()) { |
| 940 corrections++; | 941 corrections++; |
| 941 setFirstCorrection(parameterId); | 942 setFirstCorrection(parameterId); |
| 942 } | 943 } |
| 943 parameterId++; | 944 parameterId++; /* 8 */ |
| 944 /* uint8_t CCR_Mode; | 945 /* uint8_t CCR_Mode; |
| 945 */ | 946 */ |
| 946 if( (Settings.CCR_Mode != CCRMODE_Sensors) && | 947 if( (Settings.CCR_Mode != CCRMODE_Sensors) && |
| 947 (Settings.CCR_Mode != CCRMODE_Simulation) && | 948 (Settings.CCR_Mode != CCRMODE_Simulation) && |
| 948 (Settings.CCR_Mode != CCRMODE_FixedSetpoint)) | 949 (Settings.CCR_Mode != CCRMODE_FixedSetpoint)) |
| 949 { | 950 { |
| 950 Settings.CCR_Mode = CCRMODE_FixedSetpoint; | 951 Settings.CCR_Mode = CCRMODE_FixedSetpoint; |
| 951 corrections++; | 952 corrections++; |
| 952 setFirstCorrection(parameterId); | 953 setFirstCorrection(parameterId); |
| 953 } | 954 } |
| 954 parameterId++; | 955 parameterId++; /* 9 */ |
| 955 /* split2x4_Type deco_type; | 956 /* split2x4_Type deco_type; |
| 956 */ | 957 */ |
| 957 if( (Settings.deco_type.ub.standard != GF_MODE) && | 958 if( (Settings.deco_type.ub.standard != GF_MODE) && |
| 958 (Settings.deco_type.ub.standard != VPM_MODE)) | 959 (Settings.deco_type.ub.standard != VPM_MODE)) |
| 959 { | 960 { |
| 960 Settings.deco_type.ub.standard = VPM_MODE; | 961 Settings.deco_type.ub.standard = VPM_MODE; |
| 961 corrections++; | 962 corrections++; |
| 962 setFirstCorrection(parameterId); | 963 setFirstCorrection(parameterId); |
| 963 } | 964 } |
| 964 parameterId++; | 965 parameterId++; /* 10 */ |
| 965 if(Settings.deco_type.ub.alternative != GF_MODE) | 966 if(Settings.deco_type.ub.alternative != GF_MODE) |
| 966 { | 967 { |
| 967 Settings.deco_type.ub.alternative = GF_MODE; | 968 Settings.deco_type.ub.alternative = GF_MODE; |
| 968 corrections++; | 969 corrections++; |
| 969 setFirstCorrection(parameterId); | 970 setFirstCorrection(parameterId); |
| 970 } | 971 } |
| 971 parameterId++; | 972 parameterId++; /* 11 */ |
| 972 /* uint8_t ppO2_max_deco; | 973 /* uint8_t ppO2_max_deco; |
| 973 */ | 974 */ |
| 974 if(Settings.ppO2_max_deco > 190) | 975 if(Settings.ppO2_max_deco > 190) |
| 975 { | 976 { |
| 976 Settings.ppO2_max_deco = 190; | 977 Settings.ppO2_max_deco = 190; |
| 977 corrections++; | 978 corrections++; |
| 978 setFirstCorrection(parameterId); | 979 setFirstCorrection(parameterId); |
| 979 } | 980 } |
| 980 parameterId++; | 981 parameterId++; /* 12 */ |
| 981 if(Settings.ppO2_max_deco < 100) | 982 if(Settings.ppO2_max_deco < 100) |
| 982 { | 983 { |
| 983 Settings.ppO2_max_deco = 100; | 984 Settings.ppO2_max_deco = 100; |
| 984 corrections++; | 985 corrections++; |
| 985 setFirstCorrection(parameterId); | 986 setFirstCorrection(parameterId); |
| 986 } | 987 } |
| 987 parameterId++; | 988 parameterId++; /* 13 */ |
| 988 | 989 |
| 989 /* uint8_t ppO2_max_std; | 990 /* uint8_t ppO2_max_std; |
| 990 */ | 991 */ |
| 991 if(Settings.ppO2_max_std > 190) | 992 if(Settings.ppO2_max_std > 190) |
| 992 { | 993 { |
| 993 Settings.ppO2_max_std = 190; | 994 Settings.ppO2_max_std = 190; |
| 994 corrections++; | 995 corrections++; |
| 995 setFirstCorrection(parameterId); | 996 setFirstCorrection(parameterId); |
| 996 } | 997 } |
| 997 parameterId++; | 998 parameterId++; /* 14 */ |
| 998 if(Settings.ppO2_max_std < 100) | 999 if(Settings.ppO2_max_std < 100) |
| 999 { | 1000 { |
| 1000 Settings.ppO2_max_std = 100; | 1001 Settings.ppO2_max_std = 100; |
| 1001 corrections++; | 1002 corrections++; |
| 1002 setFirstCorrection(parameterId); | 1003 setFirstCorrection(parameterId); |
| 1003 } | 1004 } |
| 1004 parameterId++; | 1005 parameterId++; /* 15 */ |
| 1005 /* uint8_t ppO2_min; | 1006 /* uint8_t ppO2_min; |
| 1006 */ | 1007 */ |
| 1007 if(Settings.ppO2_min != 15) | 1008 if(Settings.ppO2_min != 15) |
| 1008 { | 1009 { |
| 1009 Settings.ppO2_min = 15; | 1010 Settings.ppO2_min = 15; |
| 1010 corrections++; | 1011 corrections++; |
| 1011 setFirstCorrection(parameterId); | 1012 setFirstCorrection(parameterId); |
| 1012 } | 1013 } |
| 1013 parameterId++; | 1014 parameterId++; /* 16 */ |
| 1014 /* uint8_t CNS_max; | 1015 /* uint8_t CNS_max; |
| 1015 */ | 1016 */ |
| 1016 if(Settings.CNS_max != 90) | 1017 if(Settings.CNS_max != 90) |
| 1017 { | 1018 { |
| 1018 Settings.CNS_max = 90; | 1019 Settings.CNS_max = 90; |
| 1019 corrections++; | 1020 corrections++; |
| 1020 setFirstCorrection(parameterId); | 1021 setFirstCorrection(parameterId); |
| 1021 } | 1022 } |
| 1022 parameterId++; | 1023 parameterId++; /* 17 */ |
| 1023 /* uint8_t ascent_MeterPerMinute_max; | 1024 /* uint8_t ascent_MeterPerMinute_max; |
| 1024 */ | 1025 */ |
| 1025 if(Settings.ascent_MeterPerMinute_max != 30) | 1026 if(Settings.ascent_MeterPerMinute_max != 30) |
| 1026 { | 1027 { |
| 1027 Settings.ascent_MeterPerMinute_max = 30; | 1028 Settings.ascent_MeterPerMinute_max = 30; |
| 1028 corrections++; | 1029 corrections++; |
| 1029 setFirstCorrection(parameterId); | 1030 setFirstCorrection(parameterId); |
| 1030 } | 1031 } |
| 1031 parameterId++; | 1032 parameterId++; /* 18 */ |
| 1032 /* uint8_t ascent_MeterPerMinute_showGraph; | 1033 /* uint8_t ascent_MeterPerMinute_showGraph; |
| 1033 */ | 1034 */ |
| 1034 if(Settings.ascent_MeterPerMinute_showGraph != 30) | 1035 if(Settings.ascent_MeterPerMinute_showGraph != 30) |
| 1035 { | 1036 { |
| 1036 Settings.ascent_MeterPerMinute_showGraph = 30; | 1037 Settings.ascent_MeterPerMinute_showGraph = 30; |
| 1037 corrections++; | 1038 corrections++; |
| 1038 setFirstCorrection(parameterId); | 1039 setFirstCorrection(parameterId); |
| 1039 } | 1040 } |
| 1040 parameterId++; | 1041 parameterId++; /* 19 */ |
| 1041 /* uint8_t future_TTS; | 1042 /* uint8_t future_TTS; |
| 1042 */ | 1043 */ |
| 1043 if(Settings.future_TTS > 15) | 1044 if(Settings.future_TTS > 15) |
| 1044 { | 1045 { |
| 1045 Settings.future_TTS = 15; | 1046 Settings.future_TTS = 15; |
| 1046 corrections++; | 1047 corrections++; |
| 1047 setFirstCorrection(parameterId); | 1048 setFirstCorrection(parameterId); |
| 1048 } | 1049 } |
| 1049 parameterId++; | 1050 parameterId++; /* 20 */ |
| 1050 /* uint8_t GF_high; | 1051 /* uint8_t GF_high; |
| 1051 */ | 1052 */ |
| 1052 if(Settings.GF_high > 99) | 1053 if(Settings.GF_high > 99) |
| 1053 { | 1054 { |
| 1054 Settings.GF_high = 99; | 1055 Settings.GF_high = 99; |
| 1055 corrections++; | 1056 corrections++; |
| 1056 setFirstCorrection(parameterId); | 1057 setFirstCorrection(parameterId); |
| 1057 } | 1058 } |
| 1058 parameterId++; | 1059 parameterId++; /* 21 */ |
| 1059 if(Settings.GF_high < 45) | 1060 if(Settings.GF_high < 45) |
| 1060 { | 1061 { |
| 1061 Settings.GF_high = 45; | 1062 Settings.GF_high = 45; |
| 1062 corrections++; | 1063 corrections++; |
| 1063 setFirstCorrection(parameterId); | 1064 setFirstCorrection(parameterId); |
| 1064 } | 1065 } |
| 1065 parameterId++; | 1066 parameterId++; /* 22 */ |
| 1066 /* uint8_t GF_low; | 1067 /* uint8_t GF_low; |
| 1067 */ | 1068 */ |
| 1068 if(Settings.GF_low > 99) | 1069 if(Settings.GF_low > 99) |
| 1069 { | 1070 { |
| 1070 Settings.GF_low = 99; | 1071 Settings.GF_low = 99; |
| 1071 corrections++; | 1072 corrections++; |
| 1072 setFirstCorrection(parameterId); | 1073 setFirstCorrection(parameterId); |
| 1073 } | 1074 } |
| 1074 parameterId++; | 1075 parameterId++; /* 23 */ |
| 1075 if(Settings.GF_low < 10) | 1076 if(Settings.GF_low < 10) |
| 1076 { | 1077 { |
| 1077 Settings.GF_low = 10; | 1078 Settings.GF_low = 10; |
| 1078 corrections++; | 1079 corrections++; |
| 1079 setFirstCorrection(parameterId); | 1080 setFirstCorrection(parameterId); |
| 1080 } | 1081 } |
| 1081 parameterId++; | 1082 parameterId++; /* 24 */ |
| 1082 if(Settings.GF_low > Settings.GF_high) | 1083 if(Settings.GF_low > Settings.GF_high) |
| 1083 { | 1084 { |
| 1084 Settings.GF_low = Settings.GF_high; | 1085 Settings.GF_low = Settings.GF_high; |
| 1085 corrections++; | 1086 corrections++; |
| 1086 setFirstCorrection(parameterId); | 1087 setFirstCorrection(parameterId); |
| 1087 } | 1088 } |
| 1088 parameterId++; | 1089 parameterId++; /* 25 */ |
| 1089 /* uint8_t aGF_high; | 1090 /* uint8_t aGF_high; |
| 1090 */ | 1091 */ |
| 1091 if(Settings.aGF_high > 99) | 1092 if(Settings.aGF_high > 99) |
| 1092 { | 1093 { |
| 1093 Settings.aGF_high = 99; | 1094 Settings.aGF_high = 99; |
| 1094 corrections++; | 1095 corrections++; |
| 1095 setFirstCorrection(parameterId); | 1096 setFirstCorrection(parameterId); |
| 1096 } | 1097 } |
| 1097 parameterId++; | 1098 parameterId++; /* 26 */ |
| 1098 if(Settings.aGF_high < 45) | 1099 if(Settings.aGF_high < 45) |
| 1099 { | 1100 { |
| 1100 Settings.aGF_high = 45; | 1101 Settings.aGF_high = 45; |
| 1101 corrections++; | 1102 corrections++; |
| 1102 setFirstCorrection(parameterId); | 1103 setFirstCorrection(parameterId); |
| 1103 } | 1104 } |
| 1104 parameterId++; | 1105 parameterId++; /* 27 */ |
| 1105 /* uint8_t aGF_low; | 1106 /* uint8_t aGF_low; |
| 1106 */ | 1107 */ |
| 1107 if(Settings.aGF_low > 99) | 1108 if(Settings.aGF_low > 99) |
| 1108 { | 1109 { |
| 1109 Settings.aGF_low = 99; | 1110 Settings.aGF_low = 99; |
| 1110 corrections++; | 1111 corrections++; |
| 1111 setFirstCorrection(parameterId); | 1112 setFirstCorrection(parameterId); |
| 1112 } | 1113 } |
| 1113 parameterId++; | 1114 parameterId++; /* 28 */ |
| 1114 if(Settings.aGF_low < 10) | 1115 if(Settings.aGF_low < 10) |
| 1115 { | 1116 { |
| 1116 Settings.aGF_low = 10; | 1117 Settings.aGF_low = 10; |
| 1117 corrections++; | 1118 corrections++; |
| 1118 setFirstCorrection(parameterId); | 1119 setFirstCorrection(parameterId); |
| 1119 } | 1120 } |
| 1120 parameterId++; | 1121 parameterId++; /* 29 */ |
| 1121 if(Settings.aGF_low > Settings.aGF_high) | 1122 if(Settings.aGF_low > Settings.aGF_high) |
| 1122 { | 1123 { |
| 1123 Settings.aGF_low = Settings.aGF_high; | 1124 Settings.aGF_low = Settings.aGF_high; |
| 1124 corrections++; | 1125 corrections++; |
| 1125 setFirstCorrection(parameterId); | 1126 setFirstCorrection(parameterId); |
| 1126 } | 1127 } |
| 1127 parameterId++; | 1128 parameterId++; /* 30 */ |
| 1128 /* split2x4_Type VPM_conservatism; | 1129 /* split2x4_Type VPM_conservatism; |
| 1129 */ | 1130 */ |
| 1130 if(Settings.VPM_conservatism.ub.standard > 5) | 1131 if(Settings.VPM_conservatism.ub.standard > 5) |
| 1131 { | 1132 { |
| 1132 Settings.VPM_conservatism.ub.standard = 5; | 1133 Settings.VPM_conservatism.ub.standard = 5; |
| 1133 corrections++; | 1134 corrections++; |
| 1134 setFirstCorrection(parameterId); | 1135 setFirstCorrection(parameterId); |
| 1135 } | 1136 } |
| 1136 parameterId++; | 1137 parameterId++; /* 31 */ |
| 1137 if(Settings.VPM_conservatism.ub.alternative > 5) | 1138 if(Settings.VPM_conservatism.ub.alternative > 5) |
| 1138 { | 1139 { |
| 1139 Settings.VPM_conservatism.ub.alternative = 5; | 1140 Settings.VPM_conservatism.ub.alternative = 5; |
| 1140 corrections++; | 1141 corrections++; |
| 1141 setFirstCorrection(parameterId); | 1142 setFirstCorrection(parameterId); |
| 1142 } | 1143 } |
| 1143 parameterId++; | 1144 parameterId++; /* 32 */ |
| 1144 /* uint8_t safetystopDuration; | 1145 /* uint8_t safetystopDuration; |
| 1145 */ | 1146 */ |
| 1146 if(Settings.safetystopDuration > 5) | 1147 if(Settings.safetystopDuration > 5) |
| 1147 { | 1148 { |
| 1148 Settings.safetystopDuration = 5; | 1149 Settings.safetystopDuration = 5; |
| 1149 corrections++; | 1150 corrections++; |
| 1150 setFirstCorrection(parameterId); | 1151 setFirstCorrection(parameterId); |
| 1151 } | 1152 } |
| 1152 parameterId++; | 1153 parameterId++; /* 33 */ |
| 1153 /* uint8_t AtemMinutenVolumenLiter; | 1154 /* uint8_t AtemMinutenVolumenLiter; |
| 1154 */ | 1155 */ |
| 1155 if(Settings.AtemMinutenVolumenLiter != 25) | 1156 if(Settings.AtemMinutenVolumenLiter != 25) |
| 1156 { | 1157 { |
| 1157 Settings.AtemMinutenVolumenLiter = 25; | 1158 Settings.AtemMinutenVolumenLiter = 25; |
| 1158 corrections++; | 1159 corrections++; |
| 1159 setFirstCorrection(parameterId); | 1160 setFirstCorrection(parameterId); |
| 1160 } | 1161 } |
| 1161 parameterId++; | 1162 parameterId++; /* 34 */ |
| 1162 /* uint8_t ReserveFractionDenominator; | 1163 /* uint8_t ReserveFractionDenominator; |
| 1163 */ | 1164 */ |
| 1164 if(Settings.ReserveFractionDenominator != 4) | 1165 if(Settings.ReserveFractionDenominator != 4) |
| 1165 { | 1166 { |
| 1166 Settings.ReserveFractionDenominator = 4; | 1167 Settings.ReserveFractionDenominator = 4; |
| 1167 corrections++; | 1168 corrections++; |
| 1168 setFirstCorrection(parameterId); | 1169 setFirstCorrection(parameterId); |
| 1169 } | 1170 } |
| 1170 parameterId++; | 1171 parameterId++; /* 35 */ |
| 1171 /* uint8_t salinity; | 1172 /* uint8_t salinity; |
| 1172 */ | 1173 */ |
| 1173 if(Settings.salinity > 4) | 1174 if(Settings.salinity > 4) |
| 1174 { | 1175 { |
| 1175 Settings.salinity = 4; | 1176 Settings.salinity = 4; |
| 1176 corrections++; | 1177 corrections++; |
| 1177 setFirstCorrection(parameterId); | 1178 setFirstCorrection(parameterId); |
| 1178 } | 1179 } |
| 1179 parameterId++; | 1180 parameterId++; /* 36 */ |
| 1180 /* uint8_t last_stop_depth_meter; | 1181 /* uint8_t last_stop_depth_meter; |
| 1181 */ | 1182 */ |
| 1182 if(Settings.last_stop_depth_meter > 9) | 1183 if(Settings.last_stop_depth_meter > 9) |
| 1183 { | 1184 { |
| 1184 Settings.last_stop_depth_meter = 9; | 1185 Settings.last_stop_depth_meter = 9; |
| 1185 corrections++; | 1186 corrections++; |
| 1186 setFirstCorrection(parameterId); | 1187 setFirstCorrection(parameterId); |
| 1187 } | 1188 } |
| 1188 parameterId++; | 1189 parameterId++; /* 37 */ |
| 1189 if(Settings.last_stop_depth_meter < 3) | 1190 if(Settings.last_stop_depth_meter < 3) |
| 1190 { | 1191 { |
| 1191 Settings.last_stop_depth_meter = 3; | 1192 Settings.last_stop_depth_meter = 3; |
| 1192 corrections++; | 1193 corrections++; |
| 1193 setFirstCorrection(parameterId); | 1194 setFirstCorrection(parameterId); |
| 1194 } | 1195 } |
| 1195 parameterId++; | 1196 parameterId++; /* 38 */ |
| 1196 /* uint8_t stop_increment_depth_meter; | 1197 /* uint8_t stop_increment_depth_meter; |
| 1197 */ | 1198 */ |
| 1198 if(Settings.stop_increment_depth_meter != 3) | 1199 if(Settings.stop_increment_depth_meter != 3) |
| 1199 { | 1200 { |
| 1200 Settings.stop_increment_depth_meter = 3; | 1201 Settings.stop_increment_depth_meter = 3; |
| 1201 corrections++; | 1202 corrections++; |
| 1202 setFirstCorrection(parameterId); | 1203 setFirstCorrection(parameterId); |
| 1203 } | 1204 } |
| 1204 parameterId++; | 1205 parameterId++; /* 39 */ |
| 1205 /* uint8_t brightness; | 1206 /* uint8_t brightness; |
| 1206 */ | 1207 */ |
| 1207 if(Settings.brightness > 4) | 1208 if(Settings.brightness > 4) |
| 1208 { | 1209 { |
| 1209 Settings.brightness = 4; | 1210 Settings.brightness = 4; |
| 1210 corrections++; | 1211 corrections++; |
| 1211 setFirstCorrection(parameterId); | 1212 setFirstCorrection(parameterId); |
| 1212 } | 1213 } |
| 1213 parameterId++; | 1214 parameterId++; /* 40 */ |
| 1214 /* uint8_t date_format; | 1215 /* uint8_t date_format; |
| 1215 */ | 1216 */ |
| 1216 if( (Settings.date_format != DDMMYY) && | 1217 if( (Settings.date_format != DDMMYY) && |
| 1217 (Settings.date_format != MMDDYY) && | 1218 (Settings.date_format != MMDDYY) && |
| 1218 (Settings.date_format != YYMMDD)) | 1219 (Settings.date_format != YYMMDD)) |
| 1219 { | 1220 { |
| 1220 Settings.date_format = DDMMYY; | 1221 Settings.date_format = DDMMYY; |
| 1221 corrections++; | 1222 corrections++; |
| 1222 setFirstCorrection(parameterId); | 1223 setFirstCorrection(parameterId); |
| 1223 } | 1224 } |
| 1224 parameterId++; | 1225 parameterId++; /* 41 */ |
| 1225 /* uint8_t selected_language; | 1226 /* uint8_t selected_language; |
| 1226 */ | 1227 */ |
| 1227 if(Settings.selected_language >= LANGUAGE_END) | 1228 if(Settings.selected_language >= LANGUAGE_END) |
| 1228 { | 1229 { |
| 1229 Settings.selected_language = LANGUAGE_English; | 1230 Settings.selected_language = LANGUAGE_English; |
| 1230 corrections++; | 1231 corrections++; |
| 1231 setFirstCorrection(parameterId); | 1232 setFirstCorrection(parameterId); |
| 1232 } | 1233 } |
| 1233 parameterId++; | 1234 parameterId++; /* 42 */ |
| 1234 /* char customtext[60]; | 1235 /* char customtext[60]; |
| 1235 */ | 1236 */ |
| 1236 if(Settings.customtext[59] != 0) | 1237 if(Settings.customtext[59] != 0) |
| 1237 { | 1238 { |
| 1238 Settings.customtext[59] = 0; | 1239 Settings.customtext[59] = 0; |
| 1239 corrections++; | 1240 corrections++; |
| 1240 setFirstCorrection(parameterId); | 1241 setFirstCorrection(parameterId); |
| 1241 } | 1242 } |
| 1242 parameterId++; | 1243 parameterId++; /* 43 */ |
| 1243 /* uint16_t timeoutSurfacemode; | 1244 /* uint16_t timeoutSurfacemode; |
| 1244 */ | 1245 */ |
| 1245 if( (Settings.timeoutSurfacemode != 20) && // Quick Sleep Option | 1246 if( (Settings.timeoutSurfacemode != 20) && // Quick Sleep Option |
| 1246 (Settings.timeoutSurfacemode != 120)) | 1247 (Settings.timeoutSurfacemode != 120)) |
| 1247 { | 1248 { |
| 1248 Settings.timeoutSurfacemode = 120; | 1249 Settings.timeoutSurfacemode = 120; |
| 1249 corrections++; | 1250 corrections++; |
| 1250 setFirstCorrection(parameterId); | 1251 setFirstCorrection(parameterId); |
| 1251 } | 1252 } |
| 1252 parameterId++; | 1253 parameterId++; /* 44 */ |
| 1253 /* uint8_t timeoutMenuSurface; | 1254 /* uint8_t timeoutMenuSurface; |
| 1254 */ | 1255 */ |
| 1255 if(Settings.timeoutMenuSurface != 120) | 1256 if(Settings.timeoutMenuSurface != 120) |
| 1256 { | 1257 { |
| 1257 Settings.timeoutMenuSurface = 120; | 1258 Settings.timeoutMenuSurface = 120; |
| 1258 corrections++; | 1259 corrections++; |
| 1259 setFirstCorrection(parameterId); | 1260 setFirstCorrection(parameterId); |
| 1260 } | 1261 } |
| 1261 parameterId++; | 1262 parameterId++; /* 45 */ |
| 1262 /* uint8_t timeoutMenuDive; | 1263 /* uint8_t timeoutMenuDive; |
| 1263 */ | 1264 */ |
| 1264 if(Settings.timeoutMenuDive != 120) | 1265 if(Settings.timeoutMenuDive != 120) |
| 1265 { | 1266 { |
| 1266 Settings.timeoutMenuDive = 120; | 1267 Settings.timeoutMenuDive = 120; |
| 1267 corrections++; | 1268 corrections++; |
| 1268 setFirstCorrection(parameterId); | 1269 setFirstCorrection(parameterId); |
| 1269 } | 1270 } |
| 1270 parameterId++; | 1271 parameterId++; /* 46 */ |
| 1271 /* uint8_t timeoutMenuEdit; | 1272 /* uint8_t timeoutMenuEdit; |
| 1272 */ | 1273 */ |
| 1273 if(Settings.timeoutMenuEdit != 120) | 1274 if(Settings.timeoutMenuEdit != 120) |
| 1274 { | 1275 { |
| 1275 Settings.timeoutMenuEdit = 120; | 1276 Settings.timeoutMenuEdit = 120; |
| 1276 corrections++; | 1277 corrections++; |
| 1277 setFirstCorrection(parameterId); | 1278 setFirstCorrection(parameterId); |
| 1278 } | 1279 } |
| 1279 parameterId++; | 1280 parameterId++; /* 47 */ |
| 1280 /* uint8_t timeoutInfo; | 1281 /* uint8_t timeoutInfo; |
| 1281 */ | 1282 */ |
| 1282 if(Settings.timeoutInfo != 120) | 1283 if(Settings.timeoutInfo != 120) |
| 1283 { | 1284 { |
| 1284 Settings.timeoutInfo = 120; | 1285 Settings.timeoutInfo = 120; |
| 1285 corrections++; | 1286 corrections++; |
| 1286 setFirstCorrection(parameterId); | 1287 setFirstCorrection(parameterId); |
| 1287 } | 1288 } |
| 1288 parameterId++; | 1289 parameterId++; /* 48 */ |
| 1289 /* uint8_t timeoutInfoCompass; | 1290 /* uint8_t timeoutInfoCompass; |
| 1290 */ | 1291 */ |
| 1291 if(Settings.timeoutInfoCompass != 60) | 1292 if(Settings.timeoutInfoCompass != 60) |
| 1292 { | 1293 { |
| 1293 Settings.timeoutInfoCompass = 60; | 1294 Settings.timeoutInfoCompass = 60; |
| 1294 corrections++; | 1295 corrections++; |
| 1295 setFirstCorrection(parameterId); | 1296 setFirstCorrection(parameterId); |
| 1296 } | 1297 } |
| 1297 parameterId++; | 1298 parameterId++; /* 49 */ |
| 1298 /* uint8_t design; | 1299 /* uint8_t design; |
| 1299 */ | 1300 */ |
| 1300 if(Settings.design != 7) | 1301 if(Settings.design != 7) |
| 1301 { | 1302 { |
| 1302 Settings.design = 7; | 1303 Settings.design = 7; |
| 1303 corrections++; | 1304 corrections++; |
| 1304 setFirstCorrection(parameterId); | 1305 setFirstCorrection(parameterId); |
| 1305 } | 1306 } |
| 1306 parameterId++; | 1307 parameterId++; /* 50 */ |
| 1307 /* uint16_t timeoutDiveReachedZeroDepth; | 1308 /* uint16_t timeoutDiveReachedZeroDepth; |
| 1308 */ | 1309 */ |
| 1309 if(Settings.timeoutDiveReachedZeroDepth != 300) | 1310 if(Settings.timeoutDiveReachedZeroDepth != 300) |
| 1310 { | 1311 { |
| 1311 Settings.timeoutDiveReachedZeroDepth = 300; | 1312 Settings.timeoutDiveReachedZeroDepth = 300; |
| 1312 corrections++; | 1313 corrections++; |
| 1313 setFirstCorrection(parameterId); | 1314 setFirstCorrection(parameterId); |
| 1314 } | 1315 } |
| 1315 parameterId++; | 1316 parameterId++; /* 51 */ |
| 1316 /* uint16_t divetimeToCreateLogbook; | 1317 /* uint16_t divetimeToCreateLogbook; |
| 1317 */ | 1318 */ |
| 1318 if(Settings.divetimeToCreateLogbook != 60) | 1319 if(Settings.divetimeToCreateLogbook != 60) |
| 1319 { | 1320 { |
| 1320 Settings.divetimeToCreateLogbook = 60; | 1321 Settings.divetimeToCreateLogbook = 60; |
| 1321 corrections++; | 1322 corrections++; |
| 1322 setFirstCorrection(parameterId); | 1323 setFirstCorrection(parameterId); |
| 1323 } | 1324 } |
| 1324 parameterId++; | 1325 parameterId++; /* 52 */ |
| 1325 if(Settings.slowExitTime > 9) | 1326 if(Settings.slowExitTime > 9) |
| 1326 { | 1327 { |
| 1327 Settings.divetimeToCreateLogbook = 0; | 1328 Settings.divetimeToCreateLogbook = 0; |
| 1328 corrections++; | 1329 corrections++; |
| 1329 setFirstCorrection(parameterId); | 1330 setFirstCorrection(parameterId); |
| 1330 } | 1331 } |
| 1331 parameterId++; | 1332 parameterId++; /* 53 */ |
| 1332 | 1333 |
| 1333 if(Settings.warningBuzzer > 1) | 1334 if(Settings.warningBuzzer > 1) |
| 1334 { | 1335 { |
| 1335 Settings.warningBuzzer = 0; | 1336 Settings.warningBuzzer = 0; |
| 1336 corrections++; | 1337 corrections++; |
| 1337 setFirstCorrection(parameterId); | 1338 setFirstCorrection(parameterId); |
| 1338 } | 1339 } |
| 1339 parameterId++; | 1340 parameterId++; /* 54 */ |
| 1340 | 1341 |
| 1341 | 1342 |
| 1342 /* uint8_t serialHigh; | 1343 /* uint8_t serialHigh; |
| 1343 */ | 1344 */ |
| 1344 | 1345 |
| 1387 { | 1388 { |
| 1388 Settings.ButtonResponsiveness[3] = MAX_BUTTONRESPONSIVENESS_GUI; | 1389 Settings.ButtonResponsiveness[3] = MAX_BUTTONRESPONSIVENESS_GUI; |
| 1389 corrections++; | 1390 corrections++; |
| 1390 setFirstCorrection(parameterId); | 1391 setFirstCorrection(parameterId); |
| 1391 } | 1392 } |
| 1392 parameterId++; | 1393 parameterId++; /* 55 */ |
| 1393 // flex values 0, 1, 2 | 1394 // flex values 0, 1, 2 |
| 1394 for(int i=0; i<3;i++) | 1395 for(int i=0; i<3;i++) |
| 1395 { | 1396 { |
| 1396 if(Settings.ButtonResponsiveness[i] < MIN_BUTTONRESPONSIVENESS) // 50-10 //Fix for broken buttons. :) | 1397 if(Settings.ButtonResponsiveness[i] < MIN_BUTTONRESPONSIVENESS) // 50-10 //Fix for broken buttons. :) |
| 1397 { | 1398 { |
| 1405 Settings.ButtonResponsiveness[i] = MAX_BUTTONRESPONSIVENESS; | 1406 Settings.ButtonResponsiveness[i] = MAX_BUTTONRESPONSIVENESS; |
| 1406 corrections++; | 1407 corrections++; |
| 1407 setFirstCorrection(parameterId); | 1408 setFirstCorrection(parameterId); |
| 1408 } | 1409 } |
| 1409 } | 1410 } |
| 1410 parameterId++; | 1411 parameterId++; /* 56 */ |
| 1411 /* uint8_t buttonBalance[3]; | 1412 /* uint8_t buttonBalance[3]; |
| 1412 */ | 1413 */ |
| 1413 for(int i=0; i<3;i++) | 1414 for(int i=0; i<3;i++) |
| 1414 { | 1415 { |
| 1415 if(Settings.buttonBalance[i] < 2) // 2 = -10 | 1416 if(Settings.buttonBalance[i] < 2) // 2 = -10 |
| 1424 Settings.buttonBalance[i] = 5; | 1425 Settings.buttonBalance[i] = 5; |
| 1425 corrections++; | 1426 corrections++; |
| 1426 setFirstCorrection(parameterId); | 1427 setFirstCorrection(parameterId); |
| 1427 } | 1428 } |
| 1428 } | 1429 } |
| 1429 parameterId++; | 1430 parameterId++; /* 57 */ |
| 1430 /* uint8_t nonMetricalSystem; | 1431 /* uint8_t nonMetricalSystem; |
| 1431 */ | 1432 */ |
| 1432 if(Settings.nonMetricalSystem > 1) | 1433 if(Settings.nonMetricalSystem > 1) |
| 1433 { | 1434 { |
| 1434 Settings.nonMetricalSystem = 1; | 1435 Settings.nonMetricalSystem = 1; |
| 1435 corrections++; | 1436 corrections++; |
| 1436 setFirstCorrection(parameterId); | 1437 setFirstCorrection(parameterId); |
| 1437 } | 1438 } |
| 1438 parameterId++; | 1439 parameterId++; /* 58 */ |
| 1439 /* uint8_t fallbackToFixedSetpoint; | 1440 /* uint8_t fallbackToFixedSetpoint; |
| 1440 */ | 1441 */ |
| 1441 if(Settings.fallbackToFixedSetpoint > 1) | 1442 if(Settings.fallbackToFixedSetpoint > 1) |
| 1442 { | 1443 { |
| 1443 Settings.fallbackToFixedSetpoint = 1; | 1444 Settings.fallbackToFixedSetpoint = 1; |
| 1444 corrections++; | 1445 corrections++; |
| 1445 setFirstCorrection(parameterId); | 1446 setFirstCorrection(parameterId); |
| 1446 } | 1447 } |
| 1447 parameterId++; | 1448 parameterId++; /* 59 */ |
| 1448 /* uint8_t bluetoothActive; | 1449 /* uint8_t bluetoothActive; |
| 1449 */ | 1450 */ |
| 1450 if(Settings.bluetoothActive > 1) | 1451 if(Settings.bluetoothActive > 1) |
| 1451 { | 1452 { |
| 1452 Settings.bluetoothActive = 1; | 1453 Settings.bluetoothActive = 1; |
| 1453 corrections++; | 1454 corrections++; |
| 1454 setFirstCorrection(parameterId); | 1455 setFirstCorrection(parameterId); |
| 1455 } | 1456 } |
| 1456 parameterId++; | 1457 parameterId++; /* 60 */ |
| 1457 /* uint8_t safetystopDepth; | 1458 /* uint8_t safetystopDepth; |
| 1458 */ | 1459 */ |
| 1459 if(Settings.safetystopDepth > 6) | 1460 if(Settings.safetystopDepth > 6) |
| 1460 { | 1461 { |
| 1461 Settings.safetystopDepth = 6; | 1462 Settings.safetystopDepth = 6; |
| 1462 corrections++; | 1463 corrections++; |
| 1463 setFirstCorrection(parameterId); | 1464 setFirstCorrection(parameterId); |
| 1464 } | 1465 } |
| 1465 parameterId++; | 1466 parameterId++; /* 61 */ |
| 1466 if(Settings.safetystopDepth < 3) | 1467 if(Settings.safetystopDepth < 3) |
| 1467 { | 1468 { |
| 1468 Settings.safetystopDepth = 3; | 1469 Settings.safetystopDepth = 3; |
| 1469 corrections++; | 1470 corrections++; |
| 1470 setFirstCorrection(parameterId); | 1471 setFirstCorrection(parameterId); |
| 1471 } | 1472 } |
| 1472 parameterId++; | 1473 parameterId++; /* 62 */ |
| 1473 /* uint32_t updateSettingsAllowedFromHeader; | 1474 /* uint32_t updateSettingsAllowedFromHeader; |
| 1474 */ | 1475 */ |
| 1475 | 1476 |
| 1476 /* uint8_t ppo2sensors_deactivated; | 1477 /* uint8_t ppo2sensors_deactivated; |
| 1477 */ | 1478 */ |
| 1479 { | 1480 { |
| 1480 Settings.ppo2sensors_deactivated = 0; | 1481 Settings.ppo2sensors_deactivated = 0; |
| 1481 corrections++; | 1482 corrections++; |
| 1482 setFirstCorrection(parameterId); | 1483 setFirstCorrection(parameterId); |
| 1483 } | 1484 } |
| 1484 parameterId++; | 1485 parameterId++; /* 63 */ |
| 1485 /* uint8_t tX_colorscheme; | 1486 /* uint8_t tX_colorscheme; |
| 1486 */ | 1487 */ |
| 1487 if(Settings.tX_colorscheme > 3) | 1488 if(Settings.tX_colorscheme > 3) |
| 1488 { | 1489 { |
| 1489 Settings.tX_colorscheme = 0; | 1490 Settings.tX_colorscheme = 0; |
| 1490 corrections++; | 1491 corrections++; |
| 1491 setFirstCorrection(parameterId); | 1492 setFirstCorrection(parameterId); |
| 1492 } | 1493 } |
| 1493 parameterId++; | 1494 parameterId++; /* 64 */ |
| 1494 /* uint8_t tX_userselectedLeftLowerCornerPrimary; | 1495 /* uint8_t tX_userselectedLeftLowerCornerPrimary; |
| 1495 */ | 1496 */ |
| 1496 if(Settings.tX_userselectedLeftLowerCornerPrimary >= LLC_END) | 1497 if(Settings.tX_userselectedLeftLowerCornerPrimary >= LLC_END) |
| 1497 { | 1498 { |
| 1498 Settings.tX_userselectedLeftLowerCornerPrimary = LLC_Temperature; | 1499 Settings.tX_userselectedLeftLowerCornerPrimary = LLC_Temperature; |
| 1499 corrections++; | 1500 corrections++; |
| 1500 setFirstCorrection(parameterId); | 1501 setFirstCorrection(parameterId); |
| 1501 } | 1502 } |
| 1502 parameterId++; | 1503 parameterId++; /* 65 */ |
| 1503 /* uint8_t tX_userselectedLeftLowerCornerTimeout; | 1504 /* uint8_t tX_userselectedLeftLowerCornerTimeout; |
| 1504 */ | 1505 */ |
| 1505 if(Settings.tX_userselectedLeftLowerCornerTimeout > 60) | 1506 if(Settings.tX_userselectedLeftLowerCornerTimeout > 60) |
| 1506 { | 1507 { |
| 1507 Settings.tX_userselectedLeftLowerCornerTimeout = 0; | 1508 Settings.tX_userselectedLeftLowerCornerTimeout = 0; |
| 1508 corrections++; | 1509 corrections++; |
| 1509 setFirstCorrection(parameterId); | 1510 setFirstCorrection(parameterId); |
| 1510 } | 1511 } |
| 1511 parameterId++; | 1512 parameterId++; /* 66 */ |
| 1512 /* uint8_t tX_customViewPrimary; | 1513 /* uint8_t tX_customViewPrimary; |
| 1513 */ | 1514 */ |
| 1514 if(Settings.tX_customViewPrimary >= CVIEW_END) | 1515 if(Settings.tX_customViewPrimary >= CVIEW_END) |
| 1515 { | 1516 { |
| 1516 Settings.tX_customViewPrimary = 1; | 1517 Settings.tX_customViewPrimary = 1; |
| 1517 corrections++; | 1518 corrections++; |
| 1518 setFirstCorrection(parameterId); | 1519 setFirstCorrection(parameterId); |
| 1519 } | 1520 } |
| 1520 parameterId++; | 1521 parameterId++; /* 67 */ |
| 1521 /* uint8_t tX_customViewTimeout; | 1522 /* uint8_t tX_customViewTimeout; |
| 1522 */ | 1523 */ |
| 1523 if(Settings.tX_customViewTimeout > 60) | 1524 if(Settings.tX_customViewTimeout > 60) |
| 1524 { | 1525 { |
| 1525 Settings.tX_customViewTimeout = 0; | 1526 Settings.tX_customViewTimeout = 0; |
| 1526 corrections++; | 1527 corrections++; |
| 1527 setFirstCorrection(parameterId); | 1528 setFirstCorrection(parameterId); |
| 1528 } | 1529 } |
| 1529 parameterId++; | 1530 parameterId++; /* 68 */ |
| 1530 /* uint8_t timeoutEnterButtonSelectDive; | 1531 /* uint8_t timeoutEnterButtonSelectDive; |
| 1531 */ | 1532 */ |
| 1532 if(Settings.timeoutEnterButtonSelectDive != 10) | 1533 if(Settings.timeoutEnterButtonSelectDive != 10) |
| 1533 { | 1534 { |
| 1534 Settings.timeoutEnterButtonSelectDive = 10; | 1535 Settings.timeoutEnterButtonSelectDive = 10; |
| 1535 corrections++; | 1536 corrections++; |
| 1536 setFirstCorrection(parameterId); | 1537 setFirstCorrection(parameterId); |
| 1537 } | 1538 } |
| 1538 parameterId++; | 1539 parameterId++; /* 69 */ |
| 1539 /* uint8_t logbookOffset; | 1540 /* uint8_t logbookOffset; |
| 1540 */ | 1541 */ |
| 1541 if(Settings.logbookOffset > 9000) | 1542 if(Settings.logbookOffset > 9000) |
| 1542 { | 1543 { |
| 1543 Settings.logbookOffset = 0; | 1544 Settings.logbookOffset = 0; |
| 1544 corrections++; | 1545 corrections++; |
| 1545 setFirstCorrection(parameterId); | 1546 setFirstCorrection(parameterId); |
| 1546 } | 1547 } |
| 1547 parameterId++; | 1548 parameterId++; /* 70 */ |
| 1548 /* uint8_t alwaysShowPPO2; | 1549 /* uint8_t alwaysShowPPO2; |
| 1549 */ | 1550 */ |
| 1550 if(Settings.alwaysShowPPO2 > 1) | 1551 if(Settings.alwaysShowPPO2 > 1) |
| 1551 { | 1552 { |
| 1552 Settings.alwaysShowPPO2 = 0; | 1553 Settings.alwaysShowPPO2 = 0; |
| 1553 corrections++; | 1554 corrections++; |
| 1554 setFirstCorrection(parameterId); | 1555 setFirstCorrection(parameterId); |
| 1555 } | 1556 } |
| 1556 parameterId++; | 1557 parameterId++; /* 71 */ |
| 1557 /* uint8_t extraDisplay; | 1558 /* uint8_t extraDisplay; |
| 1558 */ | 1559 */ |
| 1559 if(Settings.extraDisplay >= EXTRADISPLAY_END) | 1560 if(Settings.extraDisplay >= EXTRADISPLAY_END) |
| 1560 { | 1561 { |
| 1561 Settings.extraDisplay = EXTRADISPLAY_BIGFONT; | 1562 Settings.extraDisplay = EXTRADISPLAY_BIGFONT; |
| 1562 corrections++; | 1563 corrections++; |
| 1563 setFirstCorrection(parameterId); | 1564 setFirstCorrection(parameterId); |
| 1564 } | 1565 } |
| 1565 parameterId++; | 1566 parameterId++; /* 72 */ |
| 1566 /* int8_t offsetPressure_mbar; | 1567 /* int8_t offsetPressure_mbar; |
| 1567 */ | 1568 */ |
| 1568 if((Settings.offsetPressure_mbar > PRESSURE_OFFSET_LIMIT_MBAR) || | 1569 if((Settings.offsetPressure_mbar > PRESSURE_OFFSET_LIMIT_MBAR) || |
| 1569 (Settings.offsetPressure_mbar < -1 * PRESSURE_OFFSET_LIMIT_MBAR)) | 1570 (Settings.offsetPressure_mbar < -1 * PRESSURE_OFFSET_LIMIT_MBAR)) |
| 1570 { | 1571 { |
| 1571 Settings.offsetPressure_mbar = 0; | 1572 Settings.offsetPressure_mbar = 0; |
| 1572 corrections++; | 1573 corrections++; |
| 1573 setFirstCorrection(parameterId); | 1574 setFirstCorrection(parameterId); |
| 1574 } | 1575 } |
| 1575 parameterId++; | 1576 parameterId++; /* 73 */ |
| 1576 /* int8_t offsetTemperature_centigrad; | 1577 /* int8_t offsetTemperature_centigrad; |
| 1577 */ | 1578 */ |
| 1578 if((Settings.offsetTemperature_centigrad > 20) || | 1579 if((Settings.offsetTemperature_centigrad > 20) || |
| 1579 (Settings.offsetTemperature_centigrad < -20)) | 1580 (Settings.offsetTemperature_centigrad < -20)) |
| 1580 { | 1581 { |
| 1581 Settings.offsetTemperature_centigrad = 0; | 1582 Settings.offsetTemperature_centigrad = 0; |
| 1582 corrections++; | 1583 corrections++; |
| 1583 setFirstCorrection(parameterId); | 1584 setFirstCorrection(parameterId); |
| 1584 } | 1585 } |
| 1585 parameterId++; | 1586 parameterId++; /* 74 */ |
| 1586 /* uint8_t gasConsumption_travel_l_min; | 1587 /* uint8_t gasConsumption_travel_l_min; |
| 1587 */ | 1588 */ |
| 1588 if((Settings.gasConsumption_travel_l_min < 5) || | 1589 if((Settings.gasConsumption_travel_l_min < 5) || |
| 1589 (Settings.gasConsumption_travel_l_min > 50)) | 1590 (Settings.gasConsumption_travel_l_min > 50)) |
| 1590 { | 1591 { |
| 1591 Settings.gasConsumption_travel_l_min = 20; | 1592 Settings.gasConsumption_travel_l_min = 20; |
| 1592 corrections++; | 1593 corrections++; |
| 1593 setFirstCorrection(parameterId); | 1594 setFirstCorrection(parameterId); |
| 1594 } | 1595 } |
| 1595 parameterId++; | 1596 parameterId++; /* 75 */ |
| 1596 /* uint8_t gasConsumption_bottom_l_min; | 1597 /* uint8_t gasConsumption_bottom_l_min; |
| 1597 */ | 1598 */ |
| 1598 if((Settings.gasConsumption_bottom_l_min < 5) || | 1599 if((Settings.gasConsumption_bottom_l_min < 5) || |
| 1599 (Settings.gasConsumption_bottom_l_min > 50)) | 1600 (Settings.gasConsumption_bottom_l_min > 50)) |
| 1600 { | 1601 { |
| 1601 Settings.gasConsumption_bottom_l_min = 20; | 1602 Settings.gasConsumption_bottom_l_min = 20; |
| 1602 corrections++; | 1603 corrections++; |
| 1603 setFirstCorrection(parameterId); | 1604 setFirstCorrection(parameterId); |
| 1604 } | 1605 } |
| 1605 parameterId++; | 1606 parameterId++; /* 76 */ |
| 1606 /* uint8_t gasConsumption_deco_l_min; | 1607 /* uint8_t gasConsumption_deco_l_min; |
| 1607 */ | 1608 */ |
| 1608 if((Settings.gasConsumption_deco_l_min < 5) || | 1609 if((Settings.gasConsumption_deco_l_min < 5) || |
| 1609 (Settings.gasConsumption_deco_l_min > 50)) | 1610 (Settings.gasConsumption_deco_l_min > 50)) |
| 1610 { | 1611 { |
| 1611 Settings.gasConsumption_deco_l_min = 20; | 1612 Settings.gasConsumption_deco_l_min = 20; |
| 1612 corrections++; | 1613 corrections++; |
| 1613 setFirstCorrection(parameterId); | 1614 setFirstCorrection(parameterId); |
| 1614 } | 1615 } |
| 1615 parameterId++; | 1616 parameterId++; /* 77 */ |
| 1616 /* uint8_t showDebugInfo; | 1617 /* uint8_t showDebugInfo; |
| 1617 */ | 1618 */ |
| 1618 #ifdef BOOT16 | 1619 #ifdef BOOT16 |
| 1619 Settings.showDebugInfo = 0; | 1620 Settings.showDebugInfo = 0; |
| 1620 #else | 1621 #else |
| 1640 { | 1641 { |
| 1641 Settings.display_toogle_desc = SettingsStandard.display_toogle_desc; | 1642 Settings.display_toogle_desc = SettingsStandard.display_toogle_desc; |
| 1642 corrections++; | 1643 corrections++; |
| 1643 setFirstCorrection(parameterId); | 1644 setFirstCorrection(parameterId); |
| 1644 } | 1645 } |
| 1645 parameterId++; | 1646 parameterId++; /* 78 */ |
| 1646 /* uint8_t debugModeOnStart; | 1647 /* uint8_t debugModeOnStart; |
| 1647 */ | 1648 */ |
| 1648 if(Settings.debugModeOnStart > 1) | 1649 if(Settings.debugModeOnStart > 1) |
| 1649 { | 1650 { |
| 1650 Settings.debugModeOnStart = 0; | 1651 Settings.debugModeOnStart = 0; |
| 1651 corrections++; | 1652 corrections++; |
| 1652 setFirstCorrection(parameterId); | 1653 setFirstCorrection(parameterId); |
| 1653 } | 1654 } |
| 1654 parameterId++; | 1655 parameterId++; /* 79 */ |
| 1655 | 1656 |
| 1656 /* uint8_t IAmStolenPleaseKillMe; | 1657 /* uint8_t IAmStolenPleaseKillMe; |
| 1657 */ | 1658 */ |
| 1658 | 1659 |
| 1659 if(hardwareDataGetPointer()->primarySerial == 90) | 1660 if(hardwareDataGetPointer()->primarySerial == 90) |
| 1669 Settings.compassBearing = 0; | 1670 Settings.compassBearing = 0; |
| 1670 corrections++; | 1671 corrections++; |
| 1671 setFirstCorrection(parameterId); | 1672 setFirstCorrection(parameterId); |
| 1672 } | 1673 } |
| 1673 | 1674 |
| 1674 parameterId++; | 1675 parameterId++; /* 80 */ |
| 1675 /* uint8_t lastKnownBatteryPercentage; | 1676 /* uint8_t lastKnownBatteryPercentage; |
| 1676 */ | 1677 */ |
| 1677 if(Settings.lastKnownBatteryPercentage > 100) | 1678 if(Settings.lastKnownBatteryPercentage > 100) |
| 1678 { | 1679 { |
| 1679 Settings.lastKnownBatteryPercentage = 100; | 1680 Settings.lastKnownBatteryPercentage = 100; |
| 1680 corrections++; | 1681 corrections++; |
| 1681 setFirstCorrection(parameterId); | 1682 setFirstCorrection(parameterId); |
| 1682 } | 1683 } |
| 1683 parameterId++; | 1684 parameterId++; /* 81 */ |
| 1684 /* uint8_t VPM_model | 1685 /* uint8_t VPM_model |
| 1685 */ | 1686 */ |
| 1686 if((Settings.VPM_model != VPM_FROM_FORTRAN) && (Settings.VPM_model != VPM_BACHELORWORK)) | 1687 if((Settings.VPM_model != VPM_FROM_FORTRAN) && (Settings.VPM_model != VPM_BACHELORWORK)) |
| 1687 { | 1688 { |
| 1688 Settings.VPM_model = VPM_FROM_FORTRAN; | 1689 Settings.VPM_model = VPM_FROM_FORTRAN; |
| 1689 corrections++; | 1690 corrections++; |
| 1690 setFirstCorrection(parameterId); | 1691 setFirstCorrection(parameterId); |
| 1691 } | 1692 } |
| 1692 parameterId++; | 1693 parameterId++; /* 82 */ |
| 1693 /* uint8_t Buehlmann_model | 1694 /* uint8_t Buehlmann_model |
| 1694 */ | 1695 */ |
| 1695 if((Settings.GF_model != BUEHLMANN_OSTC4) && (Settings.GF_model != BUEHLMANN_hwOS)) | 1696 if((Settings.GF_model != BUEHLMANN_OSTC4) && (Settings.GF_model != BUEHLMANN_hwOS)) |
| 1696 { | 1697 { |
| 1697 Settings.GF_model = BUEHLMANN_OSTC4; | 1698 Settings.GF_model = BUEHLMANN_OSTC4; |
| 1698 corrections++; | 1699 corrections++; |
| 1699 setFirstCorrection(parameterId); | 1700 setFirstCorrection(parameterId); |
| 1700 } | 1701 } |
| 1701 parameterId++; | 1702 parameterId++; /* 83 */ |
| 1702 if(Settings.FlipDisplay > 1) { /* only boolean values allowed */ | 1703 if(Settings.FlipDisplay > 1) /* only boolean values allowed */ |
| 1704 { | |
| 1703 setFlipDisplay(1); | 1705 setFlipDisplay(1); |
| 1704 corrections++; | 1706 corrections++; |
| 1705 setFirstCorrection(parameterId); | 1707 setFirstCorrection(parameterId); |
| 1706 } | 1708 } |
| 1707 parameterId++; | 1709 parameterId++; /* 84 */ |
| 1708 #ifdef ENABLE_MOTION_CONTROL | 1710 #ifdef ENABLE_MOTION_CONTROL |
| 1709 if(Settings.MotionDetection >= MOTION_DETECT_END) | 1711 if(Settings.MotionDetection >= MOTION_DETECT_END) |
| 1710 { | 1712 { |
| 1711 Settings.MotionDetection = MOTION_DETECT_OFF; | 1713 Settings.MotionDetection = MOTION_DETECT_OFF; |
| 1712 corrections++; | 1714 corrections++; |
| 1717 Settings.viewPortMode = 0; | 1719 Settings.viewPortMode = 0; |
| 1718 Settings.viewRoll = 0.0; | 1720 Settings.viewRoll = 0.0; |
| 1719 Settings.viewPitch = 0.0; | 1721 Settings.viewPitch = 0.0; |
| 1720 Settings.viewYaw = 0.0; | 1722 Settings.viewYaw = 0.0; |
| 1721 #endif | 1723 #endif |
| 1722 parameterId++; | 1724 parameterId++; /* 85 */ |
| 1723 if(Settings.compassInertia > MAX_COMPASS_COMP) | 1725 if(Settings.compassInertia > MAX_COMPASS_COMP) |
| 1724 { | 1726 { |
| 1725 Settings.compassInertia = 0; | 1727 Settings.compassInertia = 0; |
| 1726 corrections++; | 1728 corrections++; |
| 1727 setFirstCorrection(parameterId); | 1729 setFirstCorrection(parameterId); |
| 1728 } | 1730 } |
| 1729 parameterId++; | 1731 parameterId++; /* 86 */ |
| 1730 if(Settings.tX_customViewPrimaryBF > CVIEW_T3_END) | 1732 if(Settings.tX_customViewPrimaryBF > CVIEW_T3_END) |
| 1731 { | 1733 { |
| 1732 Settings.tX_customViewPrimaryBF = CVIEW_T3_Decostop; | 1734 Settings.tX_customViewPrimaryBF = CVIEW_T3_Decostop; |
| 1733 corrections++; | 1735 corrections++; |
| 1734 setFirstCorrection(parameterId); | 1736 setFirstCorrection(parameterId); |
| 1735 } | 1737 } |
| 1736 parameterId++; | 1738 parameterId++; /* 87 */ |
| 1737 if(Settings.viewPortMode > MAX_VIEWPORT_MODE) | 1739 if(Settings.viewPortMode > MAX_VIEWPORT_MODE) |
| 1738 { | 1740 { |
| 1739 Settings.viewPortMode = 0; | 1741 Settings.viewPortMode = 0; |
| 1740 corrections++; | 1742 corrections++; |
| 1741 setFirstCorrection(parameterId); | 1743 setFirstCorrection(parameterId); |
| 1742 } | 1744 } |
| 1743 parameterId++; | 1745 parameterId++; /* 88 */ |
| 1744 if(Settings.ppo2sensors_source >= O2_SENSOR_SOURCE_MAX) | 1746 if(Settings.ppo2sensors_source >= O2_SENSOR_SOURCE_MAX) |
| 1745 { | 1747 { |
| 1746 Settings.ppo2sensors_source = O2_SENSOR_SOURCE_OPTIC; | 1748 Settings.ppo2sensors_source = O2_SENSOR_SOURCE_OPTIC; |
| 1747 Settings.ppo2sensors_calibCoeff[0] = 0.0; | 1749 Settings.ppo2sensors_calibCoeff[0] = 0.0; |
| 1748 Settings.ppo2sensors_calibCoeff[1] = 0.0; | 1750 Settings.ppo2sensors_calibCoeff[1] = 0.0; |
| 1749 Settings.ppo2sensors_calibCoeff[2] = 0.0; | 1751 Settings.ppo2sensors_calibCoeff[2] = 0.0; |
| 1750 corrections++; | 1752 corrections++; |
| 1751 setFirstCorrection(parameterId); | 1753 setFirstCorrection(parameterId); |
| 1752 } | 1754 } |
| 1753 parameterId++; | 1755 parameterId++; /* 89 */ |
| 1754 if(Settings.amPMTime > 1) /* only boolean values allowed */ | 1756 if(Settings.amPMTime > 1) /* only boolean values allowed */ |
| 1755 { | 1757 { |
| 1756 Settings.amPMTime = 0; | 1758 Settings.amPMTime = 0; |
| 1757 corrections++; | 1759 corrections++; |
| 1758 setFirstCorrection(parameterId); | 1760 setFirstCorrection(parameterId); |
| 1759 } | 1761 } |
| 1760 parameterId++; | 1762 parameterId++; /* 90 */ |
| 1761 if(Settings.autoSetpoint > 1) /* only boolean values allowed */ | 1763 if(Settings.autoSetpoint > 1) /* only boolean values allowed */ |
| 1762 { | 1764 { |
| 1763 Settings.autoSetpoint = 0; | 1765 Settings.autoSetpoint = 0; |
| 1764 corrections++; | 1766 corrections++; |
| 1765 setFirstCorrection(parameterId); | 1767 setFirstCorrection(parameterId); |
| 1766 } | 1768 } |
| 1767 parameterId++; | 1769 parameterId++; /* 91 */ |
| 1768 if(Settings.scubberActiveId > 1) | 1770 if(Settings.scubberActiveId > 3) /* scrubber active is used as bitfield => two timer => 2 bits in use */ |
| 1769 { | 1771 { |
| 1770 Settings.scubberActiveId = 0; | 1772 Settings.scubberActiveId = 0; |
| 1771 corrections++; | 1773 corrections++; |
| 1772 setFirstCorrection(parameterId); | 1774 setFirstCorrection(parameterId); |
| 1773 } | 1775 } |
| 1774 parameterId++; | 1776 parameterId++; /* 92 */ |
| 1775 if((Settings.scrubberData[0].TimerMax > MAX_SCRUBBER_TIME) || Settings.scrubberData[0].TimerCur < MIN_SCRUBBER_TIME || Settings.scrubberData[0].TimerCur > (int16_t)MAX_SCRUBBER_TIME) | 1777 if((Settings.scrubberData[0].TimerMax > MAX_SCRUBBER_TIME) || Settings.scrubberData[0].TimerCur < MIN_SCRUBBER_TIME || Settings.scrubberData[0].TimerCur > (int16_t)MAX_SCRUBBER_TIME) |
| 1776 { | 1778 { |
| 1777 Settings.scrubberData[0].TimerMax = 0; | 1779 Settings.scrubberData[0].TimerMax = 0; |
| 1778 Settings.scrubberData[0].TimerCur = 0; | 1780 Settings.scrubberData[0].TimerCur = 0; |
| 1779 corrections++; | 1781 corrections++; |
| 1785 Settings.scrubberData[1].TimerMax = 0; | 1787 Settings.scrubberData[1].TimerMax = 0; |
| 1786 Settings.scrubberData[1].TimerCur = 0; | 1788 Settings.scrubberData[1].TimerCur = 0; |
| 1787 corrections++; | 1789 corrections++; |
| 1788 setFirstCorrection(parameterId); | 1790 setFirstCorrection(parameterId); |
| 1789 } | 1791 } |
| 1790 parameterId++; | 1792 parameterId++; /* 94 */ |
| 1791 if(Settings.scrubTimerMode > SCRUB_TIMER_END) | 1793 if(Settings.scrubTimerMode > SCRUB_TIMER_END) |
| 1792 { | 1794 { |
| 1793 Settings.scrubTimerMode = SCRUB_TIMER_OFF; | 1795 Settings.scrubTimerMode = SCRUB_TIMER_OFF; |
| 1794 corrections++; | 1796 corrections++; |
| 1795 setFirstCorrection(parameterId); | 1797 setFirstCorrection(parameterId); |
| 1796 } | 1798 } |
| 1797 parameterId++; | 1799 parameterId++; /* 95 */ |
| 1798 if((Settings.pscr_lung_ratio > PSCR_MAX_LUNG_RATIO) || (Settings.pscr_lung_ratio < PSCR_MIN_LUNG_RATIO)) | 1800 if((Settings.pscr_lung_ratio > PSCR_MAX_LUNG_RATIO) || (Settings.pscr_lung_ratio < PSCR_MIN_LUNG_RATIO)) |
| 1799 { | 1801 { |
| 1800 Settings.pscr_lung_ratio = 10; | 1802 Settings.pscr_lung_ratio = 10; |
| 1801 corrections++; | 1803 corrections++; |
| 1802 setFirstCorrection(parameterId); | 1804 setFirstCorrection(parameterId); |
| 1803 } | 1805 } |
| 1804 parameterId++; | 1806 parameterId++; /* 96 */ |
| 1805 if(Settings.pscr_o2_drop > PSCR_MAX_O2_DROP) | 1807 if(Settings.pscr_o2_drop > PSCR_MAX_O2_DROP) |
| 1806 { | 1808 { |
| 1807 Settings.pscr_o2_drop = 4; | 1809 Settings.pscr_o2_drop = 4; |
| 1808 corrections++; | 1810 corrections++; |
| 1809 setFirstCorrection(parameterId); | 1811 setFirstCorrection(parameterId); |
| 1810 } | 1812 } |
| 1811 parameterId++; | 1813 parameterId++; /* 97 */ |
| 1812 if(Settings.co2_sensor_active > 1) | 1814 if(Settings.co2_sensor_active > 1) |
| 1813 { | 1815 { |
| 1814 Settings.co2_sensor_active = 0; | 1816 Settings.co2_sensor_active = 0; |
| 1815 corrections++; | 1817 corrections++; |
| 1816 setFirstCorrection(parameterId); | 1818 setFirstCorrection(parameterId); |
| 1817 } | 1819 } |
| 1818 parameterId++; | 1820 parameterId++; /* 98 */ |
| 1819 if(Settings.ext_uart_protocol > UART_MAX_PROTOCOL) | 1821 if(Settings.ext_uart_protocol > UART_MAX_PROTOCOL) |
| 1820 { | 1822 { |
| 1821 Settings.ext_uart_protocol = 0; | 1823 Settings.ext_uart_protocol = 0; |
| 1822 corrections++; | 1824 corrections++; |
| 1823 setFirstCorrection(parameterId); | 1825 setFirstCorrection(parameterId); |
| 1824 } | 1826 } |
| 1825 parameterId++; | 1827 parameterId++; /* 99 */ |
| 1826 if((Settings.ext_sensor_map[0] >= SENSOR_END) | 1828 if((Settings.ext_sensor_map[0] >= SENSOR_END) |
| 1827 || (Settings.ext_sensor_map[1] >= SENSOR_END) | 1829 || (Settings.ext_sensor_map[1] >= SENSOR_END) |
| 1828 || (Settings.ext_sensor_map[2] >= SENSOR_END) | 1830 || (Settings.ext_sensor_map[2] >= SENSOR_END) |
| 1829 || (Settings.ext_sensor_map[3] >= SENSOR_END) | 1831 || (Settings.ext_sensor_map[3] >= SENSOR_END) |
| 1830 || (Settings.ext_sensor_map[4] >= SENSOR_END) | 1832 || (Settings.ext_sensor_map[4] >= SENSOR_END) |
| 1841 Settings.ext_sensor_map[6] = SENSOR_NONE; | 1843 Settings.ext_sensor_map[6] = SENSOR_NONE; |
| 1842 Settings.ext_sensor_map[7] = SENSOR_NONE; | 1844 Settings.ext_sensor_map[7] = SENSOR_NONE; |
| 1843 corrections++; | 1845 corrections++; |
| 1844 setFirstCorrection(parameterId); | 1846 setFirstCorrection(parameterId); |
| 1845 } | 1847 } |
| 1846 parameterId++; | 1848 parameterId++; /* 100 */ |
| 1847 if(Settings.buttonLockActive > 1) | 1849 if(Settings.buttonLockActive > 1) |
| 1848 { | 1850 { |
| 1849 Settings.buttonLockActive = 1; | 1851 Settings.buttonLockActive = 1; |
| 1850 corrections++; | 1852 corrections++; |
| 1851 setFirstCorrection(parameterId); | 1853 setFirstCorrection(parameterId); |
| 1852 } | 1854 } |
| 1853 parameterId++; | 1855 parameterId++; /* 101 */ |
| 1854 if (Settings.compassDeclinationDeg > MAX_COMPASS_DECLINATION_DEG) { | 1856 if (Settings.compassDeclinationDeg > MAX_COMPASS_DECLINATION_DEG) { |
| 1855 Settings.compassDeclinationDeg = MAX_COMPASS_DECLINATION_DEG; | 1857 Settings.compassDeclinationDeg = MAX_COMPASS_DECLINATION_DEG; |
| 1856 | 1858 |
| 1857 corrections++; | 1859 corrections++; |
| 1858 setFirstCorrection(parameterId); | 1860 setFirstCorrection(parameterId); |
| 1860 Settings.compassDeclinationDeg = -MAX_COMPASS_DECLINATION_DEG; | 1862 Settings.compassDeclinationDeg = -MAX_COMPASS_DECLINATION_DEG; |
| 1861 | 1863 |
| 1862 corrections++; | 1864 corrections++; |
| 1863 setFirstCorrection(parameterId); | 1865 setFirstCorrection(parameterId); |
| 1864 } | 1866 } |
| 1865 parameterId++; | 1867 parameterId++; /* 102 */ |
| 1866 if (Settings.timerDurationS > 599) { | 1868 if (Settings.timerDurationS > 599) { |
| 1867 Settings.timerDurationS = 599; | 1869 Settings.timerDurationS = 599; |
| 1868 | 1870 |
| 1869 corrections++; | 1871 corrections++; |
| 1870 setFirstCorrection(parameterId); | 1872 setFirstCorrection(parameterId); |
| 1872 Settings.timerDurationS = 1; | 1874 Settings.timerDurationS = 1; |
| 1873 | 1875 |
| 1874 corrections++; | 1876 corrections++; |
| 1875 setFirstCorrection(parameterId); | 1877 setFirstCorrection(parameterId); |
| 1876 } | 1878 } |
| 1877 parameterId++; | 1879 parameterId++; /* 103 */ |
| 1878 if(Settings.cvAutofocus > 1) | 1880 if(Settings.cvAutofocus > 1) |
| 1879 { | 1881 { |
| 1880 corrections++; | 1882 corrections++; |
| 1881 Settings.cvAutofocus = 0; | 1883 Settings.cvAutofocus = 0; |
| 1882 } | 1884 } |
| 1883 parameterId++; | 1885 parameterId++; /* 104 */ |
| 1884 if((Settings.timeZone.hours > 14) | 1886 if((Settings.timeZone.hours > 14) |
| 1885 || (Settings.timeZone.hours < -12) | 1887 || (Settings.timeZone.hours < -12) |
| 1886 || (Settings.timeZone.minutes > 45)) | 1888 || (Settings.timeZone.minutes > 45)) |
| 1887 { | 1889 { |
| 1888 Settings.timeZone.hours = 0; | 1890 Settings.timeZone.hours = 0; |
| 1889 Settings.timeZone.minutes = 0; | 1891 Settings.timeZone.minutes = 0; |
| 1890 corrections++; | 1892 corrections++; |
| 1891 } | 1893 } |
| 1892 parameterId++; | 1894 parameterId++; /* 105 */ |
| 1893 if(corrections) | 1895 if(corrections) |
| 1894 { | 1896 { |
| 1895 settingsWarning = 1; | 1897 settingsWarning = 1; |
| 1896 } | 1898 } |
| 1897 else | 1899 else |
| 1972 { | 1974 { |
| 1973 SSettings *pSettings; | 1975 SSettings *pSettings; |
| 1974 const SSettings *pSettingsStandard; | 1976 const SSettings *pSettingsStandard; |
| 1975 uint16_t personalDiveCountBackup; | 1977 uint16_t personalDiveCountBackup; |
| 1976 uint8_t lastDiveLogIdBackup; | 1978 uint8_t lastDiveLogIdBackup; |
| 1979 uint32_t sampleStartBackup; | |
| 1977 pSettings = settingsGetPointer(); | 1980 pSettings = settingsGetPointer(); |
| 1978 pSettingsStandard = settingsGetPointerStandard(); | 1981 pSettingsStandard = settingsGetPointerStandard(); |
| 1979 | 1982 |
| 1980 personalDiveCountBackup = pSettings->personalDiveCount; | 1983 personalDiveCountBackup = pSettings->personalDiveCount; |
| 1981 lastDiveLogIdBackup = pSettings->lastDiveLogId; | 1984 lastDiveLogIdBackup = pSettings->lastDiveLogId; |
| 1985 sampleStartBackup = pSettings->logFlashNextSampleStartAddress; | |
| 1986 | |
| 1982 memcpy(pSettings,pSettingsStandard,sizeof(*pSettings)); | 1987 memcpy(pSettings,pSettingsStandard,sizeof(*pSettings)); |
| 1983 pSettings->personalDiveCount = personalDiveCountBackup; | 1988 pSettings->personalDiveCount = personalDiveCountBackup; |
| 1984 pSettings->lastDiveLogId = lastDiveLogIdBackup; | 1989 pSettings->lastDiveLogId = lastDiveLogIdBackup; |
| 1990 pSettings->logFlashNextSampleStartAddress = sampleStartBackup; | |
| 1985 | 1991 |
| 1986 pSettings->firmwareVersion[0] = firmware_FirmwareData.versionFirst; | 1992 pSettings->firmwareVersion[0] = firmware_FirmwareData.versionFirst; |
| 1987 pSettings->firmwareVersion[1] = firmware_FirmwareData.versionSecond; | 1993 pSettings->firmwareVersion[1] = firmware_FirmwareData.versionSecond; |
| 1988 pSettings->firmwareVersion[2] = firmware_FirmwareData.versionThird; | 1994 pSettings->firmwareVersion[2] = firmware_FirmwareData.versionThird; |
| 1989 pSettings->firmwareVersion[3] = firmware_FirmwareData.versionBeta; | 1995 pSettings->firmwareVersion[3] = firmware_FirmwareData.versionBeta; |
| 1996 | |
| 1997 memset(pSettings->customtext,0,60); | |
| 1998 sprintf(pSettings->customtext," <your name>\n <address>"); | |
| 1999 pSettings->cv_configuration &= (pSettings->cv_configuration ^= 1 << (CVIEW_Timer)); | |
| 1990 | 2000 |
| 1991 set_new_settings_missing_in_ext_flash(); | 2001 set_new_settings_missing_in_ext_flash(); |
| 1992 check_and_correct_settings(); | 2002 check_and_correct_settings(); |
| 1993 // has to be called too: createDiveSettings(); | 2003 // has to be called too: createDiveSettings(); |
| 1994 } | 2004 } |
