diff options
| author | Chris Osterwood <osterwood@gmail.com> | 2019-05-14 15:23:33 -0400 |
|---|---|---|
| committer | Chris Osterwood <osterwood@gmail.com> | 2019-05-14 15:23:33 -0400 |
| commit | a0497553fc301aed928bf51c6f6639dd96ae97c7 (patch) | |
| tree | 3813ac095558a6b904effe327a7412bde84d1d10 | |
| parent | 420dbafa9dd24eae2800ddc1f2ddabc1469f0b98 (diff) | |
Fix to prevent critical pins from being reset when MCU restarts or enters REPL
| -rw-r--r-- | ports/atmel-samd/boards/capablerobot_usbhub/board.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ports/atmel-samd/boards/capablerobot_usbhub/board.c b/ports/atmel-samd/boards/capablerobot_usbhub/board.c index 0f60736a2..9a19e02d1 100644 --- a/ports/atmel-samd/boards/capablerobot_usbhub/board.c +++ b/ports/atmel-samd/boards/capablerobot_usbhub/board.c @@ -27,8 +27,16 @@ #include "boards/board.h" #include "mpconfigboard.h" #include "hal/include/hal_gpio.h" +#include "common-hal/microcontroller/Pin.h" void board_init(void) { + // Don't reset: + // - USB Host Enable Pin + // - reset pin of the USB Hub + // + // If either are reset, USB devices will disconnect when the MCU restarts + never_reset_pin_number(PIN_PA07); + never_reset_pin_number(PIN_PB08); } bool board_requests_safe_mode(void) { |
