WXK
2024-03-01 cea7f6ca7f65b036892965a6e0ffd22d5afcd190
Src/radio/Lora.c
@@ -215,7 +215,7 @@
    Radio.Rx( 500 );
    }
    else
    {  Radio.Sleep( );}
    {   Radio.Rx( 50 );}
//printf("TX SUCCESS2\r\n");
}
static uint8_t rxbuffer[255],rxbuff_len;
@@ -231,6 +231,7 @@
    return rec_lp_count;
}
uint8_t lora_up_rec_flag;
uint8_t Lorahuifu_flag;
extern uint16_t tx_num;
void OnRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr )
{
@@ -242,15 +243,16 @@
    SnrValue = snr;
    
    Radio.Standby();
    lora_up_rec_flag=1;
    flag_lora_wait_sync = 0;
    SetFlagSyncSuccess(1);
    Radio.Rx( RX_TIMEOUT_VALUE );
//    if(LoraUp_flag)
//    {
//
//    }
    if(rxbuffer[MSG_TYPE_IDX]==LORA_MSGTYPE_WGRESPTAG)
    {
       if(!memcmp(&dev_id,&rxbuffer[DEST_ID_IDX],2))
       {
//        printf("收到网关回复\r\n");
          Lorahuifu_flag=1;
       }
    }
    Radio.Sleep();
}
void OnTxTimeout( void )
@@ -261,13 +263,13 @@
void OnRxTimeout( void )
{
    Radio.Standby();
    flag_lora_wait_sync = 0;
    Radio.Sleep();
}
void OnRxError( void )
{
    flag_lora_wait_sync = 0;
    Radio.Standby();
    Radio.Sleep();
}
void Lora_Init(void)