git-svn-id: https://rt-thread.googlecode.com/svn/trunk@127 bbd45198-f89e-11dd-88c7-29a3b14d5316
@@ -57,8 +57,16 @@ void rt_hw_led_off(rt_uint32_t n)
#ifdef RT_USING_FINSH
#include <finsh.h>
+static rt_uint8_t led_inited = 0;
void led(rt_uint32_t led, rt_uint32_t value)
{
+ /* init led configuration if it's not inited. */
+ if (!led_inited)
+ {
+ rt_hw_led_init();
+ led_inited = 1;
+ }
+
if ( led == 0 )
/* set led status */