comparison Discovery/Src/settings.c @ 115:3834b6272ee5 FlipDisplay

Merge with 68181cd61f2069d061621c2cd2a6afddb7486f5e
author Ideenmodellierer
date Thu, 03 Jan 2019 19:59:36 +0100
parents 38785aa95837 22a1094545f3
children cc9c18075e00
comparison
equal deleted inserted replaced
114:79b19d56ab08 115:3834b6272ee5
53 53
54 const SFirmwareData firmware_FirmwareData __attribute__( (section(".firmware_firmware_data")) ) = 54 const SFirmwareData firmware_FirmwareData __attribute__( (section(".firmware_firmware_data")) ) =
55 { 55 {
56 .versionFirst = 1, 56 .versionFirst = 1,
57 .versionSecond = 4, 57 .versionSecond = 4,
58 .versionThird = 3, 58 .versionThird = 4,
59 .versionBeta = 0, 59 .versionBeta = 1,
60 60
61 /* 4 bytes with trailing 0 */ 61 /* 4 bytes with trailing 0 */
62 .signature = "mh", 62 .signature = "mh",
63 63
64 .release_year = 18, 64 .release_year = 18,
254 .backup_localtime_rtc_tr = 0, 254 .backup_localtime_rtc_tr = 0,
255 .backup_localtime_rtc_dr = 0, 255 .backup_localtime_rtc_dr = 0,
256 .totalDiveCounter = 0, 256 .totalDiveCounter = 0,
257 .personalDiveCount = 0, 257 .personalDiveCount = 0,
258 .showDebugInfo = 0, 258 .showDebugInfo = 0,
259 .ButtonResponsiveness[0] = 90, // new hw 170306 259 .ButtonResponsiveness[0] = DEFAULT_BUTTONRESPONSIVENESS_GUI, // new hw 170306
260 .ButtonResponsiveness[1] = 90, // new hw 170306 260 .ButtonResponsiveness[1] = DEFAULT_BUTTONRESPONSIVENESS_GUI, // new hw 170306
261 .ButtonResponsiveness[2] = 90, // new hw 170306 261 .ButtonResponsiveness[2] = DEFAULT_BUTTONRESPONSIVENESS_GUI, // new hw 170306
262 .ButtonResponsiveness[3] = 90, // new hw 170306 262 .ButtonResponsiveness[3] = DEFAULT_BUTTONRESPONSIVENESS_GUI, // new hw 170306
263 .nonMetricalSystem = 0, 263 .nonMetricalSystem = 0,
264 .fallbackToFixedSetpoint = 1, 264 .fallbackToFixedSetpoint = 1,
265 .bluetoothActive = 0, 265 .bluetoothActive = 0,
266 .safetystopDepth = 5, 266 .safetystopDepth = 5,
267 .updateSettingsAllowedFromHeader = 0xFFFF0002, 267 .updateSettingsAllowedFromHeader = 0xFFFF0002,
299 .firmwareVersion[2] = 0,//FirmwareData.firmwareVersion16to32bit.ub.third, 299 .firmwareVersion[2] = 0,//FirmwareData.firmwareVersion16to32bit.ub.third,
300 .firmwareVersion[3] = 0,//FirmwareData.firmwareVersion16to32bit.ub.betaFlag, 300 .firmwareVersion[3] = 0,//FirmwareData.firmwareVersion16to32bit.ub.betaFlag,
301 .timeoutSurfacemodeWithSensors = 600, 301 .timeoutSurfacemodeWithSensors = 600,
302 .VPM_model = 0, 302 .VPM_model = 0,
303 .GF_model = 0, 303 .GF_model = 0,
304 .FactoryButtonBase = 90, 304 .FactoryButtonBase = DEFAULT_BUTTONRESPONSIVENESS_GUI,
305 .FactoryButtonBalance[0] = 3, 305 .FactoryButtonBalance[0] = 3,
306 .FactoryButtonBalance[1] = 3, 306 .FactoryButtonBalance[1] = 3,
307 .FactoryButtonBalance[2] = 3, 307 .FactoryButtonBalance[2] = 3,
308 .FlipDisplay = 0, 308 .FlipDisplay = 0,
309 }; 309 };
1047 } 1047 }
1048 1048
1049 /* uint8_t ButtonResponsiveness[4]; 1049 /* uint8_t ButtonResponsiveness[4];
1050 */ 1050 */
1051 // Base value, index 3 1051 // Base value, index 3
1052 if(Settings.ButtonResponsiveness[3] < 70) 1052 if(Settings.ButtonResponsiveness[3] < MIN_BUTTONRESPONSIVENESS_GUI)
1053 { 1053 {
1054 Settings.ButtonResponsiveness[3] = 70; 1054 Settings.ButtonResponsiveness[3] = MIN_BUTTONRESPONSIVENESS_GUI;
1055 corrections++; 1055 corrections++;
1056 } 1056 }
1057 else 1057 else
1058 if(Settings.ButtonResponsiveness[3] > 110) 1058 if(Settings.ButtonResponsiveness[3] > MIN_BUTTONRESPONSIVENESS_GUI)
1059 { 1059 {
1060 Settings.ButtonResponsiveness[3] = 130; 1060 Settings.ButtonResponsiveness[3] = MIN_BUTTONRESPONSIVENESS;
1061 corrections++; 1061 corrections++;
1062 } 1062 }
1063 // flex values 0, 1, 2 1063 // flex values 0, 1, 2
1064 for(int i=0; i<3;i++) 1064 for(int i=0; i<3;i++)
1065 { 1065 {
1066 if(Settings.ButtonResponsiveness[i] < 60) // 70-10 1066 if(Settings.ButtonResponsiveness[i] < MIN_BUTTONRESPONSIVENESS) // 50-10 //Fix for broken buttons. :)
1067 { 1067 {
1068 Settings.ButtonResponsiveness[i] = 70; 1068 Settings.ButtonResponsiveness[i] = MIN_BUTTONRESPONSIVENESS;
1069 corrections++; 1069 corrections++;
1070 } 1070 }
1071 else 1071 else
1072 if(Settings.ButtonResponsiveness[i] > 130) // 110+20 1072 if(Settings.ButtonResponsiveness[i] > MAX_BUTTONRESPONSIVENESS) // 110+20
1073 { 1073 {
1074 Settings.ButtonResponsiveness[i] = 130; 1074 Settings.ButtonResponsiveness[i] = MAX_BUTTONRESPONSIVENESS;
1075 corrections++; 1075 corrections++;
1076 } 1076 }
1077 } 1077 }
1078 1078
1079 /* uint8_t buttonBalance[3]; 1079 /* uint8_t buttonBalance[3];
2662 */ 2662 */
2663 void settingsHelperButtonSens_keepPercentageValues(uint32_t inputValueRaw, uint8_t *outArray4Values) 2663 void settingsHelperButtonSens_keepPercentageValues(uint32_t inputValueRaw, uint8_t *outArray4Values)
2664 { 2664 {
2665 uint32_t newSensitivity; 2665 uint32_t newSensitivity;
2666 2666
2667 if(inputValueRaw > 110) 2667 if(inputValueRaw > MAX_BUTTONRESPONSIVENESS)
2668 { 2668 {
2669 inputValueRaw = 110; 2669 inputValueRaw = MAX_BUTTONRESPONSIVENESS;
2670 } 2670 }
2671 else 2671 else
2672 if(inputValueRaw < 70) 2672 if(inputValueRaw < MIN_BUTTONRESPONSIVENESS)
2673 { 2673 {
2674 inputValueRaw = 70; 2674 inputValueRaw = MIN_BUTTONRESPONSIVENESS;
2675 } 2675 }
2676 2676
2677 // the unbalanced value 2677 // the unbalanced value
2678 outArray4Values[3] = inputValueRaw; 2678 outArray4Values[3] = inputValueRaw;
2679 2679
2697 case 5: 2697 case 5:
2698 newSensitivity += 20; 2698 newSensitivity += 20;
2699 break; 2699 break;
2700 } 2700 }
2701 2701
2702 if(newSensitivity > 110) 2702 if(newSensitivity > MAX_BUTTONRESPONSIVENESS)
2703 { 2703 {
2704 newSensitivity = 110; 2704 newSensitivity = MAX_BUTTONRESPONSIVENESS;
2705 } 2705 }
2706 outArray4Values[i] = newSensitivity; 2706 outArray4Values[i] = newSensitivity;
2707 } 2707 }
2708 } 2708 }
2709 2709