Skip tests for unsupported platforms; removed do nothing pieces
This commit is contained in:
parent
d7c9f848f6
commit
bf079ad2cd
|
|
@ -1,6 +1,3 @@
|
|||
// Only for boards that support hardware serial
|
||||
#ifdef Serial1
|
||||
|
||||
// Test code for Ultimate GPS Using Hardware Serial
|
||||
// (e.g. GPS for Leonardo, Flora or FeatherWing)
|
||||
//
|
||||
|
|
@ -44,8 +41,3 @@ void loop() {
|
|||
Serial.write(c);
|
||||
}
|
||||
}
|
||||
|
||||
#else // Do nothing for boards without hardware serial
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
// Only for boards that support hardware serial
|
||||
#ifdef Serial1
|
||||
|
||||
// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
|
||||
//
|
||||
// This code turns on the LOCUS built-in datalogger. The datalogger
|
||||
|
|
@ -67,8 +64,3 @@ void loop() // run over and over again
|
|||
Serial.write(c);
|
||||
}
|
||||
}//loop
|
||||
|
||||
#else // Do nothing for boards without hardware serial
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
// Only for boards that support hardware serial
|
||||
#ifdef Serial1
|
||||
|
||||
// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
|
||||
//
|
||||
// This code erases the LOCUS built-in datalogger storage
|
||||
|
|
@ -69,8 +66,3 @@ void loop() // run over and over again
|
|||
Serial.write(c);
|
||||
}
|
||||
}
|
||||
|
||||
#else // Do nothing for boards without hardware serial
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
// Only for boards that support hardware serial
|
||||
#ifdef Serial1
|
||||
|
||||
// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
|
||||
//
|
||||
// This code turns on the LOCUS built-in datalogger. The datalogger
|
||||
|
|
@ -72,9 +69,3 @@ void loop() // run over and over again
|
|||
}
|
||||
|
||||
/******************************************************************/
|
||||
|
||||
|
||||
#else // Do nothing for boards without hardware serial
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
// Only for boards that support hardware serial
|
||||
#ifdef Serial1
|
||||
|
||||
// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
|
||||
//
|
||||
// This code turns on the LOCUS built-in datalogger. The datalogger
|
||||
|
|
@ -103,8 +100,3 @@ void loop() // run over and over again
|
|||
}//if (GPS.LOCUS_ReadStatus())
|
||||
}//if (millis() > updateTime)
|
||||
}//loop
|
||||
|
||||
#else // Do nothing for boards without hardware serial
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
// Only for boards that support hardware serial
|
||||
#ifdef Serial1
|
||||
|
||||
// Test code for Ultimate GPS Using Hardware Serial (e.g. GPS Flora or FeatherWing)
|
||||
//
|
||||
// This code shows how to listen to the GPS module via polling. Best used with
|
||||
|
|
@ -108,8 +105,3 @@ void loop() // run over and over again
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else // Do nothing for boards without hardware serial
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -9,9 +9,6 @@
|
|||
// Pick one up today at the Adafruit electronics shop
|
||||
// and help support open source hardware & software! -ada
|
||||
|
||||
// Only for 328 and ESP8266
|
||||
#if defined(__AVR_ATmega328P__) || defined(ESP8266)
|
||||
|
||||
#include <Adafruit_GPS.h>
|
||||
#include <SoftwareSerial.h>
|
||||
|
||||
|
|
@ -66,8 +63,3 @@ void loop() {
|
|||
Serial.write(c);
|
||||
}
|
||||
}
|
||||
|
||||
#else // Do nothing for other boards
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,9 +10,6 @@
|
|||
// Pick one up today at the Adafruit electronics shop
|
||||
// and help support open source hardware & software! -ada
|
||||
|
||||
// Only for 328 and ESP8266
|
||||
#if defined(__AVR_ATmega328P__) || defined(ESP8266)
|
||||
|
||||
#include <Adafruit_GPS.h>
|
||||
#include <SoftwareSerial.h>
|
||||
|
||||
|
|
@ -61,8 +58,3 @@ void loop() // run over and over again
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else // Do nothing for other boards
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@
|
|||
// Pick one up today at the Adafruit electronics shop
|
||||
// and help support open source hardware & software! -ada
|
||||
|
||||
// Only for 328 and ESP8266
|
||||
#if defined(__AVR_ATmega328P__) || defined(ESP8266)
|
||||
|
||||
#include <Adafruit_GPS.h>
|
||||
#include <SoftwareSerial.h>
|
||||
|
||||
|
|
@ -31,7 +28,6 @@ Adafruit_GPS GPS(&mySerial);
|
|||
// off by default!
|
||||
#ifndef ESP8266 // Sadly not on ESP8266
|
||||
boolean usingInterrupt = false;
|
||||
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy
|
||||
#endif
|
||||
|
||||
void setup()
|
||||
|
|
@ -102,8 +98,3 @@ void useInterrupt(boolean v) {
|
|||
}
|
||||
}
|
||||
#endif // ESP8266
|
||||
|
||||
#else // Do nothing for other boards
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,9 +10,6 @@
|
|||
// Pick one up today at the Adafruit electronics shop
|
||||
// and help support open source hardware & software! -ada
|
||||
|
||||
// Only for 328 and ESP8266
|
||||
#if defined(__AVR_ATmega328P__) || defined(ESP8266)
|
||||
|
||||
#include <Adafruit_GPS.h>
|
||||
#include <SoftwareSerial.h>
|
||||
|
||||
|
|
@ -33,7 +30,6 @@ Adafruit_GPS GPS(&mySerial);
|
|||
// off by default!
|
||||
#ifndef ESP8266 // Sadly not on ESP8266
|
||||
boolean usingInterrupt = false;
|
||||
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy
|
||||
#endif
|
||||
|
||||
void setup()
|
||||
|
|
@ -107,8 +103,3 @@ void useInterrupt(boolean v) {
|
|||
}
|
||||
}
|
||||
#endif // ESP8266
|
||||
|
||||
#else // Do nothing for other boards
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,9 +10,6 @@
|
|||
// Pick one up today at the Adafruit electronics shop
|
||||
// and help support open source hardware & software! -ada
|
||||
|
||||
// Only for 328 and ESP8266
|
||||
#if defined(__AVR_ATmega328P__) || defined(ESP8266)
|
||||
|
||||
#include <Adafruit_GPS.h>
|
||||
#include <SoftwareSerial.h>
|
||||
|
||||
|
|
@ -33,7 +30,6 @@ Adafruit_GPS GPS(&mySerial);
|
|||
// off by default!
|
||||
#ifndef ESP8266 // Sadly not on ESP8266
|
||||
boolean usingInterrupt = false;
|
||||
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy
|
||||
#endif
|
||||
|
||||
void setup()
|
||||
|
|
@ -145,8 +141,3 @@ void useInterrupt(boolean v) {
|
|||
}
|
||||
}
|
||||
#endif // ESP8266
|
||||
|
||||
#else // Do nothing for other boards
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -11,9 +11,6 @@
|
|||
// Pick one up today at the Adafruit electronics shop
|
||||
// and help support open source hardware & software! -ada
|
||||
|
||||
// Only for 328 and ESP8266
|
||||
#if defined(__AVR_ATmega328P__) || defined(ESP8266)
|
||||
|
||||
#include <Adafruit_GPS.h>
|
||||
#include <SoftwareSerial.h>
|
||||
|
||||
|
|
@ -112,8 +109,3 @@ void loop() // run over and over again
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else // Do nothing for other boards
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
// Only for AVR boards with SoftwareSerial
|
||||
#if defined(__AVR__)
|
||||
|
||||
#include <SPI.h>
|
||||
#include <Adafruit_GPS.h>
|
||||
#include <SoftwareSerial.h>
|
||||
|
|
@ -31,8 +28,9 @@ Adafruit_GPS GPS(&mySerial);
|
|||
|
||||
// this keeps track of whether we're using the interrupt
|
||||
// off by default!
|
||||
#ifndef ESP8266 // Sadly not on ESP8266
|
||||
boolean usingInterrupt = false;
|
||||
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy
|
||||
#endif
|
||||
|
||||
// Set the pins used
|
||||
#define chipSelect 10
|
||||
|
|
@ -133,13 +131,16 @@ void setup() {
|
|||
// the nice thing about this code is you can have a timer0 interrupt go off
|
||||
// every 1 millisecond, and read data from the GPS for you. that makes the
|
||||
// loop code a heck of a lot easier!
|
||||
#ifndef ESP8266 // Not on ESP8266
|
||||
useInterrupt(true);
|
||||
#endif
|
||||
|
||||
Serial.println("Ready!");
|
||||
}
|
||||
|
||||
|
||||
// Interrupt is called once a millisecond, looks for any new GPS data, and stores it
|
||||
#ifndef ESP8266 // Not on ESP8266
|
||||
ISR(TIMER0_COMPA_vect) {
|
||||
char c = GPS.read();
|
||||
// if you want to debug, this is a good time to do it!
|
||||
|
|
@ -165,6 +166,7 @@ void useInterrupt(boolean v) {
|
|||
usingInterrupt = false;
|
||||
}
|
||||
}
|
||||
#endif // ESP8266
|
||||
|
||||
void loop() {
|
||||
if (! usingInterrupt) {
|
||||
|
|
@ -206,8 +208,3 @@ void loop() {
|
|||
Serial.println();
|
||||
}
|
||||
}
|
||||
|
||||
#else // Do nothing for other boards
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue