使用赋码仪主板 app升级,方案升级验证通过
This commit is contained in:
@@ -19,9 +19,11 @@
|
||||
// 接收buff大小
|
||||
#define RECV_BUFF_SIZE 300
|
||||
|
||||
// 最大接收信号个数
|
||||
#define RECV_SEM_MAX_NUM 10
|
||||
|
||||
|
||||
|
||||
// 接收数据超时时间
|
||||
#define RECV_EXPIRE_TIME 100
|
||||
|
||||
|
||||
|
||||
@@ -87,7 +89,11 @@ static void recv_end_irq(void *t,uint32_t len)
|
||||
protu_def *p=t;
|
||||
p->num_to_recv=len;
|
||||
p->buff_index=len;
|
||||
rt_sem_release(p->sem);
|
||||
p->sem_num++;
|
||||
if(p->sem_num<RECV_SEM_MAX_NUM){
|
||||
rt_sem_release(p->sem);
|
||||
p->recv_tick=rt_tick_get();
|
||||
}
|
||||
}
|
||||
|
||||
array_def *protu_decode_str(protu_def *p,array_def *data);
|
||||
@@ -159,9 +165,21 @@ static void protu_run(void *t)
|
||||
protu_def *p=t;
|
||||
array_def *data;
|
||||
array_def *decode_data;
|
||||
uint32_t tick_now;
|
||||
while(p->run)
|
||||
{
|
||||
rt_sem_take(p->sem,RT_WAITING_FOREVER);
|
||||
p->sem_num=0;
|
||||
if(p->buff_index==0){
|
||||
continue;
|
||||
}
|
||||
tick_now=rt_tick_get();
|
||||
if(tick_now-p->recv_tick>RECV_EXPIRE_TIME){
|
||||
DBG_LOG("recv data expired.");
|
||||
p->num_to_recv=0;
|
||||
p->buff_index=0;
|
||||
continue;
|
||||
}
|
||||
//DBG_LOG("protu run");
|
||||
data=arr_creat();
|
||||
arr_appends(data,p->buff,p->buff_index);
|
||||
|
Reference in New Issue
Block a user