mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-06 03:50:13 +02:00
reword functions in CAN communication
This commit is contained in:
parent
e5b0481903
commit
0b096010c1
88 changed files with 701 additions and 685 deletions
|
@ -180,7 +180,7 @@ void update_values_battery() {
|
|||
datalayer.battery.info.min_design_voltage_dV = DischargeVoltageLimit * 10;
|
||||
}
|
||||
|
||||
void receive_can_battery(CAN_frame rx_frame) {
|
||||
void map_can_frame_to_variable_battery(CAN_frame rx_frame) {
|
||||
datalayer.battery.status.CAN_battery_still_alive = CAN_STILL_ALIVE;
|
||||
switch (rx_frame.ID) {
|
||||
case 0x080: // 15ms
|
||||
|
@ -301,14 +301,14 @@ void receive_can_battery(CAN_frame rx_frame) {
|
|||
}
|
||||
}
|
||||
|
||||
void send_can_battery() {
|
||||
void transmit_can_battery() {
|
||||
unsigned long currentMillis = millis();
|
||||
// Send 50ms CAN Message
|
||||
if (currentMillis - previousMillis50ms >= INTERVAL_50_MS) {
|
||||
|
||||
previousMillis50ms = currentMillis;
|
||||
|
||||
transmit_can(&RANGE_ROVER_18B, can_config.battery);
|
||||
transmit_can_frame(&RANGE_ROVER_18B, can_config.battery);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue