mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 02:09:30 +02:00
Initial commit
This commit is contained in:
parent
9b3aaa5a52
commit
b7696f3baa
24 changed files with 140 additions and 194 deletions
|
@ -360,36 +360,7 @@ void inform_user_on_inverter() {
|
|||
|
||||
void inform_user_on_battery() {
|
||||
// Inform user what battery is used
|
||||
#ifdef BMW_I3_BATTERY
|
||||
Serial.println("BMW i3 battery selected");
|
||||
#endif
|
||||
#ifdef CHADEMO_BATTERY
|
||||
Serial.println("Chademo battery selected");
|
||||
#endif
|
||||
#ifdef IMIEV_CZERO_ION_BATTERY
|
||||
Serial.println("Mitsubishi i-MiEV / Citroen C-Zero / Peugeot Ion battery selected");
|
||||
#endif
|
||||
#ifdef KIA_HYUNDAI_64_BATTERY
|
||||
Serial.println("Kia Niro / Hyundai Kona 64kWh battery selected");
|
||||
#endif
|
||||
#ifdef NISSAN_LEAF_BATTERY
|
||||
Serial.println("Nissan LEAF battery selected");
|
||||
#endif
|
||||
#ifdef RENAULT_KANGOO_BATTERY
|
||||
Serial.println("Renault Kangoo battery selected");
|
||||
#endif
|
||||
#ifdef SANTA_FE_PHEV_BATTERY
|
||||
Serial.println("Hyundai Santa Fe PHEV battery selected");
|
||||
#endif
|
||||
#ifdef RENAULT_ZOE_BATTERY
|
||||
Serial.println("Renault Zoe battery selected");
|
||||
#endif
|
||||
#ifdef TESLA_MODEL_3_BATTERY
|
||||
Serial.println("Tesla Model 3 battery selected");
|
||||
#endif
|
||||
#ifdef TEST_FAKE_BATTERY
|
||||
Serial.println("Test mode with fake battery selected");
|
||||
#endif
|
||||
announce_battery();
|
||||
#ifdef SERIAL_LINK_RECEIVER
|
||||
Serial.println("SERIAL_DATA_LINK_RECEIVER selected");
|
||||
#endif
|
||||
|
@ -406,36 +377,7 @@ void receive_can() { // This section checks if we have a complete CAN message i
|
|||
if (rx_frame.FIR.B.FF == CAN_frame_std) {
|
||||
//printf("New standard frame");
|
||||
// Battery
|
||||
#ifdef BMW_I3_BATTERY
|
||||
receive_can_i3_battery(rx_frame);
|
||||
#endif
|
||||
#ifdef CHADEMO_BATTERY
|
||||
receive_can_chademo_battery(rx_frame);
|
||||
#endif
|
||||
#ifdef IMIEV_CZERO_ION_BATTERY
|
||||
receive_can_imiev_battery(rx_frame);
|
||||
#endif
|
||||
#ifdef KIA_HYUNDAI_64_BATTERY
|
||||
receive_can_kiaHyundai_64_battery(rx_frame);
|
||||
#endif
|
||||
#ifdef NISSAN_LEAF_BATTERY
|
||||
receive_can_leaf_battery(rx_frame);
|
||||
#endif
|
||||
#ifdef RENAULT_KANGOO_BATTERY
|
||||
receive_can_kangoo_battery(rx_frame);
|
||||
#endif
|
||||
#ifdef SANTA_FE_PHEV_BATTERY
|
||||
receive_can_santafe_phev_battery(rx_frame);
|
||||
#endif
|
||||
#ifdef RENAULT_ZOE_BATTERY
|
||||
receive_can_zoe_battery(rx_frame);
|
||||
#endif
|
||||
#ifdef TESLA_MODEL_3_BATTERY
|
||||
receive_can_tesla_model_3_battery(rx_frame);
|
||||
#endif
|
||||
#ifdef TEST_FAKE_BATTERY
|
||||
receive_can_test_battery(rx_frame);
|
||||
#endif
|
||||
receive_can_battery(rx_frame);
|
||||
// Inverter
|
||||
#ifdef BYD_CAN
|
||||
receive_can_byd(rx_frame);
|
||||
|
@ -484,36 +426,7 @@ void send_can() {
|
|||
send_can_sofar();
|
||||
#endif
|
||||
// Battery
|
||||
#ifdef BMW_I3_BATTERY
|
||||
send_can_i3_battery();
|
||||
#endif
|
||||
#ifdef CHADEMO_BATTERY
|
||||
send_can_chademo_battery();
|
||||
#endif
|
||||
#ifdef IMIEV_CZERO_ION_BATTERY
|
||||
send_can_imiev_battery();
|
||||
#endif
|
||||
#ifdef KIA_HYUNDAI_64_BATTERY
|
||||
send_can_kiaHyundai_64_battery();
|
||||
#endif
|
||||
#ifdef NISSAN_LEAF_BATTERY
|
||||
send_can_leaf_battery();
|
||||
#endif
|
||||
#ifdef RENAULT_KANGOO_BATTERY
|
||||
send_can_kangoo_battery();
|
||||
#endif
|
||||
#ifdef SANTA_FE_PHEV_BATTERY
|
||||
send_can_santafe_phev_battery();
|
||||
#endif
|
||||
#ifdef RENAULT_ZOE_BATTERY
|
||||
send_can_zoe_battery();
|
||||
#endif
|
||||
#ifdef TESLA_MODEL_3_BATTERY
|
||||
send_can_tesla_model_3_battery();
|
||||
#endif
|
||||
#ifdef TEST_FAKE_BATTERY
|
||||
send_can_test_battery();
|
||||
#endif
|
||||
send_can_battery();
|
||||
#ifdef CHEVYVOLT_CHARGER
|
||||
send_can_chevyvolt_charger();
|
||||
#endif
|
||||
|
@ -693,36 +606,7 @@ void handle_contactors() {
|
|||
|
||||
void update_values() {
|
||||
// Battery
|
||||
#ifdef BMW_I3_BATTERY
|
||||
update_values_i3_battery(); // Map the values to the correct registers
|
||||
#endif
|
||||
#ifdef CHADEMO_BATTERY
|
||||
update_values_chademo_battery(); // Map the values to the correct registers
|
||||
#endif
|
||||
#ifdef IMIEV_CZERO_ION_BATTERY
|
||||
update_values_imiev_battery(); // Map the values to the correct registers
|
||||
#endif
|
||||
#ifdef KIA_HYUNDAI_64_BATTERY
|
||||
update_values_kiaHyundai_64_battery(); // Map the values to the correct registers
|
||||
#endif
|
||||
#ifdef NISSAN_LEAF_BATTERY
|
||||
update_values_leaf_battery(); // Map the values to the correct registers
|
||||
#endif
|
||||
#ifdef RENAULT_KANGOO_BATTERY
|
||||
update_values_kangoo_battery(); // Map the values to the correct registers
|
||||
#endif
|
||||
#ifdef SANTA_FE_PHEV_BATTERY
|
||||
update_values_santafe_phev_battery(); // Map the values to the correct registers
|
||||
#endif
|
||||
#ifdef RENAULT_ZOE_BATTERY
|
||||
update_values_zoe_battery(); // Map the values to the correct registers
|
||||
#endif
|
||||
#ifdef TESLA_MODEL_3_BATTERY
|
||||
update_values_tesla_model_3_battery(); // Map the values to the correct registers
|
||||
#endif
|
||||
#ifdef TEST_FAKE_BATTERY
|
||||
update_values_test_battery(); // Map the fake values to the correct registers
|
||||
#endif
|
||||
update_values_battery(); // Map the fake values to the correct registers
|
||||
// Inverter
|
||||
#ifdef BYD_CAN
|
||||
update_values_can_byd();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue