diff options
| author | Lucian Copeland <hierophect@gmail.com> | 2020-01-29 16:29:43 -0500 |
|---|---|---|
| committer | Lucian Copeland <hierophect@gmail.com> | 2020-01-29 16:29:43 -0500 |
| commit | 100409961aa32e84810d6c86309e66277b4ea902 (patch) | |
| tree | 927e42d1de371b1cfcd02a83a1f62ff96a818a45 | |
| parent | b9bed98538fb236dc4fa300192c59bf03ac4743b (diff) | |
Move board_init to main.c
| -rwxr-xr-x | main.c | 5 | ||||
| -rw-r--r-- | ports/atmel-samd/supervisor/port.c | 3 | ||||
| -rw-r--r-- | ports/mimxrt10xx/supervisor/port.c | 3 | ||||
| -rw-r--r-- | ports/nrf/supervisor/port.c | 3 | ||||
| -rw-r--r-- | ports/stm32f4/supervisor/port.c | 1 |
5 files changed, 5 insertions, 10 deletions
@@ -57,6 +57,8 @@ #include "supervisor/shared/stack.h" #include "supervisor/serial.h" +#include "boards/board.h" + #if CIRCUITPY_DISPLAYIO #include "shared-module/displayio/__init__.h" #endif @@ -425,6 +427,9 @@ int __attribute__((used)) main(void) { // no SPI flash filesystem, and we might erase the existing one. filesystem_init(safe_mode == NO_SAFE_MODE, false); + // displays init after filesystem, since they could share the flash SPI + board_init(); + // Reset everything and prep MicroPython to run boot.py. reset_port(); reset_board(); diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 5662b159b..dd812dfeb 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -232,9 +232,6 @@ safe_mode_t port_init(void) { // Reset everything into a known state before board_init. reset_port(); - // Init the board last so everything else is ready - board_init(); - #ifdef SAMD21 if (PM->RCAUSE.bit.BOD33 == 1 || PM->RCAUSE.bit.BOD12 == 1) { return BROWNOUT; diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 357307427..0399ee61d 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -76,9 +76,6 @@ safe_mode_t port_init(void) { // Reset everything into a known state before board_init. reset_port(); - // Init the board last so everything else is ready - board_init(); - if (board_requests_safe_mode()) { return USER_SAFE_MODE; } diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index af858aa4a..637ab8c36 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -92,9 +92,6 @@ safe_mode_t port_init(void) { rtc_init(); #endif - // Will do usb_init() if chip supports USB. - board_init(); - return NO_SAFE_MODE; } diff --git a/ports/stm32f4/supervisor/port.c b/ports/stm32f4/supervisor/port.c index df5a70cd1..19520255e 100644 --- a/ports/stm32f4/supervisor/port.c +++ b/ports/stm32f4/supervisor/port.c @@ -50,7 +50,6 @@ safe_mode_t port_init(void) { stm32f4_peripherals_gpio_init(); tick_init(); - board_init(); return NO_SAFE_MODE; } |
