AP_GPS: convert NOVA, SBP and SBP2 to use check_new_itow()

This commit is contained in:
Andrew Tridgell 2018-06-20 08:57:27 +10:00
parent df68d6413c
commit b5f3750014
3 changed files with 11 additions and 1 deletions

View File

@ -185,6 +185,8 @@ AP_GPS_NOVA::process_message(void)
uint16_t messageid = nova_msg.header.nova_headeru.messageid;
Debug("NOVA process_message messid=%u\n",messageid);
check_new_itow(nova_msg.header.nova_headeru.tow, nova_msg.header.nova_headeru.messagelength + nova_msg.header.nova_headeru.headerlength);
if (messageid == 42) // bestpos
{

View File

@ -182,14 +182,17 @@ AP_GPS_SBP::_sbp_process_message() {
case SBP_GPS_TIME_MSGTYPE:
memcpy(&last_gps_time, parser_state.msg_buff, sizeof(last_gps_time));
check_new_itow(last_gps_time.tow, parser_state.msg_len);
break;
case SBP_VEL_NED_MSGTYPE:
memcpy(&last_vel_ned, parser_state.msg_buff, sizeof(last_vel_ned));
check_new_itow(last_vel_ned.tow, parser_state.msg_len);
break;
case SBP_POS_LLH_MSGTYPE: {
struct sbp_pos_llh_t *pos_llh = (struct sbp_pos_llh_t*)parser_state.msg_buff;
check_new_itow(pos_llh->tow, parser_state.msg_len);
// Check if this is a single point or RTK solution
// flags = 0 -> single point
if (pos_llh->flags == 0) {
@ -202,6 +205,7 @@ AP_GPS_SBP::_sbp_process_message() {
case SBP_DOPS_MSGTYPE:
memcpy(&last_dops, parser_state.msg_buff, sizeof(last_dops));
check_new_itow(last_dops.tow, parser_state.msg_len);
break;
case SBP_TRACKING_STATE_MSGTYPE:

View File

@ -184,22 +184,27 @@ AP_GPS_SBP2::_sbp_process_message() {
case SBP_GPS_TIME_MSGTYPE:
memcpy(&last_gps_time, parser_state.msg_buff, sizeof(struct sbp_gps_time_t));
check_new_itow(last_gps_time.tow, parser_state.msg_len);
break;
case SBP_VEL_NED_MSGTYPE:
memcpy(&last_vel_ned, parser_state.msg_buff, sizeof(struct sbp_vel_ned_t));
check_new_itow(last_vel_ned.tow, parser_state.msg_len);
break;
case SBP_POS_LLH_MSGTYPE:
memcpy(&last_pos_llh, parser_state.msg_buff, sizeof(struct sbp_pos_llh_t));
check_new_itow(last_pos_llh.tow, parser_state.msg_len);
break;
case SBP_DOPS_MSGTYPE:
memcpy(&last_dops, parser_state.msg_buff, sizeof(struct sbp_dops_t));
check_new_itow(last_dops.tow, parser_state.msg_len);
break;
case SBP_EXT_EVENT_MSGTYPE:
memcpy(&last_event, parser_state.msg_buff, sizeof(struct sbp_ext_event_t));
check_new_itow(last_event.tow, parser_state.msg_len);
logging_ext_event();
break;
@ -288,7 +293,6 @@ AP_GPS_SBP2::_attempt_state_update()
state.time_week_ms = last_vel_ned.tow;
state.hdop = last_dops.hdop;
state.vdop = last_dops.vdop;
set_uart_timestamp(parser_state.msg_len);
state.last_gps_time_ms = now;
//