From 1bbe2af28715f5543352965a6ba810804486af52 Mon Sep 17 00:00:00 2001 From: zhangbo <zhangbo@qq.com> Date: 星期四, 15 五月 2025 19:25:59 +0800 Subject: [PATCH] led去掉时间正常 --- keil/include/src/Radio/lora_1268.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/keil/include/src/Radio/lora_1268.c b/keil/include/src/Radio/lora_1268.c index 7a1fb3b..54728bd 100644 --- a/keil/include/src/Radio/lora_1268.c +++ b/keil/include/src/Radio/lora_1268.c @@ -185,6 +185,7 @@ extern uint8_t SOS_KEY_STATE; uint32_t LORA_POLL_COUNT=0; extern uint32_t step_count; +uint8_t step_count_rep; //extern u16_m f_step; void LoraReportPoll(void) { @@ -281,12 +282,18 @@ memcpy(&lora_sendbuffer[LORA_RETRANSNUSSION_BT+1],&DMA_RXBuf_BT[0],BT_NUM*2+1); //基站ID memcpy(&lora_sendbuffer[LORA_RETRANSNUSSION_BT+BT_NUM*2+2],&DMA_RXBuf_BT[1+BT_NUM*2],BT_NUM*2);//基站距离 lora_sendbuffer[MSG_LENGTH] = LORA_RETRANSNUSSION_BT+4*BT_NUM+2; + + if(step_count < 0) + step_count=0; + lora_sendbuffer[STEP_COUNT] = (uint8_t)(step_count % 256); + // } // if(lora_sendbuffer[LORA_RETRANSNUSSION_BT]==0x2D) // { checksum = Checksum_u16(lora_sendbuffer,4*BT_NUM+4*report_ancnum+BT_ANCID_IDX+3); memcpy(&lora_sendbuffer[LORA_RETRANSNUSSION_BT+BT_NUM*4+2],&checksum,2); BT_SEND_flag=BT_ANCID_IDX+report_ancnum*4+BT_NUM*4+5; + Radio.Send(lora_sendbuffer,BT_SEND_flag); LORA_POLL_COUNT++; // LORA_3029_SINGLE_SEND(lora_sendbuffer,ANCID_IDX+report_ancnum*4+BT_NUM*4+4,0); @@ -445,7 +452,7 @@ else { Radio.Rx( 50 ); - LORA_LED_OFF; + } } #define BUFFER_SIZE 255 // Define the payload size here -- Gitblit v1.9.3