Skip to content

Commit 1a4e96d

Browse files
committed
fix on ack and introducing DL1 & DL2 naming
1 parent 3246c65 commit 1a4e96d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/Arduino_Alvik.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int Arduino_Alvik::begin(const bool verbose, const uint8_t core){
5656

5757
verbose_output = verbose;
5858

59-
last_ack = 0;
59+
last_ack = 255;
6060

6161
version[0] = 0;
6262
version[1] = 0;
@@ -130,9 +130,8 @@ int Arduino_Alvik::begin(const bool verbose, const uint8_t core){
130130

131131

132132
uart->begin(UART_BAUD_RATE);
133-
uart->flush();
134133

135-
134+
136135
pinMode(CHECK_STM32, INPUT_PULLDOWN);
137136
pinMode(RESET_STM32, OUTPUT);
138137
pinMode(NANO_CHK, OUTPUT);
@@ -149,6 +148,11 @@ int Arduino_Alvik::begin(const bool verbose, const uint8_t core){
149148
delay(100);
150149
reset_hw();
151150

151+
uart->flush();
152+
while (uart->available()){
153+
uart->read();
154+
}
155+
152156
wait_for_ack();
153157

154158
set_illuminator(true);

src/definitions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
#define UART 0
2828
#define UART_BAUD_RATE 460800
2929

30+
#define DL1 left_led
31+
#define DL2 right_led
32+
3033
#define CHARGE_THRESHOLD 97
3134

3235
const float WHEEL_DIAMETER_MM = 34.0;

0 commit comments

Comments
 (0)