移植到stm32f1,实现手动线赋码控制器功能
This commit is contained in:
@@ -1,17 +1,14 @@
|
||||
|
||||
|
||||
#include "if_rtt.h"
|
||||
#include "log.h"
|
||||
#include "stdio.h"
|
||||
#include "stdarg.h"
|
||||
#include "debug.h"
|
||||
#include "string.h"
|
||||
#ifdef RT_THREAD
|
||||
#include "rtthread.h"
|
||||
#define DBG_DEV mylog()
|
||||
#else
|
||||
#define DBG_DEV rtt()
|
||||
#endif
|
||||
#define DBG_DEV rtt()
|
||||
|
||||
|
||||
#define CONSOLEBUF_SIZE 1024
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
|
||||
// json<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Ϊjson,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱָ<CAB1><D6B8>
|
||||
// json字符串转化为json,返回临时指针
|
||||
cJSON *json_parse(const char *jstr)
|
||||
{
|
||||
cJSON *json=cJSON_Parse(jstr);
|
||||
@@ -23,7 +23,7 @@ cJSON *json_parse(const char *jstr)
|
||||
|
||||
|
||||
|
||||
/*r{ json ת<EFBFBD>б<EFBFBD> }c*/
|
||||
/*r{ json 转列表 }c*/
|
||||
list_def *jarray_to_list(cJSON *jarray,obj_def *obj)
|
||||
{
|
||||
param_check(obj);
|
||||
@@ -54,7 +54,7 @@ list_def *jarray_to_list(cJSON *jarray,obj_def *obj)
|
||||
}
|
||||
|
||||
|
||||
/*r{ jsonת<EFBFBD><EFBFBD><EFBFBD><EFBFBD> }c*/
|
||||
/*r{ json转整形 }c*/
|
||||
static void *json_to_int(cJSON *j)
|
||||
{
|
||||
if(j->type==cJSON_Number)
|
||||
@@ -90,7 +90,7 @@ obj_def *obj_int(void)
|
||||
|
||||
|
||||
|
||||
/*r{ jsonת<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD> }c*/
|
||||
/*r{ json转字符串 }c*/
|
||||
static void *json_to_str(cJSON *j)
|
||||
{
|
||||
if(j->type==cJSON_String)
|
||||
@@ -157,7 +157,7 @@ obj_def *obj_range(void)
|
||||
return &g_obj_range;
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD>ڷ<EFBFBD>Χ<EFBFBD><EFBFBD>
|
||||
// 返回1,在范围内
|
||||
int range_in_range(sch_range *r,int num)
|
||||
{
|
||||
if(num>=r->min&&num<=r->max)
|
||||
@@ -224,7 +224,7 @@ obj_def *obj_task(void)
|
||||
return &g_obj_task;
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 任务转化为数组
|
||||
array_def *task_to_array(sch_task *t)
|
||||
{
|
||||
array_def *a=arr_creat();
|
||||
@@ -255,7 +255,7 @@ array_def *task_to_array(sch_task *t)
|
||||
|
||||
|
||||
|
||||
// ack==0<EFBFBD>ɹ<EFBFBD>
|
||||
// ack==0成功
|
||||
task_returns *task_check_returns(sch_task *t,int ack,array_def *data)
|
||||
{
|
||||
int size=sizeof(task_returns)+sizeof(reurn_item)*t->return_num;
|
||||
@@ -335,7 +335,7 @@ obj_def *obj_errcode(void)
|
||||
return &g_obj_errcode;
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD>ڷ<EFBFBD>Χ<EFBFBD><EFBFBD>
|
||||
// 返回1在范围内
|
||||
int errcode_in_range(sch_errcode *e,int subcode)
|
||||
{
|
||||
param_check(e);
|
||||
@@ -413,7 +413,7 @@ void scheme_delete(scheme_def *s)
|
||||
}
|
||||
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>idת<EFBFBD><EFBFBD>Ϊ<EFBFBD>ֽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 任务id转化为字节数据
|
||||
#define TASKSID_MAX_SIZE 0x100
|
||||
static array_def *scheme_taskid_to_array(scheme_def *s)
|
||||
{
|
||||
@@ -438,7 +438,7 @@ static array_def *scheme_taskid_to_array(scheme_def *s)
|
||||
return res;
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Ϊ<EFBFBD>ֽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 任务转化为字节数据
|
||||
#define TASKS_MAX_SIZE (0x700-4)
|
||||
static array_def *scheme_tasks_to_array(scheme_def *s)
|
||||
{
|
||||
@@ -462,7 +462,7 @@ static array_def *scheme_tasks_to_array(scheme_def *s)
|
||||
return res;
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Ϊ<EFBFBD>ֽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 方案转化为字节数据
|
||||
array_def *scheme_to_byte_array(scheme_def *s)
|
||||
{
|
||||
param_check(s);
|
||||
@@ -479,7 +479,7 @@ array_def *scheme_to_byte_array(scheme_def *s)
|
||||
}
|
||||
|
||||
|
||||
// ͳ<EFBFBD>Ʒ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>
|
||||
// 统计返回数据长度
|
||||
int scheme_get_returns_num(scheme_def *s)
|
||||
{
|
||||
int num=0;
|
||||
@@ -491,7 +491,7 @@ int scheme_get_returns_num(scheme_def *s)
|
||||
return num;
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>1ʧ<EFBFBD><EFBFBD>
|
||||
// 返回0成功,1失败
|
||||
int scheme_check_ack(array_def *data,int index)
|
||||
{
|
||||
param_check(index>=0);
|
||||
@@ -501,7 +501,7 @@ int scheme_check_ack(array_def *data,int index)
|
||||
{return 1;}else{return 0;}
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܷ<EFBFBD><EFBFBD><EFBFBD>0
|
||||
// 返回子错误所在的主错误,失败返回0
|
||||
int scheme_fine_majercode(scheme_def *s,int subcode)
|
||||
{
|
||||
for(int i=0;i<list_length(s->errs);i++)
|
||||
@@ -514,7 +514,7 @@ int scheme_fine_majercode(scheme_def *s,int subcode)
|
||||
}
|
||||
|
||||
|
||||
// <EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 判定检测数据
|
||||
scheme_returns *scheme_check_returns(scheme_def *s,array_def *data)
|
||||
{
|
||||
int size=0;
|
||||
|
@@ -19,7 +19,7 @@
|
||||
DBG_WARN("%s not a int value.",#j);\
|
||||
}}
|
||||
|
||||
// <EFBFBD><EFBFBD>ȡ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>v==0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
|
||||
// 获取字符串,如果v==0会申请内存
|
||||
#define JSON_GET_STR(j,v) {\
|
||||
if(j->type==cJSON_String)\
|
||||
{\
|
||||
@@ -41,7 +41,7 @@ typedef struct {
|
||||
json_to_obj to_obj_fun;
|
||||
del_obj del_fun;
|
||||
|
||||
// <EFBFBD><EFBFBD>Щ<EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD>Ļص<EFBFBD>
|
||||
// 这些是列表的回调
|
||||
sub_fun_def sub;
|
||||
del_fun_def del;
|
||||
}obj_def;
|
||||
@@ -56,7 +56,7 @@ cJSON *json_parse(const char *jstr);/*temp_ptr*/
|
||||
|
||||
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ
|
||||
// 参数范围
|
||||
typedef struct {
|
||||
int max;
|
||||
int min;
|
||||
@@ -67,7 +67,7 @@ int range_in_range(sch_range *r,int num);
|
||||
|
||||
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 任务
|
||||
typedef struct{
|
||||
char *brief;
|
||||
int task_id;
|
||||
@@ -107,7 +107,7 @@ task_returns *task_check_returns(sch_task *t,int ack,array_def *data);
|
||||
|
||||
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 主错误代码
|
||||
typedef struct{
|
||||
int err;
|
||||
char *info;
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
|
||||
// json<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Ϊjson,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱָ<CAB1><D6B8>
|
||||
// json字符串转化为json,返回临时指针
|
||||
cJSON *json_parse(const char *jstr)
|
||||
{
|
||||
cJSON *json=cJSON_Parse(jstr);
|
||||
@@ -23,7 +23,7 @@ cJSON *json_parse(const char *jstr)
|
||||
|
||||
|
||||
|
||||
/*r{ json ת<EFBFBD>б<EFBFBD> }c*/
|
||||
/*r{ json 转列表 }c*/
|
||||
list_def *jarray_to_list(cJSON *jarray,obj_def *obj)
|
||||
{
|
||||
param_check(obj);
|
||||
@@ -54,7 +54,7 @@ list_def *jarray_to_list(cJSON *jarray,obj_def *obj)
|
||||
}
|
||||
|
||||
|
||||
/*r{ jsonת<EFBFBD><EFBFBD><EFBFBD><EFBFBD> }c*/
|
||||
/*r{ json转整形 }c*/
|
||||
static void *json_to_int(cJSON *j)
|
||||
{
|
||||
if(j->type==cJSON_Number)
|
||||
@@ -90,7 +90,7 @@ obj_def *obj_int(void)
|
||||
|
||||
|
||||
|
||||
/*r{ jsonת<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD> }c*/
|
||||
/*r{ json转字符串 }c*/
|
||||
static void *json_to_str(cJSON *j)
|
||||
{
|
||||
if(j->type==cJSON_String)
|
||||
@@ -157,7 +157,7 @@ obj_def *obj_range(void)
|
||||
return &g_obj_range;
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD>ڷ<EFBFBD>Χ<EFBFBD><EFBFBD>
|
||||
// 返回1,在范围内
|
||||
int range_in_range(sch_range *r,int num)
|
||||
{
|
||||
if(num>=r->min&&num<=r->max)
|
||||
@@ -224,7 +224,7 @@ obj_def *obj_task(void)
|
||||
return &g_obj_task;
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 任务转化为数组
|
||||
array_def *task_to_array(sch_task *t)
|
||||
{
|
||||
array_def *a=arr_creat();
|
||||
@@ -255,7 +255,7 @@ array_def *task_to_array(sch_task *t)
|
||||
|
||||
|
||||
|
||||
// ack==0<EFBFBD>ɹ<EFBFBD>
|
||||
// ack==0成功
|
||||
task_returns *task_check_returns(sch_task *t,int ack,array_def *data)
|
||||
{
|
||||
int size=sizeof(task_returns)+sizeof(reurn_item)*t->return_num;
|
||||
@@ -335,7 +335,7 @@ obj_def *obj_errcode(void)
|
||||
return &g_obj_errcode;
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD>ڷ<EFBFBD>Χ<EFBFBD><EFBFBD>
|
||||
// 返回1在范围内
|
||||
int errcode_in_range(sch_errcode *e,int subcode)
|
||||
{
|
||||
param_check(e);
|
||||
@@ -413,7 +413,7 @@ void scheme_delete(scheme_def *s)
|
||||
}
|
||||
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>idת<EFBFBD><EFBFBD>Ϊ<EFBFBD>ֽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 任务id转化为字节数据
|
||||
#define TASKSID_MAX_SIZE 0x100
|
||||
static array_def *scheme_taskid_to_array(scheme_def *s)
|
||||
{
|
||||
@@ -438,7 +438,7 @@ static array_def *scheme_taskid_to_array(scheme_def *s)
|
||||
return res;
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Ϊ<EFBFBD>ֽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 任务转化为字节数据
|
||||
#define TASKS_MAX_SIZE (0x700-4)
|
||||
static array_def *scheme_tasks_to_array(scheme_def *s)
|
||||
{
|
||||
@@ -462,7 +462,7 @@ static array_def *scheme_tasks_to_array(scheme_def *s)
|
||||
return res;
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Ϊ<EFBFBD>ֽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 方案转化为字节数据
|
||||
array_def *scheme_to_byte_array(scheme_def *s)
|
||||
{
|
||||
param_check(s);
|
||||
@@ -479,7 +479,7 @@ array_def *scheme_to_byte_array(scheme_def *s)
|
||||
}
|
||||
|
||||
|
||||
// ͳ<EFBFBD>Ʒ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>
|
||||
// 统计返回数据长度
|
||||
int scheme_get_returns_num(scheme_def *s)
|
||||
{
|
||||
int num=0;
|
||||
@@ -491,7 +491,7 @@ int scheme_get_returns_num(scheme_def *s)
|
||||
return num;
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>1ʧ<EFBFBD><EFBFBD>
|
||||
// 返回0成功,1失败
|
||||
int scheme_check_ack(array_def *data,int index)
|
||||
{
|
||||
param_check(index>=0);
|
||||
@@ -501,7 +501,7 @@ int scheme_check_ack(array_def *data,int index)
|
||||
{return 1;}else{return 0;}
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܷ<EFBFBD><EFBFBD><EFBFBD>0
|
||||
// 返回子错误所在的主错误,失败返回0
|
||||
int scheme_fine_majercode(scheme_def *s,int subcode)
|
||||
{
|
||||
for(int i=0;i<list_length(s->errs);i++)
|
||||
@@ -514,7 +514,7 @@ int scheme_fine_majercode(scheme_def *s,int subcode)
|
||||
}
|
||||
|
||||
|
||||
// <EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 判定检测数据
|
||||
scheme_returns *scheme_check_returns(scheme_def *s,array_def *data)
|
||||
{
|
||||
int size=0;
|
||||
|
@@ -19,7 +19,7 @@
|
||||
DBG_WARN("%s not a int value.",#j);\
|
||||
}}
|
||||
|
||||
// <EFBFBD><EFBFBD>ȡ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>v==0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
|
||||
// 获取字符串,如果v==0会申请内存
|
||||
#define JSON_GET_STR(j,v) {\
|
||||
if(j->type==cJSON_String)\
|
||||
{\
|
||||
@@ -41,7 +41,7 @@ typedef struct {
|
||||
json_to_obj to_obj_fun;
|
||||
del_obj del_fun;
|
||||
|
||||
// <EFBFBD><EFBFBD>Щ<EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD>Ļص<EFBFBD>
|
||||
// 这些是列表的回调
|
||||
sub_fun_def sub;
|
||||
del_fun_def del;
|
||||
}obj_def;
|
||||
@@ -56,7 +56,7 @@ cJSON *json_parse(const char *jstr);/*temp_ptr*/
|
||||
|
||||
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ
|
||||
// 参数范围
|
||||
typedef struct {
|
||||
int max;
|
||||
int min;
|
||||
@@ -67,7 +67,7 @@ int range_in_range(sch_range *r,int num);
|
||||
|
||||
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 任务
|
||||
typedef struct{
|
||||
char *brief;
|
||||
int task_id;
|
||||
@@ -107,7 +107,7 @@ task_returns *task_check_returns(sch_task *t,int ack,array_def *data);
|
||||
|
||||
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 主错误代码
|
||||
typedef struct{
|
||||
int err;
|
||||
char *info;
|
||||
|
@@ -22,7 +22,7 @@ typedef struct
|
||||
|
||||
|
||||
|
||||
#define SRAM_USER_SIZE (80*1024)
|
||||
#define SRAM_USER_SIZE (18*1024)
|
||||
#define MEM_BLOCK_SIZE (32)
|
||||
#define MEM_MAX_SIZE (((SRAM_USER_SIZE))*MEM_BLOCK_SIZE/(MEM_BLOCK_SIZE+2))
|
||||
#define MEM_ALLOC_TABLE_SIZE ((MEM_MAX_SIZE/MEM_BLOCK_SIZE)&(~3))
|
||||
@@ -192,6 +192,37 @@ void *realloc(void *p,size_t size)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void *malloc(size_t size)
|
||||
{
|
||||
return rt_malloc_align(size,4);
|
||||
}
|
||||
void *calloc(size_t nmemb,size_t size)
|
||||
{
|
||||
return rt_calloc(nmemb,size);
|
||||
}
|
||||
void *realloc(void *p,size_t size)
|
||||
{
|
||||
return rt_realloc(p,size);
|
||||
}
|
||||
static void self_free(void *p)
|
||||
{
|
||||
rt_free(p);
|
||||
}
|
||||
|
||||
void mem_init(void)
|
||||
{
|
||||
}
|
||||
int mem_perused(void)
|
||||
{
|
||||
uint32_t used,total,max_used;
|
||||
rt_memory_info(&total,&used,&max_used);
|
||||
return used;
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#define MEM_TEMP_PTR_NUM 800
|
||||
typedef void (*del_fun_def)(void *t);
|
||||
@@ -318,12 +349,9 @@ void *tmalloc(uint32_t size)
|
||||
// 把指针添加为临时指针
|
||||
void *tappend(void *p,void *del)
|
||||
{
|
||||
mallco_dev *self=&g_self;
|
||||
temp_def *t=&g_tempptr;
|
||||
void *ret=NULL;
|
||||
rt_mutex_take(t->mutex,RT_WAITING_FOREVER);
|
||||
if(((uint32_t)p>=(uint32_t)self->membase)&&
|
||||
((uint32_t)p<(uint32_t)(self->membase+self->memsize)))
|
||||
{
|
||||
if(tempptr_find(t,p)==0)
|
||||
{
|
||||
@@ -340,7 +368,6 @@ void *tappend(void *p,void *del)
|
||||
void free(void *p)
|
||||
{
|
||||
if(p==NULL) return;
|
||||
mallco_dev *self=&g_self;
|
||||
temp_def *t=&g_tempptr;
|
||||
int ret=0;
|
||||
rt_mutex_take(t->mutex,RT_WAITING_FOREVER);
|
||||
|
@@ -11,7 +11,7 @@ int mem_perused(void);
|
||||
|
||||
void tempptr_init(void);
|
||||
|
||||
void *tmalloc(uint32_t size);
|
||||
void *tmalloc(size_t size);
|
||||
|
||||
void *tappend(void *p,void *del);
|
||||
|
||||
|
@@ -78,9 +78,9 @@ sig_thread thread_creat(int pro)
|
||||
slot_run_def *run=calloc(1,sizeof(slot_run_def));
|
||||
run->run=1;
|
||||
sprintf(name,"sig_mq#%d",count);
|
||||
run->mb=rt_mq_create(name,(sizeof(slot_msg_def)+sizeof(uint32_t)*8),100,RT_IPC_FLAG_FIFO);
|
||||
run->mb=rt_mq_create(name,(sizeof(slot_msg_def)+sizeof(uint32_t)*8),30,RT_IPC_FLAG_FIFO);
|
||||
sprintf(name,"sig_t#%d",count);
|
||||
rt_thread_t rt_t=rt_thread_create(name,slot_run,run,2048,pro,20);
|
||||
rt_thread_t rt_t=rt_thread_create(name,slot_run,run,1024,pro,20);
|
||||
rt_thread_startup(rt_t);
|
||||
count++;
|
||||
return run->mb;
|
||||
|
Reference in New Issue
Block a user