summaryrefslogtreecommitdiff
path: root/bsp/hpmicro/hpm5100evk/applications/main.c
blob: ce90f2deffb724246525a4566ba5da876d4e8674 (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
/*
 * Copyright (c) 2021-2024 HPMicro
 *
 * Change Logs:
 * Date         Author          Notes
 * 2021-08-13   Fan YANG        first version
 *
 */

#include <rtthread.h>
#include <rtdevice.h>
#include "rtt_board.h"

void thread_entry(void *arg);

int main(void)
{
    app_init_led_pins();

    static uint32_t led_thread_arg = 0;
    rt_thread_t led_thread = rt_thread_create("led_th", thread_entry, &led_thread_arg, 1024, 1, 10);
    if (led_thread != RT_NULL)
    {
        rt_thread_startup(led_thread);
    }

    return 0;
}

void thread_entry(void *arg)
{
    while (1)
    {
        app_led_write(0, APP_LED_ON);
        rt_thread_mdelay(500);
        app_led_write(0, APP_LED_OFF);
        rt_thread_mdelay(500);
    }
}