@@ -87,7 +87,6 @@ byte CFG_CFG[] = {
8787// helper functions to send UBX commands to ublox gps chip
8888
8989void sendPacket (byte *packet, byte len) {
90-
9190 uint8_t CK_A = 0 ;
9291 uint8_t CK_B = 0 ;
9392
@@ -107,7 +106,6 @@ void restoreDefaults() { sendPacket(CFG_CFG, sizeof(CFG_CFG)); }
107106void changeBaudrate () { sendPacket (CFG_PRT, sizeof (CFG_PRT)); }
108107
109108void disableNmea () {
110-
111109 // tinygps++ processes only $GPGGA/$GNGGA and $GPRMC/$GNRMC
112110 // thus, we disable all other NMEA messages
113111
@@ -128,7 +126,6 @@ void disableNmea() {
128126
129127// initialize and configure GPS
130128int gps_init (void ) {
131-
132129 ESP_LOGI (TAG, " Opening serial GPS" );
133130
134131 GPS_Serial.begin (GPS_SERIAL);
@@ -144,7 +141,6 @@ int gps_init(void) {
144141 disableNmea ();
145142
146143 return 1 ;
147-
148144} // gps_init()
149145
150146// store current GPS location data in struct
@@ -170,13 +166,11 @@ bool gps_hasfix() {
170166
171167// function to poll UTC time from GPS NMEA data; note: this is costly
172168time_t get_gpstime (uint16_t *msec = 0 ) {
173-
174169 const uint16_t txDelay =
175170 70U * 1000 / (GPS_BAUDRATE / 9 ); // serial tx of 70 NMEA chars
176171
177172 // did we get a current date & time?
178173 if (gps.time .age () < 1000 ) {
179-
180174 // convert tinygps time format to struct tm format
181175 struct tm gps_tm = {0 };
182176 gps_tm.tm_sec = gps.time .second ();
@@ -209,26 +203,22 @@ time_t get_gpstime(uint16_t *msec = 0) {
209203
210204 ESP_LOGD (TAG, " no valid GPS time" );
211205 return 0 ;
212-
213206} // get_gpstime()
214207
215208// GPS serial feed FreeRTos Task
216209void gps_loop (void *pvParameters) {
217-
218210 _ASSERT ((uint32_t )pvParameters == 1 ); // FreeRTOS check
219211
220212 // feed GPS decoder with serial NMEA data from GPS device
221213 while (1 ) {
222214 while (cfg.payloadmask & GPS_DATA) {
223-
224215 while (GPS_Serial.available ())
225216 gps.encode (GPS_Serial.read ());
226217
227218 delay (5 );
228219 }
229220 delay (1000 );
230221 } // infinite while loop
231-
232222} // gps_loop()
233223
234224#endif // HAS_GPS
0 commit comments