hopefully fix log messages

This commit is contained in:
Kilian Bracher 2025-05-20 01:14:57 +02:00
parent b9f937d78c
commit d86cc50caf
Signed by: k.bracher
SSH Key Fingerprint: SHA256:mXpyZkK7RDiJ7qeHCKJX108woM0cl5TrCvNBJASu6lM
3 changed files with 7 additions and 4 deletions

View File

@ -145,8 +145,10 @@ static void isotp_backend_write(const log_message_t *message) {
/* Process buffered log messages and send them via ISO-TP */
void isotp_log_process(void) {
/* Process ISO-TP updates to send any pending messages */
isotp_update();
/* Check if we have data to send */
if (message_buffer.write_pos > 0 || message_buffer.write_pos_2 > 0) {
isotp_backend_flush();
}
}
/* Flush the ISO-TP backend */

View File

@ -17,7 +17,7 @@
/* Configuration */
#define MAX_MESSAGE_LENGTH 384
#define USE_ANSI_ESCAPE_CODES true // if true, log messages will be colored according to their log level
#define USE_ANSI_ESCAPE_CODES false // if true, log messages will be colored according to their log level
#define PRINT_TIMESTAMP false // if true, timestamp (from HAL_GetTick) is printed before each log message
/* Maximum number of backends that can be registered */

View File

@ -217,6 +217,7 @@ int main(void)
int error_count = 0;
while (1)
{
isotp_log_process();
isotp_update();
//left over from slave communication test, could be nicer and in an additional function !!
if (error_count > 25) {