gateway/Software/Thread/Rs485.c

48 lines
827 B
C

/*
* Rs485.c
*
* Created on: 2024年5月18日
* Author: 34509
*/
#include "Thread/Rs485.h"
/* 定义线程控制块指针 */
static rt_thread_t Rs485_thread = RT_NULL;
/* 函数声明 */
static void Rs485_thread_entry(void* parameter);
void Rs485_thread_Init(void)
{
Rs485_thread = /* 线程控制块指针 */
rt_thread_create( "led", /* 线程名字 */
Rs485_thread_entry, /* 线程入口函数 */
RT_NULL, /* 线程入口函数参数 */
512, /* 线程栈大小 */
10, /* 线程的优先级 */
20); /* 线程时间片 */
/* 启动线程,开启调度 */
if (Rs485_thread != RT_NULL)
rt_thread_startup(Rs485_thread);
else
return;
}
void Rs485_thread_entry(void* parameter)
{
while (1) {
broadcast_Scan_Fun(J5_0_USART);
rt_thread_mdelay(3000);
}
}