1 #include <rtthread.h> 2 3 #include "led.h" 4 5 #ifdef PKG_USING_GUIENGINE 6 #include <rtgui/driver.h> 7 #endif 8 main(void)9int main(void) 10 { 11 rt_device_t device; 12 13 rt_kprintf("hello rt-thread\n"); 14 15 #ifdef PKG_USING_GUIENGINE 16 device = rt_device_find("lcd"); 17 if (device) 18 { 19 rtgui_graphic_set_device(device); 20 } 21 #endif 22 23 24 while (1) 25 { 26 /* light on leds for one second */ 27 rt_hw_led_on(LED2|LED3); 28 rt_hw_led_off(LED1|LED4); 29 rt_thread_delay(100); 30 31 /* light off leds for one second */ 32 rt_hw_led_off(LED2|LED3); 33 rt_hw_led_on(LED1|LED4); 34 rt_thread_delay(100); 35 } 36 37 return 0; 38 } 39 40 41