X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Flpc%2Fao_spi_lpc.c;h=a889137cbb7a4e1f84437f601d76e78f8cc22ce8;hb=1fa3ff9ba6d04303b3de6952675532492c85182f;hp=12d448723cdb81cb722c64ea06df140622ada329;hpb=b9bb088a36fd351809f4c378356327ffa663c974;p=fw%2Faltos diff --git a/src/lpc/ao_spi_lpc.c b/src/lpc/ao_spi_lpc.c index 12d44872..a889137c 100644 --- a/src/lpc/ao_spi_lpc.c +++ b/src/lpc/ao_spi_lpc.c @@ -42,7 +42,7 @@ static uint8_t spi_dev_null; /* recv a byte */ \ get lpc_ssp->dr; \ } \ - } while (0); + } while (0) void ao_spi_send(void *block, uint16_t len, uint8_t id) @@ -182,7 +182,7 @@ ao_spi_init(void) #endif #if SPI_MOSI1_P0_21 - lpc_ioconf.pio1_21 = ao_lpc_alternate(LPC_IOCONF_FUNC_PIO0_21_MOSI1); + lpc_ioconf.pio0_21 = ao_lpc_alternate(LPC_IOCONF_FUNC_PIO0_21_MOSI1); #define HAS_MOSI1 #endif #if SPI_MOSI1_P1_22 @@ -199,7 +199,8 @@ ao_spi_init(void) /* Turn on the clock */ lpc_scb.ssp1clkdiv = 1; - /* De-assert reset */ + /* Reset the device */ + lpc_scb.presetctrl &= ~(1 << LPC_SCB_PRESETCTRL_SSP1_RST_N); lpc_scb.presetctrl |= (1 << LPC_SCB_PRESETCTRL_SSP1_RST_N); ao_spi_channel_init(1); #endif /* HAS_SPI_1 */