Improvements to CAN logging to SD to significantly improve performance for busy CAN networks (#752)

- Migrate from SPI SD library to SD_MMC
- Minimise the number of individual file writes by batching writes where possible
- Write a binary stream to the buffer to stop corruption
This commit is contained in:
Matt Holmes 2025-01-05 21:01:21 +00:00 committed by GitHub
parent 33cbbd3c33
commit 1e93ad8740
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 81 additions and 66 deletions

View file

@ -112,7 +112,7 @@ void init_webserver() {
// Define the handler to export can log
server.on("/export_can_log", HTTP_GET, [](AsyncWebServerRequest* request) {
pause_can_writing();
request->send(SD, CAN_LOG_FILE, String(), true);
request->send(SD_MMC, CAN_LOG_FILE, String(), true);
resume_can_writing();
});
@ -133,7 +133,7 @@ void init_webserver() {
// Define the handler to export debug log
server.on("/export_log", HTTP_GET, [](AsyncWebServerRequest* request) {
pause_log_writing();
request->send(SD, LOG_FILE, String(), true);
request->send(SD_MMC, LOG_FILE, String(), true);
resume_log_writing();
});
#endif