| | |
| | | ip2 = (g_com_map[TCP_IP_2]>>12&0xf)*1000+(g_com_map[TCP_IP_2]>>8&0xf)*100+(g_com_map[TCP_IP_2]>>4&0xf)*10+(g_com_map[TCP_IP_2]&0xf); |
| | | ip3 = (g_com_map[TCP_IP_3]>>12&0xf)*1000+(g_com_map[TCP_IP_3]>>8&0xf)*100+(g_com_map[TCP_IP_3]>>4&0xf)*10+(g_com_map[TCP_IP_3]&0xf); |
| | | port = g_com_map[TCP_PORT]; |
| | | g_com_map[VERSION] = (1<<8)|0; |
| | | g_com_map[VERSION] = (2<<8)|0; |
| | | LOG_INFO(TRACE_MODULE_APP,"设备ID: %x .\r\n",dev_id); |
| | | // if(gpio_pin_get_val(MODE_CHANGE_PIN)) |
| | | // LOG_INFO(TRACE_MODULE_APP,"固件版本:MK_Air_tag模式 V%d.%d. \r\n",g_com_map[VERSION]>>8,g_com_map[VERSION]&0xff); |
| | |
| | | } |
| | | Lora_Tx_Poll(); |
| | | // LoraUp_Poll();//网关升级 |
| | | if(!gpio_pin_get_val(SLEEP_PIN)) |
| | | { |
| | | delay_ms(300); |
| | | //LOG_INFO(TRACE_MODULE_APP, "进入休眠模式\r\n");//会打断休眠 |
| | | //gpio_pin_clr(LORA_NRST);//lora休眠 |
| | | //spi_close(SPI_ID0); |
| | | lora_in_sleep(); |
| | | power_init(); |
| | | mcu_deep_sleep(); |
| | | } |
| | | // if(!gpio_pin_get_val(SLEEP_PIN)) |
| | | // { |
| | | // delay_ms(300); |
| | | // //LOG_INFO(TRACE_MODULE_APP, "进入休眠模式\r\n");//会打断休眠 |
| | | // //gpio_pin_clr(LORA_NRST);//lora休眠 |
| | | // //spi_close(SPI_ID0); |
| | | // lora_in_sleep(); |
| | | // power_init(); |
| | | // mcu_deep_sleep(); |
| | | // } |
| | | IdleTask(); |
| | | } |
| | | } |