pref: 更改通信帧接收完成回调函数格式
This commit is contained in:
@@ -10,7 +10,7 @@ uint8_t listern_flag;
|
||||
uint16_t listern_timeout;
|
||||
uint16_t listern_timevia;
|
||||
by_tf_parse_frame_t frame_now;
|
||||
by_tf_parse_success_handle_func parse_success_handle;
|
||||
by_tf_parse_done_handle_func parse_done_handle;
|
||||
|
||||
void by_tiny_frame_parse_init(void)
|
||||
{
|
||||
@@ -104,6 +104,7 @@ void by_tiny_frame_parse_run(void)
|
||||
} else {
|
||||
if (listern_timeout <= listern_timevia) {
|
||||
// 接收超时,停止监听
|
||||
parse_done_handle(1);
|
||||
by_tiny_frame_parse_end_listern();
|
||||
#if (BY_TF_DEBUG)
|
||||
printf("by_tf_listern timeout\r\n");
|
||||
@@ -126,7 +127,7 @@ void by_tiny_frame_parse_run(void)
|
||||
// 接收成功后停止监听
|
||||
by_tiny_frame_parse_end_listern();
|
||||
// 解析成功回调
|
||||
parse_success_handle();
|
||||
parse_done_handle(0);
|
||||
#if (BY_TF_DEBUG)
|
||||
printf("frame parsed!\r\n");
|
||||
#endif
|
||||
@@ -160,9 +161,9 @@ uint8_t by_tiny_frame_parse_crc(by_tf_parse_frame_t *frame_s)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void by_tiny_frame_parse_handle_register(by_tf_parse_success_handle_func func)
|
||||
void by_tiny_frame_parse_handle_register(by_tf_parse_done_handle_func func)
|
||||
{
|
||||
parse_success_handle = func;
|
||||
parse_done_handle = func;
|
||||
}
|
||||
|
||||
void by_tiny_frame_parse_start_listern(void)
|
||||
|
||||
Reference in New Issue
Block a user