From 9dded2829c135f1799eb73e0d2b9d24c3d4f9ca6 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Sat, 27 Jul 2024 12:18:27 +0800 Subject: [PATCH] =?utf8?q?=E6=B7=BB=E5=8A=A0a5133=E8=8E=B7=E5=8F=96?= =?utf8?q?=E6=9B=B4=E6=96=B0=E6=B6=88=E6=81=AF=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- code/sdk/drivers/peripheral/a5133/A5133Main.c | 10 ++++++++-- code/sdk/drivers/peripheral/a5133/A5133main.h | 2 ++ code/sdk/drivers/peripheral/utils/custom_utils.c | 10 ++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) 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 -- 2.17.1