From a599ab3b62caeb0470d60615f2caf027d620970c Mon Sep 17 00:00:00 2001 From: wuyangyong Date: Fri, 23 Oct 2009 06:16:38 +0000 Subject: [PATCH] fix the led_examples_project git-svn-id: https://rt-thread.googlecode.com/svn/trunk@127 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/stm3210/led.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bsp/stm3210/led.c b/bsp/stm3210/led.c index 9e387ba375..c635bf64bd 100644 --- a/bsp/stm3210/led.c +++ b/bsp/stm3210/led.c @@ -57,8 +57,16 @@ void rt_hw_led_off(rt_uint32_t n) #ifdef RT_USING_FINSH #include +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 */