| | |
| | | #include <stdio.h> |
| | | #include "beep.h" |
| | | #include "modbus.h" |
| | | |
| | | #include "BMP390.h" |
| | | /*------------------------------------ Marcos ------------------------------------------*/ |
| | | /* Inter-ranging delay period, in milliseconds. */ |
| | | #define RNG_DELAY_MS 100 |
| | |
| | | SINGLEPOLL, |
| | | }tag_state=STARTPOLL; |
| | | dwt_config_t config = { |
| | | 2, /* Channel number. */ |
| | | 5, /* Channel number. */ |
| | | DWT_PRF_64M, /* Pulse repetition frequency. */ |
| | | DWT_PLEN_128, /* Preamble length. */ |
| | | DWT_PAC8, /* Preamble acquisition chunk size. Used in RX only. */ |
| | |
| | | } |
| | | |
| | | u16 tag_time_recv[TAG_NUM_IN_SYS]; |
| | | u8 usart_send[25]; |
| | | u8 usart_send[40]; |
| | | u8 battary,button; |
| | | extern uint8_t g_pairstart; |
| | | void tag_sleep_configuraion(void) |
| | |
| | | } |
| | | u32 id,error_times=0; |
| | | extern float Height; |
| | | extern float Altitude; |
| | | void Tag_App(void)//发送模式(TAG标签) |
| | | { |
| | | |
| | |
| | | LED_LG_ON; |
| | | Registor_Poll(); |
| | | LED_LG_OFF; |
| | | // GetPressAndHeight(); |
| | | break; |
| | | case DISCPOLL: |
| | | LED_LG_ON; |
| | |
| | | break; |
| | | case NEARPOLL: |
| | | NearPoll(); |
| | | //GetPressAndHeight(); |
| | | //intheight = Height*100; |
| | | GetPressAndHeight(); |
| | | intheight =Altitude*100; |
| | | break; |
| | | case SINGLEPOLL: |
| | | // Poll(); |
| | | break; |
| | | } |
| | | GetPressAndHeight(); |
| | | intheight =Altitude*100; |
| | | userkey_state = !GET_USERKEY; |
| | | dwt_forcetrxoff(); |
| | | dwt_setinterrupt( DWT_INT_RFCG | (DWT_INT_ARFE | DWT_INT_RFSL | DWT_INT_SFDT | DWT_INT_RPHE | DWT_INT_RFCE | DWT_INT_RFTO | DWT_INT_RXPTO), 1); |