Merge pull request #790 from TanekLiang/stm32f1l07-c99

[Bsp] update stm32f107 spi driver
This commit is contained in:
Bernard Xiong 2017-08-06 12:03:27 +08:00 committed by GitHub
commit 25d415a28c
1 changed files with 5 additions and 2 deletions

View File

@ -144,7 +144,7 @@ void DMA1_Channel4_IRQHandler(void) {
/* enter interrupt */ /* enter interrupt */
rt_interrupt_enter(); rt_interrupt_enter();
rt_event_send(&dma2.event, SPI_DMA_TX_DONE); rt_event_send(&dma2.event, SPI_DMA_TX_DONE);
DMA_ClearFlag(dma2.tx_gl_flag); DMA_ClearFlag(dma2.priv_data->tx_gl_flag);
/* leave interrupt */ /* leave interrupt */
rt_interrupt_leave(); rt_interrupt_leave();
} }
@ -418,9 +418,12 @@ rt_err_t stm32_spi_register(SPI_TypeDef * SPI,
const char * spi_bus_name) const char * spi_bus_name)
{ {
rt_err_t res = RT_EOK; rt_err_t res = RT_EOK;
#ifdef SPI_USE_DMA
NVIC_InitTypeDef NVIC_InitStructure; NVIC_InitTypeDef NVIC_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE); #endif
rt_uint32_t flags = 0; rt_uint32_t flags = 0;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
if(SPI == SPI1) if(SPI == SPI1)
{ {
stm32_spi->SPI = SPI1; stm32_spi->SPI = SPI1;