Mercurial > public > ostc4
comparison Discovery/Src/check_warning.c @ 478:58200d756365 Improve_Button_Sleep
Development option only: Show Pressure update for a short time in the custom field (as warning)
author | ideenmodellierer |
---|---|
date | Tue, 12 May 2020 23:03:50 +0200 |
parents | 74a8296a2318 |
children | d97f0e395058 |
comparison
equal
deleted
inserted
replaced
477:5e6a612d03b5 | 478:58200d756365 |
---|---|
52 static int8_t check_AscentRate(SDiveState * pDiveState); | 52 static int8_t check_AscentRate(SDiveState * pDiveState); |
53 static int8_t check_aGF(SDiveState * pDiveState); | 53 static int8_t check_aGF(SDiveState * pDiveState); |
54 static int8_t check_BetterGas(SDiveState * pDiveState); | 54 static int8_t check_BetterGas(SDiveState * pDiveState); |
55 static int8_t check_BetterSetpoint(SDiveState * pDiveState); | 55 static int8_t check_BetterSetpoint(SDiveState * pDiveState); |
56 static int8_t check_Battery(SDiveState * pDiveState); | 56 static int8_t check_Battery(SDiveState * pDiveState); |
57 | 57 #ifdef ENABLE_BOTTLE_SENSOR |
58 static int8_t check_pressureSensor(SDiveState * pDiveState); | |
59 #endif | |
58 static int8_t check_helper_same_oxygen_and_helium_content(SGasLine * gas1, SGasLine * gas2); | 60 static int8_t check_helper_same_oxygen_and_helium_content(SGasLine * gas1, SGasLine * gas2); |
59 | 61 |
60 /* Exported functions --------------------------------------------------------*/ | 62 /* Exported functions --------------------------------------------------------*/ |
61 | 63 |
62 void check_warning(void) | 64 void check_warning(void) |
77 pDiveState->warnings.numWarnings += check_O2_sensors(pDiveState); | 79 pDiveState->warnings.numWarnings += check_O2_sensors(pDiveState); |
78 pDiveState->warnings.numWarnings += check_BetterGas(pDiveState); | 80 pDiveState->warnings.numWarnings += check_BetterGas(pDiveState); |
79 pDiveState->warnings.numWarnings += check_BetterSetpoint(pDiveState); | 81 pDiveState->warnings.numWarnings += check_BetterSetpoint(pDiveState); |
80 pDiveState->warnings.numWarnings += check_Battery(pDiveState); | 82 pDiveState->warnings.numWarnings += check_Battery(pDiveState); |
81 pDiveState->warnings.numWarnings += check_fallback(pDiveState); | 83 pDiveState->warnings.numWarnings += check_fallback(pDiveState); |
84 #ifdef ENABLE_BOTTLE_SENSOR | |
85 pDiveState->warnings.numWarnings += check_pressureSensor(pDiveState); | |
86 #endif | |
82 } | 87 } |
83 | 88 |
84 | 89 |
85 void set_warning_fallback(void) | 90 void set_warning_fallback(void) |
86 { | 91 { |
404 pDiveState->warnings.aGf = 1; | 409 pDiveState->warnings.aGf = 1; |
405 } | 410 } |
406 return pDiveState->warnings.aGf; | 411 return pDiveState->warnings.aGf; |
407 } | 412 } |
408 | 413 |
414 #ifdef ENABLE_BOTTLE_SENSOR | |
415 static int8_t check_pressureSensor(SDiveState * pDiveState) | |
416 { | |
417 int8_t ret = 0; | |
418 if(pDiveState->lifeData.bottle_bar_age_MilliSeconds[pDiveState->lifeData.actualGas.GasIdInSettings] < 50) /* we received a new value */ | |
419 { | |
420 pDiveState->warnings.newPressure = stateUsed->lifeData.bottle_bar[stateUsed->lifeData.actualGas.GasIdInSettings]; | |
421 ret = 1; | |
422 } | |
423 else | |
424 { | |
425 pDiveState->warnings.newPressure = 0; | |
426 } | |
427 return ret; | |
428 } | |
429 #endif | |
409 /************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/ | 430 /************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/ |
410 | 431 |