comparison Discovery/Src/settings.c @ 92:be35821a4974 kittz

Stable to test. button sensitiveness fix. + global_constants.
author Dmitry Romanov <kitt@bk.ru>
date Mon, 26 Nov 2018 10:50:39 +0300
parents 8b0fadd413c6
children 3d6ccfb0190b
comparison
equal deleted inserted replaced
91:8b0fadd413c6 92:be35821a4974
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 = 6,
59 .versionBeta = 2, 59 .versionBeta = 2,
60 60
61 /* 4 bytes with trailing 0 */ 61 /* 4 bytes with trailing 0 */
62 .signature = "mh", 62 .signature = "mh",
63 63
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 }; 308 };
309 309
2653 */ 2653 */
2654 void settingsHelperButtonSens_keepPercentageValues(uint32_t inputValueRaw, uint8_t *outArray4Values) 2654 void settingsHelperButtonSens_keepPercentageValues(uint32_t inputValueRaw, uint8_t *outArray4Values)
2655 { 2655 {
2656 uint32_t newSensitivity; 2656 uint32_t newSensitivity;
2657 2657
2658 if(inputValueRaw > 110) 2658 if(inputValueRaw > MAX_BUTTONRESPONSIVENESS)
2659 { 2659 {
2660 inputValueRaw = 110; 2660 inputValueRaw = MAX_BUTTONRESPONSIVENESS;
2661 } 2661 }
2662 else 2662 else
2663 if(inputValueRaw < 50) 2663 if(inputValueRaw < MIN_BUTTONRESPONSIVENESS)
2664 { 2664 {
2665 inputValueRaw = 50; 2665 inputValueRaw = MIN_BUTTONRESPONSIVENESS;
2666 } 2666 }
2667 2667
2668 // the unbalanced value 2668 // the unbalanced value
2669 outArray4Values[3] = inputValueRaw; 2669 outArray4Values[3] = inputValueRaw;
2670 2670
2688 case 5: 2688 case 5:
2689 newSensitivity += 20; 2689 newSensitivity += 20;
2690 break; 2690 break;
2691 } 2691 }
2692 2692
2693 if(newSensitivity > 110) 2693 if(newSensitivity > MAX_BUTTONRESPONSIVENESS)
2694 { 2694 {
2695 newSensitivity = 110; 2695 newSensitivity = MAX_BUTTONRESPONSIVENESS;
2696 } 2696 }
2697 outArray4Values[i] = newSensitivity; 2697 outArray4Values[i] = newSensitivity;
2698 } 2698 }
2699 } 2699 }
2700 2700