mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Refactor LED defines
This commit is contained in:
parent
cc2f2e9a5b
commit
2621e29e5f
7 changed files with 15 additions and 25 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Do not change any code below this line unless you are sure what you are doing */
|
||||
/* Do not change any code below this lc:\Git\BYD-Battery-Emulator-For-Gen24\Software\src\battery\NISSAN-LEAF-BATTERY.hine unless you are sure what you are doing */
|
||||
/* Only change battery specific settings in "USER_SETTINGS.h" */
|
||||
|
||||
#include <Arduino.h>
|
||||
|
@ -75,12 +75,6 @@ uint16_t cell_max_voltage = 3700; // Stores the highest cell voltage value in t
|
|||
uint16_t cell_min_voltage = 3700; // Stores the minimum cell voltage value in the system
|
||||
|
||||
// LED parameters
|
||||
#define GREEN 0
|
||||
#define YELLOW 1
|
||||
#define RED 2
|
||||
#define BLUE 3
|
||||
#define TEST_ALL_COLORS 10
|
||||
|
||||
Adafruit_NeoPixel pixels(1, WS2812_PIN, NEO_GRB + NEO_KHZ800);
|
||||
static uint8_t brightness = 0;
|
||||
static bool rampUp = true;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue