Skip to content

Commit

Permalink
board: wait for unique id message from usb link on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
paradajz committed Sep 17, 2021
1 parent 62e31f1 commit 87b1710
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/board/arch/avr/common/Init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,21 @@ namespace Board
//add some delay and remove initial readout of digital inputs
core::timing::waitMs(10);
detail::io::flushInputReadings();

#ifndef USB_SUPPORTED
//wait for unique id from usb host
//this is to make sure host and the device share the same unique id
USBLink::internalCMD_t cmd;

while (1)
{
while (!Board::detail::USB::readInternal(cmd))
;

if (cmd == USBLink::internalCMD_t::uniqueID)
break;
}
#endif
#endif
}

Expand Down

0 comments on commit 87b1710

Please sign in to comment.