mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-11 02:13:57 -04:00
AP_GPS_SBF: add sd logging by default, improve init
This commit is contained in:
parent
0bcc6e324a
commit
1c1eea6119
@ -56,10 +56,15 @@ AP_GPS_SBF::read(void)
|
|||||||
uint32_t now = AP_HAL::millis();
|
uint32_t now = AP_HAL::millis();
|
||||||
|
|
||||||
if (_init_blob_index < (sizeof(_initialisation_blob) / sizeof(_initialisation_blob[0]))) {
|
if (_init_blob_index < (sizeof(_initialisation_blob) / sizeof(_initialisation_blob[0]))) {
|
||||||
|
if (validcommand) {
|
||||||
|
_init_blob_index++;
|
||||||
|
validcommand = false;
|
||||||
|
_init_blob_time = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (now > _init_blob_time) {
|
if (now > _init_blob_time) {
|
||||||
port->write((const uint8_t*)_initialisation_blob[_init_blob_index], strlen(_initialisation_blob[_init_blob_index]));
|
port->write((const uint8_t*)_initialisation_blob[_init_blob_index], strlen(_initialisation_blob[_init_blob_index]));
|
||||||
_init_blob_time = now + 70;
|
_init_blob_time = now + 1000;
|
||||||
_init_blob_index++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,11 +87,17 @@ AP_GPS_SBF::parse(uint8_t temp)
|
|||||||
if (temp == SBF_PREAMBLE1) {
|
if (temp == SBF_PREAMBLE1) {
|
||||||
sbf_msg.sbf_state = sbf_msg_parser_t::PREAMBLE2;
|
sbf_msg.sbf_state = sbf_msg_parser_t::PREAMBLE2;
|
||||||
sbf_msg.read = 0;
|
sbf_msg.read = 0;
|
||||||
|
} else if (temp == '$') {
|
||||||
|
// this is a command response
|
||||||
|
sbf_msg.sbf_state = sbf_msg_parser_t::PREAMBLE2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case sbf_msg_parser_t::PREAMBLE2:
|
case sbf_msg_parser_t::PREAMBLE2:
|
||||||
if (temp == SBF_PREAMBLE2) {
|
if (temp == SBF_PREAMBLE2) {
|
||||||
sbf_msg.sbf_state = sbf_msg_parser_t::CRC1;
|
sbf_msg.sbf_state = sbf_msg_parser_t::CRC1;
|
||||||
|
} else if (temp == 'R') {
|
||||||
|
validcommand = true;
|
||||||
|
sbf_msg.sbf_state = sbf_msg_parser_t::PREAMBLE1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -48,15 +48,17 @@ private:
|
|||||||
|
|
||||||
uint8_t _init_blob_index = 0;
|
uint8_t _init_blob_index = 0;
|
||||||
uint32_t _init_blob_time = 0;
|
uint32_t _init_blob_time = 0;
|
||||||
const char* _initialisation_blob[4] = {
|
const char* _initialisation_blob[5] = {
|
||||||
"sso, Stream1, COM1, PVTGeodetic+DOP+ExtEventPVTGeodetic, msec100\n",
|
"sso, Stream1, COM1, PVTGeodetic+DOP+ExtEventPVTGeodetic, msec100\n",
|
||||||
"srd, Moderate, UAV\n",
|
"srd, Moderate, UAV\n",
|
||||||
"sem, PVT, 5\n",
|
"sem, PVT, 5\n",
|
||||||
"spm, Rover, StandAlone+DGPS+RTK\n"};
|
"spm, Rover, StandAlone+SBAS+DGPS+RTK\n",
|
||||||
|
"sso, Stream2, Dsk1, Rinex+Event+RawData, msec100\n"};
|
||||||
|
|
||||||
uint32_t last_hdop = 999;
|
uint32_t last_hdop = 999;
|
||||||
uint32_t crc_error_counter = 0;
|
uint32_t crc_error_counter = 0;
|
||||||
uint32_t last_injected_data_ms = 0;
|
uint32_t last_injected_data_ms = 0;
|
||||||
|
bool validcommand = false;
|
||||||
|
|
||||||
struct PACKED msg4007
|
struct PACKED msg4007
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user