修改文件目录

This commit is contained in:
sc committed 2025-11-26 01:21:28 +08:00
1 parent f9c5fd9fc3
commit 6b977b2c62
14 files changed
+16 -4

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
#include <light/RUN_LED.h>
#include"drv_common.h"
#define LED_PIN GET_PIN(B,1)
/* 线程 1 的入口函数 */
void RUN_LED(void *parameter)
{
rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT);
while (1)
{
rt_pin_write(LED_PIN, PIN_HIGH);
rt_thread_mdelay(500);
rt_pin_write(LED_PIN, PIN_LOW);
rt_thread_mdelay(500);
}
}
/* 线程 */
void thread_RUN_LED(void)
{
/* 初始化线程 1,名称是 thread1,入口是 thread1_entry*/
rt_thread_t tid;
tid = rt_thread_create("run_led", RUN_LED, RT_NULL, 256, 3, 10);
if (tid != RT_NULL)
{
rt_thread_startup(tid);
}
else
{
rt_kprintf("Failed to create led thread!\n");
}
// return 0;
}
+15
View File
@@ -0,0 +1,15 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2025-10-19 Administrator the first version
*/
#ifndef APPLICATIONS_RUN_LED_RUN_LED_H_
#define APPLICATIONS_RUN_LED_RUN_LED_H_
void thread_RUN_LED(void);
#endif /* APPLICATIONS_RUN_LED_RUN_LED_H_ */