Move board_init to main.c

This commit is contained in:
Lucian Copeland 2020-01-29 16:29:43 -05:00
parent b9bed98538
commit 100409961a
5 changed files with 5 additions and 10 deletions

5
main.c
View File

@ -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();

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -50,7 +50,6 @@ safe_mode_t port_init(void) {
stm32f4_peripherals_gpio_init();
tick_init();
board_init();
return NO_SAFE_MODE;
}