| | |
| | | #include "filters.h" |
| | | #include "stm32f10x_it.h" |
| | | #include "serial_at_cmd_app.h" |
| | | #include "deca_device_api.h" |
| | | |
| | | //#define WORK_MODE_TAG |
| | | #define WORK_MODE_ANCHOR |
| | |
| | | SystemInit(); |
| | | Nvic_Init(); |
| | | Systick_Init(); |
| | | #ifdef WORK_MODE_TAG |
| | | RTC_Configuration(); |
| | | #endif |
| | | Led_Init(); |
| | | Beep_Init(); |
| | | DW_GPIO_Init(); |
| | |
| | | * |
| | | * @return none |
| | | */ |
| | | extern uint8_t send_start; |
| | | int main(void) |
| | | { |
| | | LPFilter_Frac* p_Dis_Filter; |
| | |
| | | Dw1000_Init(); |
| | | p_Dis_Filter = New_LP_Frac(0.7); |
| | | |
| | | #ifdef WORK_MODE_TAG |
| | | dwt_configuresleep(0x940, 0x7); |
| | | _dwt_aonarrayupload(); |
| | | //dwt_entersleep(); |
| | | #endif |
| | | |
| | | /* Loop forever initiating ranging exchanges. */ |
| | | while(1) |
| | | { |
| | | #ifdef WORK_MODE_TAG |
| | | |
| | | if(send_start) |
| | | {send_start=0; |
| | | Tag_App(); |
| | | } |
| | | RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR,ENABLE); |
| | | PWR_EnterSTOPMode(PWR_Regulator_LowPower,PWR_STOPEntry_WFI); |
| | | #else |
| | | Anchor_App(); |
| | | |