| | |
| | | uart_close(UART_ID0); |
| | | uart_close(UART_ID1); |
| | | } |
| | | int test3; |
| | | static void sleep_timer_callback(void *dev, uint32_t time) |
| | | { |
| | | //sleep_timer_start(__MS_TO_32K_CNT(1000)); |
| | | gpio_pin_set(LED_PIN); |
| | | test3=gpio_pin_get_val(LED_PIN); |
| | | enable_sleep_count++; |
| | | if(enable_sleep_count==SLEEP_START_TIME){ |
| | | |
| | |
| | | sleep_flag=1; |
| | | } |
| | | g_start_send_flag=1; |
| | | gpio_pin_clr(LED_PIN); |
| | | test3=gpio_pin_get_val(LED_PIN); |
| | | //LOG_INFO(TRACE_MODULE_APP, "Sleep timer interrupt callback\r\n"); |
| | | } |
| | | |
| | | static void adc_callback(void *data, uint32_t number) |
| | | { |
| | | uint32_t *result = (uint32_t *)data; |
| | |
| | | group_id=g_com_map[GROUP_ID]; |
| | | memcpy(&dev_id ,&g_com_map[DEV_ID],2); |
| | | tag_frequence=1000/g_com_map[COM_INTERVAL]; |
| | | g_com_map[VERSION] = (1<<8)|4; |
| | | g_com_map[VERSION] = (1<<8)|5; |
| | | LOG_INFO(TRACE_MODULE_APP,"设备ID: %x .\r\n",dev_id); |
| | | LOG_INFO(TRACE_MODULE_APP,"固件版本:UWB-标签 V%d.%d. \r\n",g_com_map[VERSION]>>8,g_com_map[VERSION]&0xff); |
| | | } |
| | |
| | | //sys_timer_open(); |
| | | |
| | | gpio_open(); |
| | | //board_led_init(); |
| | | board_led_init(); |
| | | |
| | | //uart_open(UART_ID0, &test_uart_cfg); |
| | | |
| | |
| | | gpio_pin_set_dir( IO_PIN_5, GPIO_DIR_OUT, 0); |
| | | io_pull_set(IO_PIN_5 , IO_PULL_DOWN, IO_PULL_UP_LEVEL4); |
| | | #endif |
| | | |
| | | //Serial0_PutString("进入app测试\r\n"); |
| | | while (1) |
| | | { |
| | |
| | | //LOG_INFO(TRACE_MODULE_APP, "测距ing"); |
| | | |
| | | g_start_send_flag = 0; |
| | | |
| | | gpio_pin_set(LED_PIN); |
| | | TagRange(); |
| | | gpio_pin_clr(LED_PIN); |
| | | IdleTask(); |
| | | }else{ |
| | | IdleTask(); |