From ece6e473b7a4a08e2d82cce2049ec96143c7fcd2 Mon Sep 17 00:00:00 2001 From: LJ Date: Wed, 5 Jun 2019 07:10:47 +0200 Subject: [PATCH] Monitor for 0x3d fix --- embedded/Src/lin_slcan.c | 18 +++++++++--------- embedded/Src/slcan.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/embedded/Src/lin_slcan.c b/embedded/Src/lin_slcan.c index 63cec85..de0e1d0 100644 --- a/embedded/Src/lin_slcan.c +++ b/embedded/Src/lin_slcan.c @@ -155,14 +155,14 @@ void lin_slcan_rx_timeout_handler() lin_slcan_rx_handler(&open_lin_data_layer_frame); } else { - open_lin_data_layer_frame.lenght = slcan_lin_slave_state_data_count - 1; - /* checksum calculation */ - if (slcan_lin_data_array[open_lin_data_layer_frame.lenght] == open_lin_data_layer_checksum(open_lin_data_layer_frame.pid, - open_lin_data_layer_frame.lenght, open_lin_data_layer_frame.data_ptr)) /* TODO remove from interrupt possible function */ - { - /* valid checksum */ - lin_slcan_rx_handler(&open_lin_data_layer_frame); - } + open_lin_data_layer_frame.lenght = slcan_lin_slave_state_data_count - 1; + /* checksum calculation */ + if (slcan_lin_data_array[open_lin_data_layer_frame.lenght] == open_lin_data_layer_checksum(open_lin_data_layer_frame.pid & OPEN_LIN_ID_MASK, + open_lin_data_layer_frame.lenght, open_lin_data_layer_frame.data_ptr)) /* TODO remove from interrupt possible function */ + { + /* valid checksum */ + lin_slcan_rx_handler(&open_lin_data_layer_frame); + } } } lin_slcan_reset(); @@ -230,7 +230,7 @@ void lin_slcan_rx(l_u8 rx_byte) { open_lin_data_layer_frame.data_ptr[slcan_lin_slave_state_data_count] = rx_byte; slcan_lin_slave_state_data_count ++; - } else + } else /* 9th byte is LRC */ { open_lin_data_layer_frame.lenght = slcan_lin_slave_state_data_count; /* checksum calculation */ diff --git a/embedded/Src/slcan.h b/embedded/Src/slcan.h index 867aba3..11400f0 100644 --- a/embedded/Src/slcan.h +++ b/embedded/Src/slcan.h @@ -11,7 +11,7 @@ #include "open_lin_slave_data_layer.h" #define VERSION_FIRMWARE_MAJOR 1 -#define VERSION_FIRMWARE_MINOR 3 +#define VERSION_FIRMWARE_MINOR 4 #define VERSION_HARDWARE_MAJOR 0 #define VERSION_HARDWARE_MINOR 1