|
@@ -2468,18 +2468,14 @@ gpio_reset_pin(LORA_POWER_PIN);
|
|
|
|
|
|
int reson = is_wake_up_reson(); //返回唤醒的原因
|
|
int reson = is_wake_up_reson(); //返回唤醒的原因
|
|
|
|
|
|
-
|
|
|
|
-if ((reson != ESP_SLEEP_WAKEUP_ULP) && (reson != ESP_SLEEP_WAKEUP_TIMER)&& (reson != ESP_SLEEP_WAKEUP_EXT0))
|
|
|
|
|
|
+ printf("wake up lora cmd init , reson = %d\r\n",reson);//软件复位是2,硬件复位是0
|
|
|
|
+if ((reson != ESP_SLEEP_WAKEUP_ULP) && (reson != ESP_SLEEP_WAKEUP_TIMER)/*&& (reson != ESP_SLEEP_WAKEUP_EXT0)*/) //ota完后软件复位,重新配置lora
|
|
{
|
|
{
|
|
printf("lora cmd init start\r\n");
|
|
printf("lora cmd init start\r\n");
|
|
|
|
|
|
xTaskCreate(tx_task, "uart_tx_task", 1024*2, NULL, configMAX_PRIORITIES-1, &lora_uart_tx_handle);
|
|
xTaskCreate(tx_task, "uart_tx_task", 1024*2, NULL, configMAX_PRIORITIES-1, &lora_uart_tx_handle);
|
|
-
|
|
|
|
}else
|
|
}else
|
|
{
|
|
{
|
|
- printf("wake up lora cmd init not need init\r\n");
|
|
|
|
-
|
|
|
|
-
|
|
|
|
lora.lora_mode = Lora_UART_Mode; //复位直接进入透传模式
|
|
lora.lora_mode = Lora_UART_Mode; //复位直接进入透传模式
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
@@ -2645,11 +2641,10 @@ int get_lora_busy_pin()
|
|
|
|
|
|
void lora_set_power_level(int level)
|
|
void lora_set_power_level(int level)
|
|
{
|
|
{
|
|
- #if 1
|
|
|
|
|
|
+ #if 0
|
|
gpio_set_level(LORA_POWER_PIN,level);
|
|
gpio_set_level(LORA_POWER_PIN,level);
|
|
#else
|
|
#else
|
|
rtc_gpio_set_level(LORA_POWER_PIN, level);
|
|
rtc_gpio_set_level(LORA_POWER_PIN, level);
|
|
-
|
|
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|