| | |
| | | #include "dw_mbx_tag.h" |
| | | #include "Flash.h" |
| | | #include "dw_driver.h" |
| | | #include "WS2812.h" |
| | | static RadioEvents_t RadioEvents; |
| | | #define USE_MODEM_LORA |
| | | //#define USE_MODEM_FSK |
| | |
| | | uint16_t rec_value,rec_delaytime,rx_count,datalen_offset; |
| | | int32_t target_count; |
| | | uint8_t shengji_flag; |
| | | extern uint32_t uwbled,gpsled,loraled,powerled; |
| | | void OnRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr ) |
| | | { uint16_t checksum1; |
| | | BufferSize = size; |
| | |
| | | if(!memcmp(&wg_report_id,&RX_Buffer[SOURCE_ID_IDX],2)) |
| | | { |
| | | wg_lost_count = 0; |
| | | loraled=GREEN; |
| | | switch(RX_Buffer[PWTAG_RW_FLAG_IDX]) |
| | | { |
| | | case WGRSP_RWTAG_NONE: |
| | | current_count = HAL_LPTIM_ReadCounter(&hlptim1); |
| | | wg_report_freq = RX_Buffer[POLL_FREQ_IDX]+400; |
| | | memcpy(&rec_delaytime,&RX_Buffer[NEXTPOLL_TIME_IDX],2); |
| | | rec_secdelay = RX_Buffer[PWTAG_SECDELAY_IDX]; |
| | | rec_secdelay = RX_Buffer[PWTAG_SECDELAY_IDX]; |
| | | if(BufferSize!=13||rec_secdelay>20) |
| | | { |
| | | rec_secdelay = 0; |
| | | } |
| | | |
| | | if(report_ancnum<2) |
| | | { |
| | | datalen_offset = report_ancnum*85; |