diff --git a/embedded/Src/main.c b/embedded/Src/main.c index 96ade65..3295052 100644 --- a/embedded/Src/main.c +++ b/embedded/Src/main.c @@ -76,7 +76,8 @@ void MX_USART1_UART_Init(void); /* USER CODE END PFP */ /* USER CODE BEGIN 0 */ -uint32_t serialNumber =0; +const uint32_t *uid = (uint32_t *)(UID_BASE); +uint32_t serialNumber = 0; uint8_t Uart2RxFifo; uint32_t lin_baund_rate = 19200; #define UART_RX_FIFO_SIZE 1 @@ -95,6 +96,7 @@ void bootloaderSwitcher(); int main(void) { + serialNumber = uid[0] ^ uid[1] ^ uid[2]; /* USER CODE BEGIN 1 */ bootloaderSwitcher(); /* USER CODE END 1 */ diff --git a/embedded/Src/slcan.c b/embedded/Src/slcan.c index 196f95c..4d04d98 100644 --- a/embedded/Src/slcan.c +++ b/embedded/Src/slcan.c @@ -207,7 +207,7 @@ void slCanCheckCommand() case 'G': case 'W': case 's': - if (line[0] == '2') + if (line[1] == '2') { lin_baund_rate = 9600; } else @@ -239,6 +239,7 @@ void slCanCheckCommand() break; case 'N': // Get serial number { + slcanSetOutputChar('N'); slcanSetOutputAsHex((uint8_t)(serialNumber)); slcanSetOutputAsHex((uint8_t)(serialNumber>>8)); diff --git a/embedded/Src/slcan.h b/embedded/Src/slcan.h index 852719c..867aba3 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 2 +#define VERSION_FIRMWARE_MINOR 3 #define VERSION_HARDWARE_MAJOR 0 #define VERSION_HARDWARE_MINOR 1