Browse Source

add usb_led for stm32radio

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@325 bbd45198-f89e-11dd-88c7-29a3b14d5316
wuyangyong 15 years ago
parent
commit
10dde354c7

+ 5 - 0
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****/

+ 6 - 2
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

+ 0 - 7
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****/