comparison Discovery/Src/settings.c @ 372:75eedde05ff6 MotionDetection

merged default into MotionDetection
author Ideenmodellierer
date Mon, 19 Aug 2019 17:50:55 +0200
parents 50ea68c7a153 38367bb982b8
children 4bb5ceebfaf9
comparison
equal deleted inserted replaced
371:fca370f847f8 372:75eedde05ff6
52 // =============================================================================== 52 // ===============================================================================
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 = 5,
58 .versionThird = 9, 58 .versionThird = 0,
59 .versionBeta = 1, 59 .versionBeta = 0,
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 = 19, 64 .release_year = 19,
65 .release_month = 5, 65 .release_month = 8,
66 .release_day = 6, 66 .release_day = 5,
67 .release_sub = 0, 67 .release_sub = 0,
68 68
69 /* max 48 with trailing 0 */ 69 /* max 48 with trailing 0 */
70 //release_info ="12345678901234567890123456789012345678901" 70 //release_info ="12345678901234567890123456789012345678901"
71 .release_info ="gcc_2nd", 71 .release_info ="gcc_2nd",
1222 corrections++; 1222 corrections++;
1223 } 1223 }
1224 1224
1225 /* int8_t offsetPressure_mbar; 1225 /* int8_t offsetPressure_mbar;
1226 */ 1226 */
1227 if((Settings.offsetPressure_mbar > 20) || 1227 if((Settings.offsetPressure_mbar > PRESSURE_OFFSET_LIMIT_MBAR) ||
1228 (Settings.offsetPressure_mbar < -20)) 1228 (Settings.offsetPressure_mbar < -1 * PRESSURE_OFFSET_LIMIT_MBAR))
1229 { 1229 {
1230 Settings.offsetPressure_mbar = 0; 1230 Settings.offsetPressure_mbar = 0;
1231 corrections++; 1231 corrections++;
1232 } 1232 }
1233 1233
1738 return ERROR_; 1738 return ERROR_;
1739 case 0x35: 1739 case 0x35:
1740 if(data[1] & 0x80) 1740 if(data[1] & 0x80)
1741 { 1741 {
1742 data[1] = ~(data[1]); 1742 data[1] = ~(data[1]);
1743 if(!checkValue(data[1],0,20)) 1743 if(!checkValue(data[1],0,PRESSURE_OFFSET_LIMIT_MBAR))
1744 return ERROR_; 1744 return ERROR_;
1745 Settings.offsetPressure_mbar = 0 - data[1]; 1745 Settings.offsetPressure_mbar = 0 - data[1];
1746 } 1746 }
1747 else 1747 else
1748 { 1748 {
1749 if(!checkValue(data[1],0,20)) 1749 if(!checkValue(data[1],0,PRESSURE_OFFSET_LIMIT_MBAR))
1750 return ERROR_; 1750 return ERROR_;
1751 Settings.offsetPressure_mbar = data[1]; 1751 Settings.offsetPressure_mbar = data[1];
1752 } 1752 }
1753 break; 1753 break;
1754 case 0x36: 1754 case 0x36:
2102 data[datacounter++] = 0; 2102 data[datacounter++] = 0;
2103 break; 2103 break;
2104 2104
2105 case 0x35: 2105 case 0x35:
2106 data[datacounter++] = PARAM_SINT; 2106 data[datacounter++] = PARAM_SINT;
2107 data[datacounter++] = (uint8_t)(256 - 20); // == -20 2107 data[datacounter++] = (uint8_t)(256 - PRESSURE_OFFSET_LIMIT_MBAR); // == -20
2108 if(settingsGetPointerStandard()->offsetPressure_mbar < 0) 2108 if(settingsGetPointerStandard()->offsetPressure_mbar < 0)
2109 data[datacounter++] = (uint8_t)(127 - settingsGetPointerStandard()->offsetPressure_mbar); 2109 data[datacounter++] = (uint8_t)(127 - settingsGetPointerStandard()->offsetPressure_mbar);
2110 else 2110 else
2111 data[datacounter++] = settingsGetPointerStandard()->offsetPressure_mbar; 2111 data[datacounter++] = settingsGetPointerStandard()->offsetPressure_mbar;
2112 data[datacounter++] = 20; 2112 data[datacounter++] = PRESSURE_OFFSET_LIMIT_MBAR;
2113 break; 2113 break;
2114 2114
2115 case 0x36: 2115 case 0x36:
2116 data[datacounter++] = PARAM_BOOL; 2116 data[datacounter++] = PARAM_BOOL;
2117 data[datacounter++] = 0; 2117 data[datacounter++] = 0;