| | |
| | | cs_lastdist[channel] = currentdist; |
| | | return cs_lastvalid[channel]; |
| | | } |
| | | |
| | | #define CONT_FRAME_PERIOD 124800 |
| | | uint16_t g_Resttimer; |
| | | uint8_t result; |
| | | u8 tag_succ_times=0; |
| | |
| | | |
| | | if(!g_com_map[MODBUS_MODE]) |
| | | { |
| | | u32 devid; |
| | | hex_dist2 = hex_dist2; |
| | | usart_send[2] = 1;//æ£å¸¸æ¨¡å¼ |
| | | usart_send[3] = 17;//æ°æ®æ®µé¿åº¦ |
| | |
| | | memcpy(&usart_send[9],&hex_dist2,4); |
| | | usart_send[13] = bat_percent; |
| | | usart_send[14] = button; |
| | | usart_send[15] = rec_firstpath_power; |
| | | checksum = Checksum_u16(&usart_send[2],17); |
| | | memcpy(&usart_send[19],&checksum,2); |
| | | UART_PushFrame(usart_send,21); |
| | | Spi_ChangePrescaler(SPIx_PRESCALER_SLOW); |
| | | dwt_configcontinuousframemode(CONT_FRAME_PERIOD); |
| | | dwt_writetxdata(20, tx_final_msg, 0);//å°Pollå
æ°æ®ä¼ ç»DW1000ï¼å°å¨å¼å¯åéæ¶ä¼ åºå» |
| | | dwt_writetxfctrl(20, 0); |
| | | dwt_starttx(DWT_START_TX_IMMEDIATE); |
| | | devid = dwt_readdevid(); |
| | | LED0_ON; |
| | | while(devid==DWT_DEVICE_ID ) |
| | | { |
| | | devid = dwt_readdevid(); |
| | | } |
| | | |
| | | NVIC_SystemReset(); |
| | | } |
| | | } |
| | | // memcpy(&Modbus_HoldReg[anc_id_recv*2],&hex_dist,4); |