mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Code cleanup
This commit is contained in:
parent
533bcc0f22
commit
c77ead8dc3
2 changed files with 2 additions and 6 deletions
|
@ -101,7 +101,7 @@
|
||||||
//#define LOG_CAN_TO_SD //Enable this line to log incoming/outgoing CAN & CAN-FD messages to SD card (WARNING, raises CPU load, do not use for production)
|
//#define LOG_CAN_TO_SD //Enable this line to log incoming/outgoing CAN & CAN-FD messages to SD card (WARNING, raises CPU load, do not use for production)
|
||||||
//#define DEBUG_VIA_USB //Enable this line to have the USB port output serial diagnostic data while program runs (WARNING, raises CPU load, do not use for production)
|
//#define DEBUG_VIA_USB //Enable this line to have the USB port output serial diagnostic data while program runs (WARNING, raises CPU load, do not use for production)
|
||||||
//#define DEBUG_VIA_WEB //Enable this line to log diagnostic data while program runs, which can be viewed via webpage (WARNING, slightly raises CPU load, do not use for production)
|
//#define DEBUG_VIA_WEB //Enable this line to log diagnostic data while program runs, which can be viewed via webpage (WARNING, slightly raises CPU load, do not use for production)
|
||||||
#define DEBUG_CAN_DATA //Enable this line to print incoming/outgoing CAN & CAN-FD messages to USB serial (WARNING, raises CPU load, do not use for production)
|
//#define DEBUG_CAN_DATA //Enable this line to print incoming/outgoing CAN & CAN-FD messages to USB serial (WARNING, raises CPU load, do not use for production)
|
||||||
|
|
||||||
/* CAN options */
|
/* CAN options */
|
||||||
//#define CAN_ADDON //Enable this line to activate an isolated secondary CAN Bus using add-on MCP2515 chip (Needed for some inverters / double battery)
|
//#define CAN_ADDON //Enable this line to activate an isolated secondary CAN Bus using add-on MCP2515 chip (Needed for some inverters / double battery)
|
||||||
|
|
|
@ -31,7 +31,7 @@ bool ota_active = false;
|
||||||
|
|
||||||
const char get_firmware_info_html[] = R"rawliteral(%X%)rawliteral";
|
const char get_firmware_info_html[] = R"rawliteral(%X%)rawliteral";
|
||||||
|
|
||||||
String importedLogs = ""; // Store the uploaded file contents in RAM /WARNING THIS MIGHT GO BOOM
|
String importedLogs = ""; // Store the uploaded file contents in RAM
|
||||||
|
|
||||||
CAN_frame currentFrame = {.FD = true, .ext_ID = false, .DLC = 64, .ID = 0x12F, .data = {0}};
|
CAN_frame currentFrame = {.FD = true, .ext_ID = false, .DLC = 64, .ID = 0x12F, .data = {0}};
|
||||||
|
|
||||||
|
@ -76,9 +76,6 @@ void canReplayTask(void* param) {
|
||||||
float lastTimestamp = 0.0;
|
float lastTimestamp = 0.0;
|
||||||
|
|
||||||
for (size_t i = 0; i < messages.size(); i++) {
|
for (size_t i = 0; i < messages.size(); i++) {
|
||||||
esp_task_wdt_reset(); // Manually reset watchdog
|
|
||||||
vTaskDelay(1); // Yield control to FreeRTOS
|
|
||||||
|
|
||||||
String line = messages[i];
|
String line = messages[i];
|
||||||
line.trim();
|
line.trim();
|
||||||
if (line.length() == 0)
|
if (line.length() == 0)
|
||||||
|
@ -134,7 +131,6 @@ void canReplayTask(void* param) {
|
||||||
(datalayer.system.info.can_replay_interface == CANFD_ADDON_MCP2518);
|
(datalayer.system.info.can_replay_interface == CANFD_ADDON_MCP2518);
|
||||||
|
|
||||||
transmit_can_frame(¤tFrame, datalayer.system.info.can_replay_interface);
|
transmit_can_frame(¤tFrame, datalayer.system.info.can_replay_interface);
|
||||||
vTaskDelay(1); // Yield control after sending frame
|
|
||||||
}
|
}
|
||||||
} while (datalayer.system.info.loop_playback);
|
} while (datalayer.system.info.loop_playback);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue