Skip to content

Commit a049755

Browse files
committed
Fix to prevent critical pins from being reset when MCU restarts or enters REPL
1 parent 420dbaf commit a049755

File tree

1 file changed

+8
-0
lines changed
  • ports/atmel-samd/boards/capablerobot_usbhub

1 file changed

+8
-0
lines changed

ports/atmel-samd/boards/capablerobot_usbhub/board.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,16 @@
2727
#include "boards/board.h"
2828
#include "mpconfigboard.h"
2929
#include "hal/include/hal_gpio.h"
30+
#include "common-hal/microcontroller/Pin.h"
3031

3132
void board_init(void) {
33+
// Don't reset:
34+
// - USB Host Enable Pin
35+
// - reset pin of the USB Hub
36+
//
37+
// If either are reset, USB devices will disconnect when the MCU restarts
38+
never_reset_pin_number(PIN_PA07);
39+
never_reset_pin_number(PIN_PB08);
3240
}
3341

3442
bool board_requests_safe_mode(void) {

0 commit comments

Comments
 (0)