| | |
| | | // } |
| | | } |
| | | } |
| | | extern int16_t fVoltage_mv; |
| | | uint8_t readgcom_flag1; |
| | | uint32_t current_count11,current_count22,current_count33,current_count44,current_count55; |
| | | uint16_t adc_caiji; |
| | |
| | | recbase_num=0; |
| | | phy_timer_open(1, IRQ_PRIORITY_HIGH); |
| | | mac_register_process_handler(tx_int_callback, rx_int_callback); |
| | | tx_near_msg[BATTARY_IDX] = bat_percent; |
| | | tx_near_msg[BATTARY_IDX] = (fVoltage_mv-1000)/10;; |
| | | // tx_near_msg[BUTTON_IDX] = 0/*userkey_state|stationary_flag<<1|gotosleep_flag<<2|motor_flag<<5*/; |
| | | tx_near_msg[SEQUENCE_IDX] = frame_seq_nb; |
| | | // tx_near_msg[SEQUENCEH_IDX] = (frame_seq_nb++)>>8; |
| | |
| | | poll_tx_ts_i64 = ranging_tx_time_correct(poll_tx_en_start_u32 + phy_shr_duration());//修正时间戳 |
| | | temp_tag_count1=phy_timer_count_get(); |
| | | adc_caiji++; |
| | | if(adc_caiji>5&&adc_one==0) |
| | | if(adc_caiji>30&&adc_one==0) |
| | | { |
| | | adc_one=1; |
| | | adc_caiji=0; |
| | |
| | | motor_flag = 0; |
| | | } |
| | | |
| | | tx_near_msg[BATTARY_IDX] = bat_percent; |
| | | tx_near_msg[BATTARY_IDX] = (fVoltage_mv-1000)/10; |
| | | tx_near_msg[BUTTON_IDX] = userkey_state|stationary_flag<<1|gotosleep_flag<<2|motor_flag<<5; |
| | | tx_near_msg[SEQUENCE_IDX] = frame_seq_nb; |
| | | tx_near_msg[SEQUENCEH_IDX] = (frame_seq_nb++)>>8; |
| | |
| | | poll_tx_ts_i64 = ranging_tx_time_correct(poll_tx_en_start_u32 + phy_shr_duration());//修正时间戳 |
| | | temp_tag_count1=phy_timer_count_get(); |
| | | adc_caiji++; |
| | | if(adc_caiji>5&&adc_one==0) |
| | | if(adc_caiji>30&&adc_one==0) |
| | | { |
| | | adc_one=1; |
| | | adc_caiji=0; |
| | | MinuteTask(); |
| | | } |
| | | else if(adc_one==1&&adc_caiji>3600) |
| | | else if(adc_one==1&&adc_caiji>1) |
| | | { |
| | | adc_caiji=0; |
| | | MinuteTask(); |