Be more careful when initing the board outside the VM.

This commit is contained in:
Scott Shawcroft 2019-03-08 15:30:05 -08:00
parent 03be42ab84
commit 37e10d4a81
No known key found for this signature in database
GPG Key ID: FD0EDC4B6C53CA59
2 changed files with 7 additions and 2 deletions

View File

@ -89,14 +89,16 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
Sercom* sercom = NULL;
uint8_t sercom_index;
uint32_t clock_pinmux = 0;
bool mosi_none = mosi == mp_const_none;
bool miso_none = miso == mp_const_none;
bool mosi_none = mosi == mp_const_none || mosi == NULL;
bool miso_none = miso == mp_const_none || miso == NULL;
uint32_t mosi_pinmux = 0;
uint32_t miso_pinmux = 0;
uint8_t clock_pad = 0;
uint8_t mosi_pad = 0;
uint8_t miso_pad = 0;
uint8_t dopo = 255;
// Special case for SAMR boards.
#ifdef PIN_PC19
if (miso == &pin_PC19) {
if (mosi == &pin_PB30 && clock == &pin_PC18) {

View File

@ -171,6 +171,9 @@ safe_mode_t port_init(void) {
init_shared_dma();
// Reset everything into a known state before board_init.
reset_port();
// Init the board last so everything else is ready
board_init();