| | |
| | | }; |
| | | void uart_receive_callback(void *dev, uint32_t err_code) |
| | | { |
| | | uart_receive(UART_ID1,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback); |
| | | uart_receive(UART_ID0,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback); |
| | | } |
| | | void mcu_deep_sleep(void) |
| | | { |
| | |
| | | MinuteTask(); |
| | | } |
| | | TagListUpdate_person_num_car(); |
| | | in_table_log(); |
| | | //in_table_log(); |
| | | |
| | | // if(!power_low_flag) |
| | | // Gps_change(); |
| | |
| | | extern uint16_t ip0,ip1,ip2,ip3,port; |
| | | extern uint8_t gps_4g_flag; |
| | | extern uint8_t gps_need_data_flag,gps_open_flag; |
| | | extern float pd_offset,offset; |
| | | void Program_Init(void) |
| | | { |
| | | Usart1ParseDataCallback = UsartParseDataHandler;//需改为默认为gps处理,UsartParseDataHandler为升级处理当调试时候改为 |
| | |
| | | group_id=g_com_map[GROUP_ID];//组ID |
| | | // tag_frequency = 1000/g_com_map[COM_INTERVAL];//测距频率这个存的是测距时间 |
| | | memcpy(&disoffset,&g_com_map[DIST_OFFSET],2); |
| | | memcpy(&pd_offset,&g_com_map[PDOFFSET],4); |
| | | // g_com_map[ALARM_DISTANCE1] = 40; |
| | | // g_com_map[ALARM_DISTANCE2] = 40; |
| | | warning_distance=g_com_map[ALARM_DISTANCE1]; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | uint8_t calibration_start; |
| | | void IdleTask(void) |
| | | { |
| | | // if(gpio_pin_get_val(INPUT_5V_Pin)) |
| | |
| | | // //UartDeinit(); |
| | | // } |
| | | // } |
| | | UART_CheckReceive(); |
| | | UART0_CheckReceive(); |
| | | if(g_com_map[CNT_CALIB]) |
| | | { |
| | | g_com_map[CNT_CALIB]=0; |
| | | save_com_map_to_flash(); |
| | | calibration_start=1; |
| | | } |
| | | } |
| | | int bind_check(void) |
| | | { |
| | |
| | | board_clock_run(); |
| | | boot_deinit(); |
| | | board_pins_config(); |
| | | board_debug_console_open(TRACE_PORT_UART1); |
| | | board_debug_console_open(TRACE_PORT_UART0); |
| | | // Reset reason |
| | | reset_cause_get(); |
| | | reset_cause_clear(); |
| | |
| | | // TCPClient_Init(); |
| | | |
| | | gpio_open(); |
| | | |
| | | |
| | | board_output_init();//配置adcGND引脚 |
| | | // battery_monitor_open(); |
| | | // Voltage_input=battery_monitor_get(); |
| | |
| | | |
| | | // uart1_change_from_gps_to_debug(); |
| | | //Uart1GpsRecDebugSend(); |
| | | uart_receive(UART_ID1,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback); |
| | | uart_receive(UART_ID0,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback); |
| | | |
| | | // Initialize low power mode |
| | | power_init(); |