From aa24c176e7674eb9bd528b6ebcaa714d939f6b0b Mon Sep 17 00:00:00 2001 From: "onelife.real" Date: Fri, 29 Jul 2011 07:24:09 +0000 Subject: [PATCH] *** EFM32 branch *** Modify IIC and USART drivers to avoid compiling error. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1655 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/efm32/board.h | 1 - bsp/efm32/drv_ethernet.c | 6 +++--- bsp/efm32/drv_iic.c | 4 ++-- bsp/efm32/drv_sdcard.c | 6 +++--- bsp/efm32/drv_usart.c | 8 ++++---- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/bsp/efm32/board.h b/bsp/efm32/board.h index a0c95e805e..6e91c29026 100644 --- a/bsp/efm32/board.h +++ b/bsp/efm32/board.h @@ -122,7 +122,6 @@ extern volatile rt_uint32_t rt_system_status; #define IIC_RX_BUFFER_SIZE (32) /* SECTION: ADC */ - #define ADC_CALI_REF adcRef2V5 #define ADC_CALI_CH adcSingleInpCh5 #define ADC_CONVERT_FREQUENCY (7000000) diff --git a/bsp/efm32/drv_ethernet.c b/bsp/efm32/drv_ethernet.c index 6391db5986..ca3a923613 100644 --- a/bsp/efm32/drv_ethernet.c +++ b/bsp/efm32/drv_ethernet.c @@ -1021,9 +1021,9 @@ rt_err_t efm_hw_eth_init(void) return -RT_ERROR; } -/***************************************************************************//** -* Export to FINSH -******************************************************************************/ +/******************************************************************************* + * Export to FINSH + ******************************************************************************/ #if defined(EFM32_USING_ETH_UTILS) #ifdef RT_USING_FINSH #include diff --git a/bsp/efm32/drv_iic.c b/bsp/efm32/drv_iic.c index c6eca69667..081871ca6a 100644 --- a/bsp/efm32/drv_iic.c +++ b/bsp/efm32/drv_iic.c @@ -715,14 +715,12 @@ static struct efm32_iic_device_t *rt_hw_iic_unit_init( switch (unitNumber) { case 0: - iic->lock = &iic0_lock; iic->iic_device = I2C0; iicClock = (CMU_Clock_TypeDef)cmuClock_I2C0; break; #if (I2C_COUNT > 1) case 1: - iic->lock = &iic1_lock; iic->iic_device = I2C1; iicClock = (CMU_Clock_TypeDef)cmuClock_I2C1; break; @@ -807,6 +805,7 @@ void rt_hw_iic_init(void) } /* Initialize lock for iic0 */ + iic->lock = &iic0_lock; if (rt_sem_init(iic->lock, RT_IIC0_NAME, 1, RT_IPC_FLAG_FIFO) != RT_EOK) { break; @@ -825,6 +824,7 @@ void rt_hw_iic_init(void) } /* Initialize lock for iic1 */ + iic->lock = &iic1_lock; if (rt_sem_init(iic->lock, RT_IIC1_NAME, 1, RT_IPC_FLAG_FIFO) != RT_EOK) { break; diff --git a/bsp/efm32/drv_sdcard.c b/bsp/efm32/drv_sdcard.c index 4831acf2c7..993ca30876 100644 --- a/bsp/efm32/drv_sdcard.c +++ b/bsp/efm32/drv_sdcard.c @@ -1264,9 +1264,9 @@ void efm_spiSd_deinit(void) sdcard_debug("SPISD: Deinit OK\n"); } -/***************************************************************************//** -* Export to FINSH -******************************************************************************/ +/******************************************************************************* + * Export to FINSH + ******************************************************************************/ #ifdef RT_USING_FINSH #include diff --git a/bsp/efm32/drv_usart.c b/bsp/efm32/drv_usart.c index 0b6f491c81..81547d2c69 100644 --- a/bsp/efm32/drv_usart.c +++ b/bsp/efm32/drv_usart.c @@ -499,7 +499,7 @@ static rt_size_t rt_usart_write ( true, false, (void *)&(usart->usart_device->TXDATA), - buffer, + (void *)buffer, (rt_uint32_t)(size - 1)); /* Wait, otherwise the TX buffer is overwrite */ @@ -920,21 +920,18 @@ static struct efm32_usart_device_t *rt_hw_usart_unit_init( switch (unitNumber) { case 0: - usart->lock = &usart0_lock; usart->usart_device = USART0; usartClock = (CMU_Clock_TypeDef)cmuClock_USART0; txDmaSelect = DMAREQ_USART0_TXBL; break; case 1: - usart->lock = &usart1_lock; usart->usart_device = USART1; usartClock = (CMU_Clock_TypeDef)cmuClock_USART1; txDmaSelect = DMAREQ_USART1_TXBL; break; case 2: - usart->lock = &usart2_lock; usart->usart_device = USART2; usartClock = (CMU_Clock_TypeDef)cmuClock_USART2; txDmaSelect = DMAREQ_USART2_TXBL; @@ -1161,6 +1158,7 @@ void rt_hw_usart_init(void) break; } /* Initialize lock for usart0 */ + usart->lock = &usart0_lock; if (rt_sem_init(usart->lock, RT_USART0_NAME, 1, RT_IPC_FLAG_FIFO) != RT_EOK) { break; @@ -1215,6 +1213,7 @@ void rt_hw_usart_init(void) break; } /* Initialize lock for usart1 */ + usart->lock = &usart1_lock; if (rt_sem_init(usart->lock, RT_USART1_NAME, 1, RT_IPC_FLAG_FIFO) != RT_EOK) { break; @@ -1270,6 +1269,7 @@ void rt_hw_usart_init(void) break; } /* Initialize lock for usart2 */ + usart->lock = &usart2_lock; if (rt_sem_init(usart->lock, RT_USART2_NAME, 1, RT_IPC_FLAG_FIFO) != RT_EOK) { break;