Mercurial > public > ostc4
diff Small_CPU/Src/pressure.c @ 241:2b9775f71e30 div-fixes-5
cleanup: factor out I2C1_Status() and cleanup type
Having a function that returns global data is rather useless. Further,
use HAL_StatusTypeDef directly, instead of typecasting between a
HAL defined enum and our uint_8t. Cleanup only.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author | Jan Mulder <jlmulder@xs4all.nl> |
---|---|
date | Mon, 08 Apr 2019 11:18:40 +0200 |
parents | f11f0bf6ef2d |
children | 8e9c502c0b06 |
line wrap: on
line diff
--- a/Small_CPU/Src/pressure.c Mon Apr 08 11:49:13 2019 +0200 +++ b/Small_CPU/Src/pressure.c Mon Apr 08 11:18:40 2019 +0200 @@ -29,7 +29,7 @@ at the beginning of a dive the oldest value will be used */ - +#include "scheduler.h" #include "pressure.h" #include "i2c.h" #include "rtc.h" @@ -261,7 +261,7 @@ C2_x_2p16 = C[2] * 65536; C1_x_2p15 = C[1] * 32768; - if(I2C1_Status() == HAL_OK) + if(global.I2C_SystemStatus == HAL_OK) { pressureSensorInitSuccess = 1; } @@ -360,7 +360,7 @@ void pressure_calculation(void) { - if(I2C1_Status() != HAL_OK) + if(global.I2C_SystemStatus != HAL_OK) return; pressure_calculation_AN520_004_mod_MS5803_30BA__09_2015();