| | |
| | | {uint16_t i; |
| | | Usart1ParseDataCallback = UsartParseDataHandler; |
| | | parameter_init(); |
| | | deca_sleep(1000); |
| | | //deca_sleep(1000); |
| | | dev_id = g_com_map[DEV_ID_H]<<16|g_com_map[DEV_ID_L]; |
| | | #ifdef WORK_MODE_TAG |
| | | printf("鏍囩ID: %d .\r\n",dev_id); |
| | |
| | | Program_Init(); |
| | | Dw1000_Init(); |
| | | delay_ms(10); |
| | | #ifdef WORK_MODE_TAG |
| | | //#ifdef WORK_MODE_TAG |
| | | RTC_Configuration(g_com_map[COM_INTERVAL]*20); |
| | | tag_sleep_configuraion(); |
| | | #endif |
| | | //#endif |
| | | Dw1000_App_Init(); |
| | | /* Loop forever initiating ranging exchanges. */ |
| | | RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE); |
| | |
| | | usart_send[1]=0xAA; |
| | | while(1) |
| | | { |
| | | #ifdef WORK_MODE_TAG |
| | | if(g_start_send_flag) |
| | | { |
| | | g_start_send_flag = 0; |
| | | |
| | | Tag_App(); |
| | | } |
| | | // UART_CheckReceive(); |
| | | //PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI); |
| | | #else |
| | | #ifdef WORK_MODE_ANCHOR |
| | | Anchor_App(); |
| | | #endif |
| | | |