| | |
| | | HIDO_TimerTick(); |
| | | nomove_count++; |
| | | } |
| | | uint8_t tt=1; |
| | | uint8_t flag_sleeptimer,flag_secondtask,secondtask_count; |
| | | static void sleep_timer_callback(void *dev, uint32_t time) |
| | | { |
| | | IO_control_init(); |
| | | if(tt) |
| | | UWBPoll(); |
| | | //车载poll |
| | | UWB_Tag_Poll(); |
| | |
| | | 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)|11; |
| | | g_com_map[VERSION] = (1<<8)|1; |
| | | LOG_INFO(TRACE_MODULE_APP,"设备ID: %x .\r\n",dev_id); |
| | | LOG_INFO(TRACE_MODULE_APP,"固件版本:UWB-4G手环 V%d.%d. \r\n",g_com_map[VERSION]>>8,g_com_map[VERSION]&0xff); |
| | | LOG_INFO(TRACE_MODULE_APP,"服务器地址: %d.%d.%d.%d:%d.\r\n",ip0,ip1,ip2,ip3,port); |
| | |
| | | io_pin_mux_set(SCL_PIN, IO_FUNC0);//测试测距波形 |
| | | gpio_pin_set_dir(SCL_PIN , GPIO_DIR_OUT, 0); |
| | | io_pull_set(SCL_PIN , IO_PULL_DOWN, IO_PULL_UP_LEVEL4); |
| | | gps_air780_power_change(0,1);//开启gps,4G |
| | | gps_air780_power_change(1,1);//开启gps,4G |
| | | //加速度计初始化必须在IO_control_init之前因为复用SDA引脚 |
| | | adc_get(&sample[0], NUM_SAMPLES, adc_callback);//adc采样 |
| | | Program_Init(); |
| | |
| | | { |
| | | flag_secondtask = 0; |
| | | SecondTask(); |
| | | |
| | | } |
| | | IdleTask(); |
| | | //3种情况后都要发包和休眠 |