Refactor LED defines

This commit is contained in:
Daniel 2023-11-14 21:52:41 +02:00
parent cc2f2e9a5b
commit 2621e29e5f
7 changed files with 15 additions and 25 deletions

View file

@ -2,6 +2,7 @@
#define NISSAN_LEAF_BATTERY_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/config.h" // Needed for LED defines
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
#define ABSOLUTE_MAX_VOLTAGE \
@ -25,7 +26,7 @@ extern uint16_t temperature_max; //C+1, Goes thru convert2unsignedint16 funct
extern uint16_t cell_max_voltage; //mV, 0-4350
extern uint16_t cell_min_voltage; //mV, 0-4350
extern uint8_t batteryAllowsContactorClosing; //Bool, 1=true, 0=false
extern uint8_t LEDcolor; //Enum, 0-2
extern uint8_t LEDcolor; //Enum, 0-10
// Definitions for bms_status
#define STANDBY 0
#define INACTIVE 1
@ -33,10 +34,6 @@ extern uint8_t LEDcolor; //Enum, 0-2
#define ACTIVE 3
#define FAULT 4
#define UPDATING 5
// LED colors
#define GREEN 0
#define YELLOW 1
#define RED 2
void update_values_leaf_battery();
void receive_can_leaf_battery(CAN_frame_t rx_frame);

View file

@ -2,6 +2,7 @@
#define TESLA_MODEL_3_BATTERY_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/config.h" // Needed for LED defines
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
#define ABSOLUTE_MAX_VOLTAGE \
@ -33,10 +34,6 @@ extern uint8_t LEDcolor;
#define ACTIVE 3
#define FAULT 4
#define UPDATING 5
// LED colors
#define GREEN 0
#define YELLOW 1
#define RED 2
void update_values_tesla_model_3_battery();
void receive_can_tesla_model_3_battery(CAN_frame_t rx_frame);

View file

@ -2,6 +2,7 @@
#define TEST_FAKE_BATTERY_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/config.h" // Needed for LED defines
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
#define ABSOLUTE_MAX_VOLTAGE \
@ -25,7 +26,7 @@ extern uint16_t temperature_max; //C+1, Goes thru convert2unsignedint16 funct
extern uint16_t cell_max_voltage; //mV, 0-4350
extern uint16_t cell_min_voltage; //mV, 0-4350
extern uint8_t batteryAllowsContactorClosing; //Bool, 1=true, 0=false
extern uint8_t LEDcolor; //Enum, 0-2
extern uint8_t LEDcolor; //Enum, 0-10
// Definitions for bms_status
#define STANDBY 0
#define INACTIVE 1
@ -33,12 +34,6 @@ extern uint8_t LEDcolor; //Enum, 0-2
#define ACTIVE 3
#define FAULT 4
#define UPDATING 5
// LED colors
#define GREEN 0
#define YELLOW 1
#define RED 2
#define BLUE 3
#define TEST_ALL_COLORS 10
void update_values_test_battery();
void receive_can_test_battery(CAN_frame_t rx_frame);

View file

@ -32,4 +32,11 @@
#define SD_CS_PIN 13
#define WS2812_PIN 4
// LED definitions for the board
#define GREEN 0
#define YELLOW 1
#define RED 2
#define BLUE 3
#define TEST_ALL_COLORS 10
#endif

View file

@ -21,7 +21,7 @@ extern uint16_t cell_max_voltage; //mV, 0-4350
extern uint16_t cell_min_voltage; //mV, 0-4350
extern uint16_t min_voltage;
extern uint16_t max_voltage;
extern uint8_t LEDcolor; //Enum, 0-2
extern uint8_t LEDcolor; //Enum, 0-10
// Definitions for BMS status
#define STANDBY 0
#define INACTIVE 1

View file

@ -21,7 +21,7 @@ extern uint16_t temperature_max; //C+1, Goes thru convert2unsignedint16 funct
extern uint16_t cell_max_voltage; //mV, 0-4350
extern uint16_t cell_min_voltage; //mV, 0-4350
extern uint8_t batteryAllowsContactorClosing; //Bool, 1=true, 0=false
extern uint8_t LEDcolor; //Enum, 0-2
extern uint8_t LEDcolor; //Enum, 0-10
extern uint16_t min_voltage;
extern uint16_t max_voltage;
// Definitions for BMS status