summaryrefslogtreecommitdiff
path: root/bsp/mini2440/applications/main.c
blob: 94a3f4ccea76ad1ac34fbde71578ff86de8095fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <rtthread.h>

#include "led.h"

#ifdef PKG_USING_GUIENGINE
#include <rtgui/driver.h>
#endif

int main(void)
{
    rt_device_t device;

    printf("hello rt-thread\n");

#ifdef PKG_USING_GUIENGINE
    device = rt_device_find("lcd");
    if (device)
    {
        rtgui_graphic_set_device(device);
    }
#endif


    while (1)
    {
        /* light on leds for one second */
        rt_hw_led_on(LED2|LED3);
        rt_hw_led_off(LED1|LED4);
        rt_thread_delay(100);
    
        /* light off leds for one second */
        rt_hw_led_off(LED2|LED3);
        rt_hw_led_on(LED1|LED4);
        rt_thread_delay(100);
    }   

    return 0;
}