mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 10:19:29 +02:00
Make chargers compile. Add to workflow
This commit is contained in:
parent
39e8682d43
commit
93dfa1b0eb
8 changed files with 20 additions and 23 deletions
2
.github/workflows/compile-all-inverters.yml
vendored
2
.github/workflows/compile-all-inverters.yml
vendored
|
@ -51,7 +51,7 @@ jobs:
|
||||||
- SOFAR_CAN
|
- SOFAR_CAN
|
||||||
- SOLAX_CAN
|
- SOLAX_CAN
|
||||||
- SERIAL_LINK_TRANSMITTER
|
- SERIAL_LINK_TRANSMITTER
|
||||||
|
- NISSANLEAF_CHARGER # Last element is not an inverter, but good to also test if charger compiles
|
||||||
# This is the platform GitHub will use to run our workflow.
|
# This is the platform GitHub will use to run our workflow.
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
|
|
@ -527,11 +527,8 @@ void receive_can() { // This section checks if we have a complete CAN message i
|
||||||
receive_can_sma_tripower(rx_frame);
|
receive_can_sma_tripower(rx_frame);
|
||||||
#endif
|
#endif
|
||||||
// Charger
|
// Charger
|
||||||
#ifdef CHEVYVOLT_CHARGER
|
#if defined(CHEVYVOLT_CHARGER) || defined(NISSANLEAF_CHARGER)
|
||||||
receive_can_chevyvolt_charger(rx_frame);
|
receive_can_charger(rx_frame);
|
||||||
#endif
|
|
||||||
#ifdef NISSANLEAF_CHARGER
|
|
||||||
receive_can_nissanleaf_charger(rx_frame);
|
|
||||||
#endif
|
#endif
|
||||||
} else { // New extended frame
|
} else { // New extended frame
|
||||||
#ifdef PYLON_CAN
|
#ifdef PYLON_CAN
|
||||||
|
@ -565,11 +562,8 @@ void send_can() {
|
||||||
// Battery
|
// Battery
|
||||||
send_can_battery();
|
send_can_battery();
|
||||||
// Charger
|
// Charger
|
||||||
#ifdef CHEVYVOLT_CHARGER
|
#if defined(CHEVYVOLT_CHARGER) || defined(NISSANLEAF_CHARGER)
|
||||||
send_can_chevyvolt_charger();
|
send_can_charger();
|
||||||
#endif
|
|
||||||
#ifdef NISSANLEAF_CHARGER
|
|
||||||
send_can_nissanleaf_charger();
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef CHARGERS_H
|
#ifndef CHARGERS_H
|
||||||
#define CHARGERS_H
|
#define CHARGERS_H
|
||||||
|
|
||||||
#include "../../USER_SETTINGS.h"
|
#include "../../USER_SETTINGS.h"
|
||||||
|
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h" // This include is annoying, consider defining a frame type in types.h
|
||||||
|
|
||||||
#ifdef CHEVYVOLT_CHARGER
|
#ifdef CHEVYVOLT_CHARGER
|
||||||
#include "CHEVY-VOLT-CHARGER.h"
|
#include "CHEVY-VOLT-CHARGER.h"
|
||||||
|
@ -11,4 +11,7 @@
|
||||||
#include "NISSAN-LEAF-CHARGER.h"
|
#include "NISSAN-LEAF-CHARGER.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void receive_can_charger(CAN_frame_t rx_frame);
|
||||||
|
void send_can_charger();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "../include.h"
|
#include "../include.h"
|
||||||
#ifdef CHEVYVOLT_CHARGER
|
#ifdef CHEVYVOLT_CHARGER
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
|
#include "../devboard/utils/events.h"
|
||||||
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
|
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
|
||||||
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||||
#include "CHEVY-VOLT-CHARGER.h"
|
#include "CHEVY-VOLT-CHARGER.h"
|
||||||
|
@ -63,7 +64,7 @@ static CAN_frame_t charger_set_targets = {.FIR = {.B =
|
||||||
.data = {0x40, 0x00, 0x00, 0x00}};
|
.data = {0x40, 0x00, 0x00, 0x00}};
|
||||||
|
|
||||||
/* We are mostly sending out not receiving */
|
/* We are mostly sending out not receiving */
|
||||||
void receive_can_chevyvolt_charger(CAN_frame_t rx_frame) {
|
void receive_can_charger(CAN_frame_t rx_frame) {
|
||||||
uint16_t charger_stat_HVcur_temp = 0;
|
uint16_t charger_stat_HVcur_temp = 0;
|
||||||
uint16_t charger_stat_HVvol_temp = 0;
|
uint16_t charger_stat_HVvol_temp = 0;
|
||||||
uint16_t charger_stat_LVcur_temp = 0;
|
uint16_t charger_stat_LVcur_temp = 0;
|
||||||
|
@ -115,7 +116,7 @@ void receive_can_chevyvolt_charger(CAN_frame_t rx_frame) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_can_chevyvolt_charger() {
|
void send_can_charger() {
|
||||||
unsigned long currentMillis = millis();
|
unsigned long currentMillis = millis();
|
||||||
uint16_t Vol_temp = 0;
|
uint16_t Vol_temp = 0;
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
#include "../include.h"
|
#include "../include.h"
|
||||||
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||||
|
|
||||||
|
#define CHARGER_SELECTED
|
||||||
|
|
||||||
/* Charger hardware limits
|
/* Charger hardware limits
|
||||||
*
|
*
|
||||||
* Relative to runtime settings, expectations are:
|
* Relative to runtime settings, expectations are:
|
||||||
|
@ -14,8 +16,4 @@
|
||||||
#define CHEVYVOLT_MAX_AMP 11.5
|
#define CHEVYVOLT_MAX_AMP 11.5
|
||||||
#define CHEVYVOLT_MAX_POWER 3300
|
#define CHEVYVOLT_MAX_POWER 3300
|
||||||
|
|
||||||
void update_values_can_chevyvolt_charger();
|
|
||||||
void send_can_chevyvolt_charger();
|
|
||||||
void receive_can_chevyvolt_charger(CAN_frame_t rx_frame);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "../include.h"
|
#include "../include.h"
|
||||||
#ifdef NISSAN_LEAF_CHARGER
|
#ifdef NISSANLEAF_CHARGER
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
|
#include "../devboard/utils/events.h"
|
||||||
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
|
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
|
||||||
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||||
#include "NISSAN-LEAF-CHARGER.h"
|
#include "NISSAN-LEAF-CHARGER.h"
|
||||||
|
@ -144,7 +145,7 @@ static uint8_t calculate_checksum_nibble(CAN_frame_t* frame) {
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
void receive_can_nissanleaf_charger(CAN_frame_t rx_frame) {
|
void receive_can_charger(CAN_frame_t rx_frame) {
|
||||||
|
|
||||||
switch (rx_frame.MsgID) {
|
switch (rx_frame.MsgID) {
|
||||||
case 0x679: // This message fires once when charging cable is plugged in
|
case 0x679: // This message fires once when charging cable is plugged in
|
||||||
|
@ -181,7 +182,7 @@ void receive_can_nissanleaf_charger(CAN_frame_t rx_frame) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_can_nissanleaf_charger() {
|
void send_can_charger() {
|
||||||
unsigned long currentMillis = millis();
|
unsigned long currentMillis = millis();
|
||||||
|
|
||||||
/* Send keepalive with mode every 10ms */
|
/* Send keepalive with mode every 10ms */
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
#include "../include.h"
|
#include "../include.h"
|
||||||
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
|
||||||
|
|
||||||
void send_can_nissanleaf_charger();
|
#define CHARGER_SELECTED
|
||||||
void receive_can_nissanleaf_charger(CAN_frame_t rx_frame);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "devboard/utils/types.h"
|
#include "devboard/utils/types.h"
|
||||||
|
|
||||||
#include "battery/BATTERIES.h"
|
#include "battery/BATTERIES.h"
|
||||||
|
#include "charger/CHARGERS.h"
|
||||||
#include "inverter/INVERTERS.h"
|
#include "inverter/INVERTERS.h"
|
||||||
|
|
||||||
/* - ERROR CHECKS BELOW, DON'T TOUCH - */
|
/* - ERROR CHECKS BELOW, DON'T TOUCH - */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue