| | |
| | | Reset_DW1000();//重启DW1000 /* Target specific drive of RSTn line into DW1000 low for a period. */ |
| | | Spi_ChangePrescaler(SPIx_PRESCALER_SLOW); //设置为快速模式 |
| | | dwt_initialise(DWT_LOADUCODE);//初始化DW1000 |
| | | Spi_ChangePrescaler(SPIx_PRESCALER_FAST); //设置为快速模式 |
| | | //Spi_ChangePrescaler(SPIx_PRESCALER_FAST); //设置为快速模式 |
| | | |
| | | /* Configure DW1000. See NOTE 6 below. */ |
| | | dwt_configure(&config);//配置DW1000 |
| | |
| | | // tyncpoll_time = (tagslotpos--%max_slotpos)*slottime; |
| | | } |
| | | } |
| | | |
| | | uint8_t pack_length = 0,pack_index = 0,pack_msgtype = 0; |
| | | void NearPoll(void) |
| | | { |
| | | |
| | |
| | | |
| | | if(para_update) |
| | | { |
| | | uint8_t pack_length = 0,pack_index = 0,pack_msgtype = 0; |
| | | |
| | | pack_msgtype = rec_remotepara[0]; |
| | | pack_index = rec_remotepara[1]; |
| | | pack_length = rec_remotepara[2]; |
| | |
| | | //LED0_ON; |
| | | SPIx_CS_GPIO->BRR = SPIx_CS; |
| | | delay_us(700); |
| | | // GetPressAndHeight(); |
| | | // intheight = Height*100; |
| | | SPIx_CS_GPIO->BSRR = SPIx_CS; |
| | | id = dwt_readdevid() ; |
| | | while (DWT_DEVICE_ID != id) |
| | |
| | | SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader |
| | | } |
| | | } |
| | | |
| | | |
| | | error_times = 0; |
| | | switch(tag_state) |
| | | { |
| | |
| | | break; |
| | | case NEARPOLL: |
| | | NearPoll(); |
| | | //GetPressAndHeight(); |
| | | //intheight = Height*100; |
| | | break; |
| | | case SINGLEPOLL: |
| | | Poll(); |