diff Discovery/Src/check_warning.c @ 268:1b9847d40e81 write-from-sim

cleanup: make things static where possible. and comment out some code that is not used. Trivial cleanup. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Tue, 23 Apr 2019 17:41:20 +0200
parents 5f11787b4f42
children 74a8296a2318
line wrap: on
line diff
--- a/Discovery/Src/check_warning.c	Fri Apr 26 10:36:11 2019 +0000
+++ b/Discovery/Src/check_warning.c	Tue Apr 23 17:41:20 2019 +0200
@@ -38,24 +38,24 @@
 #include "decom.h"
 #include "tCCR.h"
 
-/* Private variables wit access ----------------------------------------------*/
-uint8_t betterGasId = 0;
-uint8_t betterSetpointId = 0;
-int8_t fallback = 0;
+/* Private variables with access ----------------------------------------------*/
+static uint8_t betterGasId = 0;
+static uint8_t betterSetpointId = 0;
+static int8_t fallback = 0;
 
 /* Private function prototypes -----------------------------------------------*/
-int8_t check_fallback(SDiveState * pDiveState);
-int8_t check_ppO2(SDiveState * pDiveState);
-int8_t check_O2_sensors(SDiveState * pDiveState);
-int8_t check_CNS(SDiveState * pDiveState);
-int8_t check_Deco(SDiveState * pDiveState);
-int8_t check_AscentRate(SDiveState * pDiveState);
-int8_t check_aGF(SDiveState * pDiveState);
-int8_t check_BetterGas(SDiveState * pDiveState);
-int8_t check_BetterSetpoint(SDiveState * pDiveState);
-int8_t check_Battery(SDiveState * pDiveState);
+static int8_t check_fallback(SDiveState * pDiveState);
+static int8_t check_ppO2(SDiveState * pDiveState);
+static int8_t check_O2_sensors(SDiveState * pDiveState);
+static int8_t check_CNS(SDiveState * pDiveState);
+static int8_t check_Deco(SDiveState * pDiveState);
+static int8_t check_AscentRate(SDiveState * pDiveState);
+static int8_t check_aGF(SDiveState * pDiveState);
+static int8_t check_BetterGas(SDiveState * pDiveState);
+static int8_t check_BetterSetpoint(SDiveState * pDiveState);
+static int8_t check_Battery(SDiveState * pDiveState);
 
-int8_t check_helper_same_oxygen_and_helium_content(SGasLine * gas1, SGasLine * gas2);
+static int8_t check_helper_same_oxygen_and_helium_content(SGasLine * gas1, SGasLine * gas2);
 
 /* Exported functions --------------------------------------------------------*/
 
@@ -123,7 +123,7 @@
 
 
 /* Private functions ---------------------------------------------------------*/
-int8_t check_fallback(SDiveState * pDiveState)
+static int8_t check_fallback(SDiveState * pDiveState)
 {
 	if(fallback && ((pDiveState->mode != MODE_DIVE) || (pDiveState->diveSettings.diveMode != DIVEMODE_CCR)))
 		fallback = 0;
@@ -133,7 +133,7 @@
 }
 
 
-int8_t check_ppO2(SDiveState * pDiveState)
+static int8_t check_ppO2(SDiveState * pDiveState)
 {
 	if(pDiveState->mode != MODE_DIVE)
 	{
@@ -171,7 +171,7 @@
 }
 
 
-int8_t check_O2_sensors(SDiveState * pDiveState)
+static int8_t check_O2_sensors(SDiveState * pDiveState)
 {
 	pDiveState->warnings.sensorLinkLost = 0;
 	pDiveState->warnings.sensorOutOfBounds[0] = 0;
@@ -193,7 +193,7 @@
 }
 
 
-int8_t check_BetterGas(SDiveState * pDiveState)
+static int8_t check_BetterGas(SDiveState * pDiveState)
 {
 	if(stateUsed->mode != MODE_DIVE)
 	{
@@ -276,7 +276,7 @@
 
 /* check for better travel!!! setpoint hw 151210
  */ 
-int8_t check_BetterSetpoint(SDiveState * pDiveState)
+static int8_t check_BetterSetpoint(SDiveState * pDiveState)
 {
 	pDiveState->warnings.betterSetpoint = 0;
 	betterSetpointId = 0;
@@ -315,7 +315,7 @@
 
 /* hw 151030
  */
-int8_t check_helper_same_oxygen_and_helium_content(SGasLine * gas1, SGasLine * gas2) 
+static int8_t check_helper_same_oxygen_and_helium_content(SGasLine * gas1, SGasLine * gas2)
 {
 	if(gas1->helium_percentage != gas2->helium_percentage)
 		return 0;
@@ -327,7 +327,7 @@
 }
 
 
-int8_t check_CNS(SDiveState * pDiveState)
+static int8_t check_CNS(SDiveState * pDiveState)
 {
 	if(stateUsed->mode != MODE_DIVE)
 	{
@@ -343,7 +343,7 @@
 }
 
 
-int8_t check_Battery(SDiveState * pDiveState)
+static int8_t check_Battery(SDiveState * pDiveState)
 {
 	if(pDiveState->lifeData.battery_charge < 10)
 		pDiveState->warnings.lowBattery = 1;
@@ -354,7 +354,7 @@
 }
 
 
-int8_t check_Deco(SDiveState * pDiveState)
+static int8_t check_Deco(SDiveState * pDiveState)
 {
 	if(stateUsed->mode != MODE_DIVE)
 	{
@@ -376,7 +376,7 @@
 }
 
 
-int8_t check_AscentRate(SDiveState * pDiveState)
+static int8_t check_AscentRate(SDiveState * pDiveState)
 {
 	if(stateUsed->mode != MODE_DIVE)
 	{
@@ -396,7 +396,7 @@
 }
 
 
-int8_t check_aGF(SDiveState * pDiveState)
+static int8_t check_aGF(SDiveState * pDiveState)
 {
 	if(stateUsed->mode != MODE_DIVE)
 	{