mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 02:01:35 +08:00
More cleanup
This commit is contained in:
@@ -341,7 +341,8 @@ GPS::task_main()
|
|||||||
if (_mode_changed) {
|
if (_mode_changed) {
|
||||||
if (_Helper != nullptr) {
|
if (_Helper != nullptr) {
|
||||||
delete(_Helper);
|
delete(_Helper);
|
||||||
_Helper = nullptr; // XXX is this needed?
|
/* set to zero to ensure parser is not used while not instantiated */
|
||||||
|
_Helper = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (_mode) {
|
switch (_mode) {
|
||||||
|
|||||||
+11
-11
@@ -371,7 +371,7 @@ UBX::parse(uint8_t b, struct vehicle_gps_position_s* gps_position)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: //should not happen because we set the class
|
default: //should not happen because we set the class
|
||||||
warnx("UBX Error, we set a class that we don't know\n");
|
warnx("UBX Error, we set a class that we don't know");
|
||||||
decodeInit();
|
decodeInit();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -410,7 +410,7 @@ UBX::parse(uint8_t b, struct vehicle_gps_position_s* gps_position)
|
|||||||
_new_nav_posllh = true;
|
_new_nav_posllh = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
warnx("NAV_POSLLH: checksum invalid\n");
|
warnx("NAV_POSLLH: checksum invalid");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset state machine to decode next packet
|
// Reset state machine to decode next packet
|
||||||
@@ -437,7 +437,7 @@ UBX::parse(uint8_t b, struct vehicle_gps_position_s* gps_position)
|
|||||||
_new_nav_sol = true;
|
_new_nav_sol = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
warnx("NAV_SOL: checksum invalid\n");
|
warnx("NAV_SOL: checksum invalid");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset state machine to decode next packet
|
// Reset state machine to decode next packet
|
||||||
@@ -463,7 +463,7 @@ UBX::parse(uint8_t b, struct vehicle_gps_position_s* gps_position)
|
|||||||
_new_nav_dop = true;
|
_new_nav_dop = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
warnx("NAV_DOP: checksum invalid\n");
|
warnx("NAV_DOP: checksum invalid");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset state machine to decode next packet
|
// Reset state machine to decode next packet
|
||||||
@@ -499,7 +499,7 @@ UBX::parse(uint8_t b, struct vehicle_gps_position_s* gps_position)
|
|||||||
_new_nav_timeutc = true;
|
_new_nav_timeutc = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printf("\t[gps] NAV_TIMEUTC: checksum invalid\n");
|
warnx("NAV_TIMEUTC: checksum invalid");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset state machine to decode next packet
|
// Reset state machine to decode next packet
|
||||||
@@ -593,7 +593,7 @@ UBX::parse(uint8_t b, struct vehicle_gps_position_s* gps_position)
|
|||||||
// as this message arrives only with 1Hz and is not essential, we don't take it into account for the report
|
// as this message arrives only with 1Hz and is not essential, we don't take it into account for the report
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printf("\t[gps] NAV_SVINFO: checksum invalid\n");
|
warnx("NAV_SVINFO: checksum invalid");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset state machine to decode next packet
|
// Reset state machine to decode next packet
|
||||||
@@ -624,7 +624,7 @@ UBX::parse(uint8_t b, struct vehicle_gps_position_s* gps_position)
|
|||||||
_new_nav_velned = true;
|
_new_nav_velned = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
warnx("NAV_VELNED: checksum invalid\n");
|
warnx("NAV_VELNED: checksum invalid");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset state machine to decode next packet
|
// Reset state machine to decode next packet
|
||||||
@@ -719,7 +719,7 @@ UBX::parse(uint8_t b, struct vehicle_gps_position_s* gps_position)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
warnx("ACK_ACK: checksum invalid\n");
|
warnx("ACK_ACK: checksum invalid");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset state machine to decode next packet
|
// Reset state machine to decode next packet
|
||||||
@@ -736,7 +736,7 @@ UBX::parse(uint8_t b, struct vehicle_gps_position_s* gps_position)
|
|||||||
//Check if checksum is valid
|
//Check if checksum is valid
|
||||||
if (_rx_ck_a == packet->ck_a && _rx_ck_b == packet->ck_b) {
|
if (_rx_ck_a == packet->ck_a && _rx_ck_b == packet->ck_b) {
|
||||||
|
|
||||||
warnx("the ubx gps returned: not acknowledged\n");
|
warnx("UBX: NO ACK");
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -751,7 +751,7 @@ UBX::parse(uint8_t b, struct vehicle_gps_position_s* gps_position)
|
|||||||
}
|
}
|
||||||
|
|
||||||
default: //we don't know the message
|
default: //we don't know the message
|
||||||
printf("Unknown message received: %d-%d\n",_message_class,_message_id);
|
warnx("UBX: Unknown message received: %d-%d\n",_message_class,_message_id);
|
||||||
decodeInit();
|
decodeInit();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -760,7 +760,7 @@ UBX::parse(uint8_t b, struct vehicle_gps_position_s* gps_position)
|
|||||||
if (_rx_count < RECV_BUFFER_SIZE) {
|
if (_rx_count < RECV_BUFFER_SIZE) {
|
||||||
_rx_count++;
|
_rx_count++;
|
||||||
} else {
|
} else {
|
||||||
printf("Buffer full");
|
warnx("buffer overflow");
|
||||||
decodeInit();
|
decodeInit();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user