This repository has been archived on 2025-04-02. You can view files and clone it, but cannot push or open issues or pull requests.
controller-hart/User/system/lib/flow/example.c

29 lines
500 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "flow.h"
/* 1初始化一个struct flow变量 */
static struct flow fl_led;
static char led_flash(struct flow *fl)
{
FL_HEAD(fl);
for (;;)
{
FL_LOCK_DELAY(fl, FL_CLOCK_SEC * 1U); /* 延时一秒 */
led_open();
FL_LOCK_DELAY(fl, FL_CLOCK_SEC * 1U); /* 延时一秒 */
led_close();
}
FL_TAIL(fl);
}
int main(void)
{
FL_INIT(&fl_led);
for (;;)
{
led_flash(&fl_led);
// other_process();
}
return 0;
}