changeset 652:f6212495f34f

Allow setpoint starting at 0.4 ppO2: Some rebreathers (e.g. Sentinel) start with a ppO2 of 0.4 Bar => modified range check to allow this value (was 0.5 before)
author Ideenmodellierer
date Mon, 19 Apr 2021 20:34:53 +0200
parents 7b5a063f080f
children 269e57ac4e56
files Common/Inc/settings.h Discovery/Src/settings.c Discovery/Src/tMenuEditSetpoint.c
diffstat 3 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Common/Inc/settings.h	Mon Apr 19 20:20:38 2021 +0200
+++ b/Common/Inc/settings.h	Mon Apr 19 20:34:53 2021 +0200
@@ -72,6 +72,7 @@
 #define MAX_VIEWPORT_MODE 		(0x7F)
 
 #define MAX_SCRUBBER_TIME 		(500u)
+#define MIN_PPO2_SP_CBAR		(40u)
 
 typedef enum
 {
--- a/Discovery/Src/settings.c	Mon Apr 19 20:20:38 2021 +0200
+++ b/Discovery/Src/settings.c	Mon Apr 19 20:34:53 2021 +0200
@@ -682,9 +682,9 @@
  */
     for(int i=1; i<=NUM_GASES;i++)
     {
-        if(Settings.setpoint[i].setpoint_cbar < 50)
+        if(Settings.setpoint[i].setpoint_cbar < MIN_PPO2_SP_CBAR)
         {
-            Settings.setpoint[i].setpoint_cbar = 50;
+            Settings.setpoint[i].setpoint_cbar = MIN_PPO2_SP_CBAR;
             corrections++;
         }
         if(Settings.setpoint[i].setpoint_cbar > 160)
--- a/Discovery/Src/tMenuEditSetpoint.c	Mon Apr 19 20:20:38 2021 +0200
+++ b/Discovery/Src/tMenuEditSetpoint.c	Mon Apr 19 20:34:53 2021 +0200
@@ -282,8 +282,8 @@
 
         new_cbar = (new_integer_part * 100) + new_fractional_part;
 
-        if(new_cbar < 50)
-            new_cbar = 50;
+        if(new_cbar < MIN_PPO2_SP_CBAR)
+            new_cbar = MIN_PPO2_SP_CBAR;
 
         if(new_cbar > 160)
             new_cbar = 160;