Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Sync issue when host sends multiple signon requests
If the host sends a signon but does not get a SYNC response it will send again. This will lead to being out of sync with data in the rx buffer that is not consumed. To avoid this we consume all extra host bytes before sending a INSYNC reply.
  • Loading branch information
f34rdotcom authored and per1234 committed Sep 26, 2020
commit d58cbe70571b7f6172014fafed63bd48abdad9c6
3 changes: 3 additions & 0 deletions examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ uint8_t spi_transaction(uint8_t a, uint8_t b, uint8_t c, uint8_t d) {

void empty_reply() {
if (CRC_EOP == getch()) {
// clear RX buffer. No more host data expected until after SYNC.
while(SERIAL.available())
SERIAL.read();
SERIAL.print((char)STK_INSYNC);
SERIAL.print((char)STK_OK);
} else {
Expand Down