| | |
| | | //HexToAsciiSendUDP(usart_send,27+8*nearbase_num); |
| | | } |
| | | uint8_t pack_length = 0,pack_index = 0,pack_msgtype = 0; |
| | | uint8_t motor_flag; |
| | | void NearPoll(void) |
| | | { |
| | | |
| | |
| | | |
| | | recbase_num=0; |
| | | // motor_state=0; |
| | | if(motor_state!=0&&motor_state!=3) |
| | | { |
| | | motor_flag = 1; |
| | | }else{ |
| | | motor_flag = 0; |
| | | } |
| | | |
| | | tx_near_msg[BATTARY_IDX] = bat_percent; |
| | | tx_near_msg[BUTTON_IDX] = userkey_state|stationary_flag<<1|gotosleep_flag<<2; |
| | | 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; |
| | | tx_near_msg[NEARBASENUM_INDEX] = nearbase_num; |
| | |
| | | { |
| | | if( pack_index == MOTOR_ONTIME_INDEX) |
| | | { |
| | | if(motor_keeptime==0) |
| | | // if(motor_keeptime==0) |
| | | motor_keeptime = rec_remotepara[3]; |
| | | }else{ |
| | | if(pack_index<200) |