keil/include/main/main.c
@@ -130,6 +130,8 @@
{
    // LOG_INFO(TRACE_MODULE_APP, "Wake up by sleep timer %d\r\n", time);
}
extern uint8_t start_wait_flag;
extern int16_t end_count1;
static void sleep_timer_callback_normal(void *dev, uint32_t time)
{
   if(secondtask_count++%2==0)
@@ -138,7 +140,11 @@
    }else{
        flag_secondtask = 0;
    }
      if(start_wait_flag)//lora升级等待超时标志
      {
      if(end_count1--<=0)
      start_wait_flag=0;
      }
// if(delaysleep_count>0)
//     delaysleep_count--;
}
@@ -365,7 +371,7 @@
            int_unlock(lock);
}
int main(void)
{
{
   // Initialize MCU system
    board_init();
    // Disable watchdog timer
@@ -376,8 +382,10 @@
//    power_init();
//   mcu_deep_sleep();
   if(gpio_pin_get_val(SLEEP_PIN))
   {
//        if(1)
   {
   if(gpio_pin_get_val(MODE_CHANGE_PIN))//记得改回来与正式的相反
//        if(0)//记得改回来与正式的相反
   {
      LOG_INFO(TRACE_MODULE_APP,"固件版本:MK_Air_tag模式 V%d.%d. \r\n",g_com_map[VERSION]>>8,g_com_map[VERSION]&0xff);
      // Platform init for WSF
@@ -491,6 +499,7 @@
      LOG_INFO(TRACE_MODULE_APP,"固件版本:MK_免布线模式 V%d.%d. \r\n",g_com_map[VERSION]>>8,g_com_map[VERSION]&0xff);
      uart0_Init_normal();
      Lora_1268_Init();
       //LOG_INFO(TRACE_MODULE_APP," 切换6\r\n");
      SwitchLoraSettings(478,7,22);
      Uwb_init();//默认为我们测距配置
      OpenUWB();
@@ -507,13 +516,14 @@
                  send_flag=0;
               }
            uwb_app_poll();//我们的测距逻辑
            if(flag_secondtask)
        {
            flag_secondtask = 0;
            SecondTask();
               //Lora_Tx_Poll();
        }
                if(flag_secondtask)
                {
                    flag_secondtask = 0;
                    SecondTask();
                            //Lora_Tx_Poll();
                }
            Lora_Tx_Poll();   
//            LoraUp_Poll();//网关升级
            if(!gpio_pin_get_val(SLEEP_PIN))
            {
               delay_ms(300);