mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 18:29:48 +02:00
Merge branch 'main' into bugfix/renault-zoe-refactor
This commit is contained in:
commit
d22d3546d5
14 changed files with 56 additions and 22 deletions
|
@ -687,6 +687,8 @@ void send_can_battery() {
|
|||
// Check if sending of CAN messages has been delayed too much.
|
||||
if ((currentMillis - previousMillis20 >= INTERVAL_20_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
|
||||
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis20));
|
||||
} else {
|
||||
clear_event(EVENT_CAN_OVERRUN);
|
||||
}
|
||||
previousMillis20 = currentMillis;
|
||||
|
||||
|
|
|
@ -264,6 +264,8 @@ void send_can_battery() {
|
|||
// Check if sending of CAN messages has been delayed too much.
|
||||
if ((currentMillis - previousMillis50 >= INTERVAL_50_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
|
||||
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis50));
|
||||
} else {
|
||||
clear_event(EVENT_CAN_OVERRUN);
|
||||
}
|
||||
previousMillis50 = currentMillis;
|
||||
|
||||
|
|
|
@ -689,6 +689,8 @@ void send_can_battery() {
|
|||
// Check if sending of CAN messages has been delayed too much.
|
||||
if ((currentMillis - previousMillis100 >= INTERVAL_100_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
|
||||
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis100));
|
||||
} else {
|
||||
clear_event(EVENT_CAN_OVERRUN);
|
||||
}
|
||||
previousMillis100 = currentMillis;
|
||||
|
||||
|
|
|
@ -188,6 +188,8 @@ void send_can_battery() {
|
|||
// Check if sending of CAN messages has been delayed too much.
|
||||
if ((currentMillis - previousMillis100 >= INTERVAL_100_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
|
||||
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis100));
|
||||
} else {
|
||||
clear_event(EVENT_CAN_OVERRUN);
|
||||
}
|
||||
previousMillis100 = currentMillis;
|
||||
|
||||
|
|
|
@ -377,6 +377,8 @@ void send_can_battery() {
|
|||
// Check if sending of CAN messages has been delayed too much.
|
||||
if ((currentMillis - previousMillis500ms >= INTERVAL_500_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
|
||||
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis500ms));
|
||||
} else {
|
||||
clear_event(EVENT_CAN_OVERRUN);
|
||||
}
|
||||
previousMillis500ms = currentMillis;
|
||||
// Section added to close contractor
|
||||
|
|
|
@ -525,6 +525,8 @@ void send_can_battery() {
|
|||
// Check if sending of CAN messages has been delayed too much.
|
||||
if ((currentMillis - previousMillis10 >= INTERVAL_10_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
|
||||
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis10));
|
||||
} else {
|
||||
clear_event(EVENT_CAN_OVERRUN);
|
||||
}
|
||||
previousMillis10 = currentMillis;
|
||||
|
||||
|
|
|
@ -125,6 +125,8 @@ void send_can_battery() {
|
|||
// Check if sending of CAN messages has been delayed too much.
|
||||
if ((currentMillis - previousMillis10 >= INTERVAL_10_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
|
||||
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis10));
|
||||
} else {
|
||||
clear_event(EVENT_CAN_OVERRUN);
|
||||
}
|
||||
previousMillis10 = currentMillis;
|
||||
|
||||
|
|
|
@ -559,6 +559,8 @@ void send_can_battery() {
|
|||
// Check if sending of CAN messages has been delayed too much.
|
||||
if ((currentMillis - previousMillis10 >= INTERVAL_10_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
|
||||
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis10));
|
||||
} else {
|
||||
clear_event(EVENT_CAN_OVERRUN);
|
||||
}
|
||||
previousMillis10 = currentMillis;
|
||||
|
||||
|
|
|
@ -123,6 +123,8 @@ void send_can_battery() {
|
|||
// Check if sending of CAN messages has been delayed too much.
|
||||
if ((currentMillis - previousMillis10 >= INTERVAL_10_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
|
||||
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis10));
|
||||
} else {
|
||||
clear_event(EVENT_CAN_OVERRUN);
|
||||
}
|
||||
previousMillis10 = currentMillis;
|
||||
|
||||
|
|
|
@ -568,6 +568,8 @@ the first, for a few cycles, then stop all messages which causes the contactor
|
|||
// Check if sending of CAN messages has been delayed too much.
|
||||
if ((currentMillis - previousMillis30 >= INTERVAL_30_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
|
||||
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis30));
|
||||
} else {
|
||||
clear_event(EVENT_CAN_OVERRUN);
|
||||
}
|
||||
previousMillis30 = currentMillis;
|
||||
|
||||
|
|
|
@ -331,6 +331,8 @@ void send_can_battery() {
|
|||
// Check if sending of CAN messages has been delayed too much.
|
||||
if ((currentMillis - previousMillis100 >= INTERVAL_100_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
|
||||
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis100));
|
||||
} else {
|
||||
clear_event(EVENT_CAN_OVERRUN);
|
||||
}
|
||||
previousMillis100 = currentMillis;
|
||||
|
||||
|
|
|
@ -113,13 +113,15 @@ typedef struct {
|
|||
int64_t core_task_max_us = 0;
|
||||
/** Core task measurement variable, reset each 10 seconds */
|
||||
int64_t core_task_10s_max_us = 0;
|
||||
/** MQTT task measurement variable, reset each 10 seconds */
|
||||
/** MQTT sub-task measurement variable, reset each 10 seconds */
|
||||
int64_t mqtt_task_10s_max_us = 0;
|
||||
/** Wifi sub-task measurement variable, reset each 10 seconds */
|
||||
int64_t wifi_task_10s_max_us = 0;
|
||||
/** loop() task measurement variable, reset each 10 seconds */
|
||||
int64_t loop_task_10s_max_us = 0;
|
||||
|
||||
/** OTA/Wifi handling function measurement variable */
|
||||
int64_t time_wifi_us = 0;
|
||||
/** OTA handling function measurement variable */
|
||||
int64_t time_ota_us = 0;
|
||||
/** CAN RX or serial link function measurement variable */
|
||||
int64_t time_comm_us = 0;
|
||||
/** 10 ms function measurement variable */
|
||||
|
@ -130,9 +132,9 @@ typedef struct {
|
|||
int64_t time_cantx_us = 0;
|
||||
|
||||
/** Function measurement snapshot variable.
|
||||
* This will show the performance of OTA/Wifi handling when the total time reached a new worst case
|
||||
* This will show the performance of OTA handling when the total time reached a new worst case
|
||||
*/
|
||||
int64_t time_snap_wifi_us = 0;
|
||||
int64_t time_snap_ota_us = 0;
|
||||
/** Function measurement snapshot variable.
|
||||
* This will show the performance of CAN RX or serial link when the total time reached a new worst case
|
||||
*/
|
||||
|
|
|
@ -386,7 +386,12 @@ String processor(const String& var) {
|
|||
// Load information
|
||||
content += "<h4>Core task max load: " + String(datalayer.system.status.core_task_max_us) + " us</h4>";
|
||||
content += "<h4>Core task max load last 10 s: " + String(datalayer.system.status.core_task_10s_max_us) + " us</h4>";
|
||||
content += "<h4>MQTT task max load last 10 s: " + String(datalayer.system.status.mqtt_task_10s_max_us) + " us</h4>";
|
||||
content +=
|
||||
"<h4>MQTT function (MQTT task) max load last 10 s: " + String(datalayer.system.status.mqtt_task_10s_max_us) +
|
||||
" us</h4>";
|
||||
content +=
|
||||
"<h4>WIFI function (MQTT task) max load last 10 s: " + String(datalayer.system.status.wifi_task_10s_max_us) +
|
||||
" us</h4>";
|
||||
content +=
|
||||
"<h4>loop() task max load last 10 s: " + String(datalayer.system.status.loop_task_10s_max_us) + " us</h4>";
|
||||
content += "<h4>Max load @ worst case execution of core task:</h4>";
|
||||
|
@ -394,7 +399,7 @@ String processor(const String& var) {
|
|||
content += "<h4>5s function timing: " + String(datalayer.system.status.time_snap_5s_us) + " us</h4>";
|
||||
content += "<h4>CAN/serial RX function timing: " + String(datalayer.system.status.time_snap_comm_us) + " us</h4>";
|
||||
content += "<h4>CAN TX function timing: " + String(datalayer.system.status.time_snap_cantx_us) + " us</h4>";
|
||||
content += "<h4>Wifi and OTA function timing: " + String(datalayer.system.status.time_snap_wifi_us) + " us</h4>";
|
||||
content += "<h4>OTA function timing: " + String(datalayer.system.status.time_snap_ota_us) + " us</h4>";
|
||||
#endif
|
||||
|
||||
wl_status_t status = WiFi.status();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue