Compare commits
7 Commits
dd4d17c133
...
5a6f678fbf
Author | SHA1 | Date | |
---|---|---|---|
5a6f678fbf | |||
4be1355c40 | |||
aa85867083 | |||
1edc8d3e1c | |||
d4dc7e4533 | |||
686e26b609 | |||
2c0d7350e3 |
@ -28,7 +28,7 @@ static bool buffer_message(const log_message_t* message) {
|
||||
if (message == NULL || message->message_length == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* Check if we have enough space - select the appropriate buffer */
|
||||
uint32_t* write_pos = using_buffer_2 ? &message_buffer.write_pos_2 : &message_buffer.write_pos;
|
||||
|
||||
@ -145,10 +145,8 @@ 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) {
|
||||
/* Check if we have data to send */
|
||||
if (message_buffer.write_pos > 0 || message_buffer.write_pos_2 > 0) {
|
||||
isotp_backend_flush();
|
||||
}
|
||||
/* Process ISO-TP updates to send any pending messages */
|
||||
isotp_update();
|
||||
}
|
||||
|
||||
/* Flush the ISO-TP backend */
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
/* Configuration */
|
||||
#define MAX_MESSAGE_LENGTH 384
|
||||
#define USE_ANSI_ESCAPE_CODES false // if true, log messages will be colored according to their log level
|
||||
#define USE_ANSI_ESCAPE_CODES true // 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 */
|
||||
|
@ -217,7 +217,6 @@ 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) {
|
||||
|
@ -67,7 +67,7 @@ void print_master_status() {
|
||||
swo_write(" Module data: Min V | Max V | Min T | Max T");
|
||||
for (size_t i = 0; i < N_BMS; i++) {
|
||||
auto module_data = getModuleMinMax(i);
|
||||
/* #if USE_ANSI_ESCAPE_CODES
|
||||
#if USE_ANSI_ESCAPE_CODES
|
||||
#define COLOR_MIN "\033[38;5;75m" //blue for min
|
||||
#define COLOR_MAX "\033[38;5;203m" //red for max
|
||||
#define COLOR_RESET "\033[0m"
|
||||
@ -80,7 +80,7 @@ void print_master_status() {
|
||||
swo_write(" %2zu: %5d mV | %5d mV | %3d °C | %3d °C", i,
|
||||
module_data.min_v, module_data.max_v,
|
||||
module_data.min_t, module_data.max_t);
|
||||
#endif */
|
||||
#endif
|
||||
}
|
||||
|
||||
swo_write("\n------ Updated at %lu ------", HAL_GetTick());
|
||||
|
Loading…
x
Reference in New Issue
Block a user