Skip to content

Commit

Permalink
Update Low Speed + Serial Number
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz-Juranek committed Apr 16, 2019
1 parent bcfb1b0 commit 2e9243a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion embedded/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 */
Expand Down
3 changes: 2 additions & 1 deletion embedded/Src/slcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -239,6 +239,7 @@ void slCanCheckCommand()
break;
case 'N': // Get serial number
{

slcanSetOutputChar('N');
slcanSetOutputAsHex((uint8_t)(serialNumber));
slcanSetOutputAsHex((uint8_t)(serialNumber>>8));
Expand Down
2 changes: 1 addition & 1 deletion embedded/Src/slcan.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2e9243a

Please sign in to comment.