File tree Expand file tree Collapse file tree 2 files changed +7
-30
lines changed Expand file tree Collapse file tree 2 files changed +7
-30
lines changed Original file line number Diff line number Diff line change @@ -111,31 +111,6 @@ void GPSController::update() {
111
111
return ; // bail-out!
112
112
113
113
for (GPSHardware *drv : _gps_drivers) {
114
- // Get the GPS driver interface from the hardware instance
115
- WS_DEBUG_PRINTLN (" [gps] Updating GPS driver..." );
116
- Adafruit_GPS *ada_gps = nullptr ;
117
- if (drv->GetDriverType () == GPS_DRV_MTK) {
118
- // Interface shouldn't matter here because we already set it up in the
119
- // initialization phase, so we can just grab the Adafruit_GPS instance
120
- ada_gps = drv->GetAdaGps ();
121
- if (ada_gps == nullptr ) {
122
- WS_DEBUG_PRINTLN (
123
- " [gps] ERROR: Can't read - GPS instance not initialized!" );
124
- continue ;
125
- }
126
- } else if (drv->GetDriverType () == GPS_DRV_UBLOX) {
127
- SFE_UBLOX_GNSS *sfe_gps = drv->GetUbxGps ();
128
- if (sfe_gps == nullptr ) {
129
- WS_DEBUG_PRINTLN (
130
- " [gps] ERROR: Can't read - UBLOX instance not initialized!" );
131
- continue ;
132
- }
133
- } else {
134
- WS_DEBUG_PRINTLN (
135
- " [gps] ERROR: Unsupported GPS driver type, skipping update()!" );
136
- continue ;
137
- }
138
-
139
114
// TODO: Commented out due to parsing failures, stability issue (failed to
140
115
// parse NMEA acks for this) Perform a keep-alive check by sending an
141
116
// antenna check command every 2 seconds
Original file line number Diff line number Diff line change @@ -241,10 +241,10 @@ bool GPSHardware::DetectMtkI2C(uint32_t addr) {
241
241
* otherwise.
242
242
*/
243
243
bool GPSHardware::DetectUbxI2C (uint32_t addr) {
244
- _ubx_gps_ddc = new Adafruit_UBloxDDC (addr, * _wire);
244
+ _ubx_gps_ddc = new Adafruit_UBloxDDC (addr, _wire);
245
245
if (!_ubx_gps_ddc->begin ())
246
246
return false ;
247
- _ubx_gps = new Adafruit_UBX (_ubx_gps_ddc);
247
+ _ubx_gps = new Adafruit_UBX (& _ubx_gps_ddc);
248
248
if (!_ubx_gps->begin ())
249
249
return false ;
250
250
_ubx_gps->verbose_debug = 3 ; // TODO: Set this to 1 in production
@@ -545,10 +545,12 @@ void GPSHardware::PollStoreSentences() {
545
545
WS_DEBUG_PRINT (" Did We get a NMEA sentence? " );
546
546
uint8_t buffer[MAX_LEN_NMEA_SENTENCE];
547
547
String nmeaBuffer = " " ;
548
- int bytesAvailable = gps.available ();
548
+ size_t bytesToRead;
549
+ size_t bytesRead;
550
+ int bytesAvailable = _ubx_gps_ddc->available ();
549
551
if (bytesAvailable > 0 ) {
550
- size_t bytesToRead = min (bytesAvailable, MAX_NEMA_SENTENCE_LEN);
551
- size_t bytesRead = gps. readBytes (buffer, bytesToRead);
552
+ min (bytesAvailable, MAX_NEMA_SENTENCE_LEN);
553
+ _ubx_gps_ddc-> readBytes (buffer, bytesToRead);
552
554
}
553
555
// Build NMEA sentences and parse when complete
554
556
for (size_t i = 0 ; i < bytesRead; i++) {
You can’t perform that action at this time.
0 commit comments