From: penglei <1624952103@qq.com> Date: Sat, 27 Jul 2024 04:18:27 +0000 (+0800) Subject: 添加a5133获取更新消息状态 X-Git-Tag: release_V1.2.70_20241020_135402~740^2~1 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=9dded2829c135f1799eb73e0d2b9d24c3d4f9ca6;p=mirrors%2FFD230.git 添加a5133获取更新消息状态 --- diff --git a/code/sdk/drivers/peripheral/a5133/A5133Main.c b/code/sdk/drivers/peripheral/a5133/A5133Main.c index b9d499c02..7439a7003 100644 --- a/code/sdk/drivers/peripheral/a5133/A5133Main.c +++ b/code/sdk/drivers/peripheral/a5133/A5133Main.c @@ -92,7 +92,7 @@ const Uint8 PN9_Tab[]= static uint8_t send_data[2][64] = {0}; static uint8_t send_data_index = 0; - +static bool update_flag = false; errcode_t a5133_set_send_data(uint8_t *senddata,uint8_t datalen) { if ( datalen > (64-1-8) || datalen == 0 || senddata == NULL) @@ -239,7 +239,7 @@ void a5133_main(Uint8 Flag_MASTER,uint8_t channel) LOS_Msleep(10); }; RxPacket(); - + update_flag = true; RF_FIFOWrite(PN9_Tab,64); if(RF_LVR_Check())/* check if BOD reset has occurred */ break;/* exit loop & re-RF init */ @@ -509,9 +509,15 @@ static void dump_tmpbuf(void) } +bool a5133_get_update_state(void) +{ + return update_flag; +} + void a5133_get_rxdata(uint8_t *databuf,uint8_t len) { memcpy_s(databuf,len,tmpbuf_rx,sizeof(tmpbuf_rx)); + update_flag = false; } /********************************************************************* diff --git a/code/sdk/drivers/peripheral/a5133/A5133main.h b/code/sdk/drivers/peripheral/a5133/A5133main.h index 40bbc5506..9e9c267b6 100644 --- a/code/sdk/drivers/peripheral/a5133/A5133main.h +++ b/code/sdk/drivers/peripheral/a5133/A5133main.h @@ -75,4 +75,6 @@ void RF_TXPower(Uint8 tbf, Uint8 tpa); void a5133_main(Uint8 Flag_MASTER,uint8_t channel); void a5133_get_rxdata(uint8_t *databuf,uint8_t len); errcode_t a5133_set_send_data(uint8_t *senddata,uint8_t datalen); +bool a5133_get_update_state(void); + #endif \ No newline at end of file diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index e0f182907..c5bd604b3 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -2603,4 +2603,14 @@ errcode_t uapi_a5133_set_send_data(uint8_t *senddata,uint8_t datalen) #else return ERRCODE_SUCC; #endif +} + +bool uapi_get_a5133_update_state(void) +{ +#ifdef SUPPORT_A5133_SERVICE + return a5133_get_update_state(); +#else + return false; +#endif + } \ No newline at end of file