yincheng.zhong
2024-01-22 4170266b0f0e779d0c1dcbe519e3307e9f2cde7a
Src/main.c
@@ -371,7 +371,7 @@
        RadioIrqProcess();
    }
}
u16 poll_startcount;
    u16 poll_startcount;
u16 Anchor_Vcc_time1;
uint8_t TX_Anchor_Vcc[100]={0x55,0xAA,0x14,20,0,0/*标签id*/,0,0/*基站ID*/,0/*保留*/,};
extern float bat_volt;
@@ -466,7 +466,7 @@
    /* USER CODE END WHILE */
    /* USER CODE BEGIN 3 */
      Send_Anchor_Vcc_Poll();
    //  Send_Anchor_Vcc_Poll();
      if(g_start_send_flag)
   { static uint16_t blink_count=0;
      SystemClock_Config();
@@ -474,19 +474,14 @@
      HAL_IWDG_Refresh(&hiwdg);
        memcpy(&TX_Buffer+3,&tx_num,1);
//        printf("Lora发送%d",tx_num);
        HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, GPIO_PIN_SET);
//        poll_startcount=HAL_LPTIM_ReadCounter(&hlptim1);
//        poll_startcount=poll_startcount+557;//557代表17ms
//        if(poll_startcount>=32768)
//      {
//            poll_startcount -=32768;
//      }
       Radio.Send( &TX_Buffer, 4);
        HAL_GPIO_WritePin(GPIOB, GPIO_PIN_12, GPIO_PIN_SET);
        UWB_Wkup();
        delay_us(700);
//        HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, GPIO_PIN_SET);
//        HAL_GPIO_WritePin(GPIOB, GPIO_PIN_12, GPIO_PIN_SET);
//         Radio.Send( &TX_Buffer, 4);
//        UWB_Wkup();
//        delay_us(700);
      if(bat_percent>15)
      {   
          LED_TB_ON;