diff Discovery/Src/settings.c @ 337:38367bb982b8 PressureMeasure_Improvment

Set Max value for pressure offset to 50mBar (20mBar before) Some OSTC4 might have a higher delta and need a bigger offset
author ideenmodellierer
date Sat, 17 Aug 2019 18:47:08 +0200
parents 143fe85f82a2
children 591c03a1e68d 75eedde05ff6
line wrap: on
line diff
--- a/Discovery/Src/settings.c	Sat Aug 17 18:44:43 2019 +0200
+++ b/Discovery/Src/settings.c	Sat Aug 17 18:47:08 2019 +0200
@@ -1219,8 +1219,8 @@
 
 /*	int8_t offsetPressure_mbar;
  */
-    if((Settings.offsetPressure_mbar > 20) ||
-         (Settings.offsetPressure_mbar < -20))
+    if((Settings.offsetPressure_mbar > PRESSURE_OFFSET_LIMIT_MBAR) ||
+         (Settings.offsetPressure_mbar < -1 * PRESSURE_OFFSET_LIMIT_MBAR))
     {
         Settings.offsetPressure_mbar = 0;
         corrections++;
@@ -1730,13 +1730,13 @@
                 if(data[1] & 0x80)
                 {
                     data[1] = ~(data[1]);
-                    if(!checkValue(data[1],0,20))
+                    if(!checkValue(data[1],0,PRESSURE_OFFSET_LIMIT_MBAR))
                             return ERROR_;
                     Settings.offsetPressure_mbar = 0 - data[1];
                 }
                 else
                 {
-                    if(!checkValue(data[1],0,20))
+                    if(!checkValue(data[1],0,PRESSURE_OFFSET_LIMIT_MBAR))
                             return ERROR_;
                     Settings.offsetPressure_mbar = data[1];
                 }
@@ -2094,12 +2094,12 @@
 
     case 0x35:
         data[datacounter++] =  PARAM_SINT;
-        data[datacounter++] = (uint8_t)(256 - 20); // == -20
+        data[datacounter++] = (uint8_t)(256 - PRESSURE_OFFSET_LIMIT_MBAR); // == -20
         if(settingsGetPointerStandard()->offsetPressure_mbar < 0)
             data[datacounter++] = (uint8_t)(127 - settingsGetPointerStandard()->offsetPressure_mbar);
         else
             data[datacounter++] = settingsGetPointerStandard()->offsetPressure_mbar;
-        data[datacounter++] = 20;
+        data[datacounter++] = PRESSURE_OFFSET_LIMIT_MBAR;
         break;
 
     case 0x36: