Skip to content

Commit

Permalink
Override restart_usb_driver for SN32 to avoid kb crash on remote wakeup
Browse files Browse the repository at this point in the history
  • Loading branch information
stdvar authored and dexter93 committed Nov 21, 2021
1 parent 7295781 commit a9fd30b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions os/hal/boards/SN_SN32F240B/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,16 @@ void __early_init(void) {
sn32_clock_init();
}


/**
* @brief Board-specific initialization code.
* @todo Add your board-specific code, if any.
*/
void boardInit(void) {

SN_SYS0->EXRSTCTRL_b.RESETDIS = 1; // Disable RESET
SN_SYS0->SWDCTRL_b.SWDDIS = 1; // Disable SWD
}

void restart_usb_driver(USBDriver *usbp) {
// Do nothing. Restarting the USB driver on these boards breaks it.
}
4 changes: 4 additions & 0 deletions os/hal/boards/SN_SN32F260/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,7 @@ void __early_init(void) {
void boardInit(void) {
SN_SYS0->SWDCTRL_b.SWDDIS = 1; // Disable SWD
}

void restart_usb_driver(USBDriver *usbp) {
// Do nothing. Restarting the USB driver on these boards breaks it.
}

0 comments on commit a9fd30b

Please sign in to comment.