summaryrefslogtreecommitdiff
path: root/bsp/stm32/stm32f429-armfly-v6/applications/main.c
blob: e773a6ea31b6b4f8ac2733a57a386963012e76d2 (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
44
/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2018-12-18     zylx         first version
 */

#include <rtthread.h>
#ifndef RT_USING_NANO
#include <rtdevice.h>
#endif
#include <board.h>
#include <drv_ext_io.h>

int main(void)
{
#ifndef RT_USING_NANO
    HC574_SetPin(LED1,0);
    HC574_SetPin(LED2,0);
    HC574_SetPin(LED3,0);
    HC574_SetPin(LED4,0);

    while (1)
    {
        HC574_SetPin(LED1,1);
        rt_thread_mdelay(500);
        HC574_SetPin(LED1,0);
        rt_thread_mdelay(500);
    }
#else
#define LED_PB_8 GET_PIN(B, 8)
    rt_pin_mode(LED_PB_8, PIN_MODE_OUTPUT);
    while (1)
    {
        rt_pin_write(LED_PB_8, PIN_HIGH);
        rt_thread_mdelay(500);
        rt_pin_write(LED_PB_8, PIN_LOW);
        rt_thread_mdelay(500);
    }
#endif
}