mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 01:39:30 +02:00
Simplify can sending routine and perf check
This commit is contained in:
parent
c49912df36
commit
c8de168435
62 changed files with 98 additions and 301 deletions
|
@ -513,14 +513,9 @@ void handle_incoming_can_frame_battery(CAN_frame rx_frame) {
|
|||
}
|
||||
}
|
||||
|
||||
void transmit_can_battery() {
|
||||
unsigned long currentMillis = millis();
|
||||
void transmit_can_battery(unsigned long currentMillis) {
|
||||
// Send 10ms CAN Message
|
||||
if (currentMillis - previousMillis10ms >= INTERVAL_10_MS) {
|
||||
// Check if sending of CAN messages has been delayed too much.
|
||||
if ((currentMillis - previousMillis10ms >= INTERVAL_10_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
|
||||
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis10ms));
|
||||
}
|
||||
previousMillis10ms = currentMillis;
|
||||
transmit_can_frame(&CMFA_1EA, can_config.battery);
|
||||
transmit_can_frame(&CMFA_135, can_config.battery);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue