From 10dde354c732126c0a1ea7e3295c4741153e339f Mon Sep 17 00:00:00 2001 From: wuyangyong Date: Wed, 20 Jan 2010 13:27:23 +0000 Subject: [PATCH] add usb_led for stm32radio git-svn-id: https://rt-thread.googlecode.com/svn/trunk@325 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- .../Libraries/Mass_Storage/inc/platform_config.h | 5 +++++ bsp/stm32_radio/Libraries/Mass_Storage/src/hw_config.c | 8 ++++++-- bsp/stm32_radio/Libraries/Mass_Storage/src/mass_mal.c | 7 ------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bsp/stm32_radio/Libraries/Mass_Storage/inc/platform_config.h b/bsp/stm32_radio/Libraries/Mass_Storage/inc/platform_config.h index f2eaf03786..1a8f7922e6 100644 --- a/bsp/stm32_radio/Libraries/Mass_Storage/inc/platform_config.h +++ b/bsp/stm32_radio/Libraries/Mass_Storage/inc/platform_config.h @@ -24,6 +24,11 @@ #define USB_DISCONNECT_PIN GPIO_Pin_7 #define RCC_APB2Periph_GPIO_DISCONNECT RCC_APB2Periph_GPIOG +/* use led: 0-NO 1-YES */ +#define USB_USE_LED 1 +#define USB_LED_PORT GPIOE +#define USB_LED_PIN GPIO_Pin_2 + #endif /* __PLATFORM_CONFIG_H */ /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/ diff --git a/bsp/stm32_radio/Libraries/Mass_Storage/src/hw_config.c b/bsp/stm32_radio/Libraries/Mass_Storage/src/hw_config.c index 61ff5c3bdc..b1fb978854 100644 --- a/bsp/stm32_radio/Libraries/Mass_Storage/src/hw_config.c +++ b/bsp/stm32_radio/Libraries/Mass_Storage/src/hw_config.c @@ -133,7 +133,9 @@ void Led_Config(void) *******************************************************************************/ void Led_RW_ON(void) { - //GPIO_SetBits(USB_LED_PORT, GPIO_Pin_8); +#if (USB_USE_LED == 1) + GPIO_SetBits(USB_LED_PORT, USB_LED_PIN); +#endif } /******************************************************************************* @@ -145,7 +147,9 @@ void Led_RW_ON(void) *******************************************************************************/ void Led_RW_OFF(void) { - //GPIO_ResetBits(USB_LED_PORT, GPIO_Pin_8); +#if (USB_USE_LED == 1) + GPIO_ResetBits(USB_LED_PORT, USB_LED_PIN); +#endif } /******************************************************************************* * Function Name : USB_Configured_LED diff --git a/bsp/stm32_radio/Libraries/Mass_Storage/src/mass_mal.c b/bsp/stm32_radio/Libraries/Mass_Storage/src/mass_mal.c index d634985bf7..67417763a1 100644 --- a/bsp/stm32_radio/Libraries/Mass_Storage/src/mass_mal.c +++ b/bsp/stm32_radio/Libraries/Mass_Storage/src/mass_mal.c @@ -93,13 +93,6 @@ uint16_t MAL_GetStatus (uint8_t lun) default: return MAL_FAIL; } -#if 0 - if(lun == 0) - { - return MAL_OK; - } - return MAL_FAIL; -#endif } /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/