| | |
| | | //sys_timer_open(); |
| | | // TODO 4G |
| | | Uart_Register(UART_ID_4G, UART_ID0); |
| | | Internet_Init(); |
| | | TCPClient_Init(); |
| | | // Internet_Init(); |
| | | // TCPClient_Init(); |
| | | gpio_open(); |
| | | LED_output_init();//配置彩色灯引脚 |
| | | IIC2_Init(); |
| | | Accelerometer_Init(); |
| | | PCA9555_init(); |
| | | // LED_output_init();//配置彩色灯引脚 |
| | | // IIC2_Init(); |
| | | // Accelerometer_Init(); |
| | | // PCA9555_init(); |
| | | |
| | | |
| | | //AIR780E_Reset(); |
| | | |
| | | adc_open(&usr_adc_cfg); |
| | | |
| | | if(!read_5v_input_pca()) |
| | | { |
| | | Set4LEDColor(BLUE,GREEN,WHITE,GREEN); |
| | | delay_ms(500); |
| | | Set4LEDColor(RED,WHITE,RED,WHITE); |
| | | delay_ms(500); |
| | | //Set4LEDColor(LEDOFF,LEDOFF,LEDOFF,LEDOFF); |
| | | } |
| | | // if(!read_5v_input_pca()) |
| | | // { |
| | | // Set4LEDColor(BLUE,GREEN,WHITE,GREEN); |
| | | // delay_ms(500); |
| | | // Set4LEDColor(RED,WHITE,RED,WHITE); |
| | | // delay_ms(500); |
| | | // //Set4LEDColor(LEDOFF,LEDOFF,LEDOFF,LEDOFF); |
| | | // } |
| | | // io_pin_mux_set(SCL_PIN, IO_FUNC0);//测试测距波形 |
| | | // gpio_pin_set_dir(SCL_PIN , GPIO_DIR_IN, 0); |
| | | // io_pull_set(SCL_PIN , IO_PULL_UP, IO_PULL_UP_LEVEL4); |
| | |
| | | PCA9555_Set_One_Value_Output(ADC_MINIUS,0);//拉低 |
| | | adc_get(&sample[0], NUM_SAMPLES, adc_callback);//adc采样 |
| | | //board_acceleration_detection_init(move_handler); |
| | | pca_input_detection_init(pca_handler);//pca检测输入 |
| | | // pca_input_detection_init(pca_handler);//pca检测输入 |
| | | //board_4GUsart_detection_init(_4gUsart_handler); |
| | | Uwb_init(); |
| | | OpenUWB(); |
| | | while (1) |
| | | { |
| | | uwb_app_poll(); |
| | | Air780eTask(); |
| | | // Air780eTask(); |
| | | if(flag_secondtask) |
| | | { |
| | | flag_secondtask = 0; |