Browse Source

hyterisis added in the header file

namrota ghosh 7 months ago
parent
commit
909e3feb85
2 changed files with 4 additions and 3 deletions
  1. 2 1
      src/battery_data/battery.c
  2. 2 2
      src/battery_data/battery.h

+ 2 - 1
src/battery_data/battery.c

@@ -38,4 +38,5 @@ void Battery_ReadState(uint8_t slot_id){
     else{
         battery_data[slot_id].battery_state = STATE_MEASUREMENT_IN_PROGRESS;
     }
-}
+}
+

+ 2 - 2
src/battery_data/battery.h

@@ -4,7 +4,7 @@
 #include "src/config.h"
 #ifndef BATTERY_H
 #define BATTERY_H
-
+#define HYSTERISIS (50)
 
 //Battery states read by Pi
 typedef enum{
@@ -42,7 +42,7 @@ typedef enum __attribute((packed))__{
     SLOT_ERR_DAC_WRITE_FAILED= (0x26 | 0x80)
 } SlotState;
 
-typedef struct __attribute__((packed)){
+typedef struct  __attribute__((packed)){
     uint16_t voltage;
     int16_t current;
     uint16_t temperature;