Compare commits

..

7 Commits

Author SHA1 Message Date
5a6f678fbf
merge CAN fixup from master-test 2025-05-17 22:23:39 +02:00
4be1355c40
add minimum duration of 1 sec for precharge 2025-05-16 23:10:07 +02:00
aa85867083
cleanup part 5 2025-05-09 19:09:41 +02:00
1edc8d3e1c
cleanup part 4 2025-05-09 14:49:16 +02:00
d4dc7e4533
cleanup part 3 2025-05-09 02:08:11 +02:00
686e26b609
cleanup part 2 2025-05-09 00:34:08 +02:00
2c0d7350e3
cleanup part 1 2025-05-07 23:44:38 +02:00
4 changed files with 6 additions and 9 deletions

View File

@ -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 */

View File

@ -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 */

View File

@ -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) {

View File

@ -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());