Skip tests for unsupported platforms; removed do nothing pieces

This commit is contained in:
Matt Goodrich 2019-03-14 17:05:30 -04:00
parent d7c9f848f6
commit bf079ad2cd
54 changed files with 6 additions and 109 deletions

View File

@ -1,6 +1,3 @@
// Only for boards that support hardware serial
#ifdef Serial1
// Test code for Ultimate GPS Using Hardware Serial // Test code for Ultimate GPS Using Hardware Serial
// (e.g. GPS for Leonardo, Flora or FeatherWing) // (e.g. GPS for Leonardo, Flora or FeatherWing)
// //
@ -44,8 +41,3 @@ void loop() {
Serial.write(c); Serial.write(c);
} }
} }
#else // Do nothing for boards without hardware serial
void setup() {}
void loop() {}
#endif

View File

@ -1,6 +1,3 @@
// Only for boards that support hardware serial
#ifdef Serial1
// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver // Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
// //
// This code turns on the LOCUS built-in datalogger. The datalogger // 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); Serial.write(c);
} }
}//loop }//loop
#else // Do nothing for boards without hardware serial
void setup() {}
void loop() {}
#endif

View File

@ -1,6 +1,3 @@
// Only for boards that support hardware serial
#ifdef Serial1
// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver // Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
// //
// This code erases the LOCUS built-in datalogger storage // This code erases the LOCUS built-in datalogger storage
@ -69,8 +66,3 @@ void loop() // run over and over again
Serial.write(c); Serial.write(c);
} }
} }
#else // Do nothing for boards without hardware serial
void setup() {}
void loop() {}
#endif

View File

@ -1,6 +1,3 @@
// Only for boards that support hardware serial
#ifdef Serial1
// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver // Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
// //
// This code turns on the LOCUS built-in datalogger. The datalogger // 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

View File

@ -1,6 +1,3 @@
// Only for boards that support hardware serial
#ifdef Serial1
// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver // Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
// //
// This code turns on the LOCUS built-in datalogger. The datalogger // 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 (GPS.LOCUS_ReadStatus())
}//if (millis() > updateTime) }//if (millis() > updateTime)
}//loop }//loop
#else // Do nothing for boards without hardware serial
void setup() {}
void loop() {}
#endif

View File

@ -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) // 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 // 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

View File

@ -9,9 +9,6 @@
// Pick one up today at the Adafruit electronics shop // Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada // and help support open source hardware & software! -ada
// Only for 328 and ESP8266
#if defined(__AVR_ATmega328P__) || defined(ESP8266)
#include <Adafruit_GPS.h> #include <Adafruit_GPS.h>
#include <SoftwareSerial.h> #include <SoftwareSerial.h>
@ -66,8 +63,3 @@ void loop() {
Serial.write(c); Serial.write(c);
} }
} }
#else // Do nothing for other boards
void setup() {}
void loop() {}
#endif

View File

@ -10,9 +10,6 @@
// Pick one up today at the Adafruit electronics shop // Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada // and help support open source hardware & software! -ada
// Only for 328 and ESP8266
#if defined(__AVR_ATmega328P__) || defined(ESP8266)
#include <Adafruit_GPS.h> #include <Adafruit_GPS.h>
#include <SoftwareSerial.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

View File

@ -8,9 +8,6 @@
// Pick one up today at the Adafruit electronics shop // Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada // and help support open source hardware & software! -ada
// Only for 328 and ESP8266
#if defined(__AVR_ATmega328P__) || defined(ESP8266)
#include <Adafruit_GPS.h> #include <Adafruit_GPS.h>
#include <SoftwareSerial.h> #include <SoftwareSerial.h>
@ -31,7 +28,6 @@ Adafruit_GPS GPS(&mySerial);
// off by default! // off by default!
#ifndef ESP8266 // Sadly not on ESP8266 #ifndef ESP8266 // Sadly not on ESP8266
boolean usingInterrupt = false; boolean usingInterrupt = false;
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy
#endif #endif
void setup() void setup()
@ -102,8 +98,3 @@ void useInterrupt(boolean v) {
} }
} }
#endif // ESP8266 #endif // ESP8266
#else // Do nothing for other boards
void setup() {}
void loop() {}
#endif

View File

@ -10,9 +10,6 @@
// Pick one up today at the Adafruit electronics shop // Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada // and help support open source hardware & software! -ada
// Only for 328 and ESP8266
#if defined(__AVR_ATmega328P__) || defined(ESP8266)
#include <Adafruit_GPS.h> #include <Adafruit_GPS.h>
#include <SoftwareSerial.h> #include <SoftwareSerial.h>
@ -33,7 +30,6 @@ Adafruit_GPS GPS(&mySerial);
// off by default! // off by default!
#ifndef ESP8266 // Sadly not on ESP8266 #ifndef ESP8266 // Sadly not on ESP8266
boolean usingInterrupt = false; boolean usingInterrupt = false;
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy
#endif #endif
void setup() void setup()
@ -107,8 +103,3 @@ void useInterrupt(boolean v) {
} }
} }
#endif // ESP8266 #endif // ESP8266
#else // Do nothing for other boards
void setup() {}
void loop() {}
#endif

View File

@ -10,9 +10,6 @@
// Pick one up today at the Adafruit electronics shop // Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada // and help support open source hardware & software! -ada
// Only for 328 and ESP8266
#if defined(__AVR_ATmega328P__) || defined(ESP8266)
#include <Adafruit_GPS.h> #include <Adafruit_GPS.h>
#include <SoftwareSerial.h> #include <SoftwareSerial.h>
@ -33,7 +30,6 @@ Adafruit_GPS GPS(&mySerial);
// off by default! // off by default!
#ifndef ESP8266 // Sadly not on ESP8266 #ifndef ESP8266 // Sadly not on ESP8266
boolean usingInterrupt = false; boolean usingInterrupt = false;
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy
#endif #endif
void setup() void setup()
@ -145,8 +141,3 @@ void useInterrupt(boolean v) {
} }
} }
#endif // ESP8266 #endif // ESP8266
#else // Do nothing for other boards
void setup() {}
void loop() {}
#endif

View File

@ -11,9 +11,6 @@
// Pick one up today at the Adafruit electronics shop // Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada // and help support open source hardware & software! -ada
// Only for 328 and ESP8266
#if defined(__AVR_ATmega328P__) || defined(ESP8266)
#include <Adafruit_GPS.h> #include <Adafruit_GPS.h>
#include <SoftwareSerial.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

View File

View File

View File

View File

View File

View File

@ -1,6 +1,3 @@
// Only for AVR boards with SoftwareSerial
#if defined(__AVR__)
#include <SPI.h> #include <SPI.h>
#include <Adafruit_GPS.h> #include <Adafruit_GPS.h>
#include <SoftwareSerial.h> #include <SoftwareSerial.h>
@ -31,8 +28,9 @@ Adafruit_GPS GPS(&mySerial);
// this keeps track of whether we're using the interrupt // this keeps track of whether we're using the interrupt
// off by default! // off by default!
#ifndef ESP8266 // Sadly not on ESP8266
boolean usingInterrupt = false; boolean usingInterrupt = false;
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy #endif
// Set the pins used // Set the pins used
#define chipSelect 10 #define chipSelect 10
@ -133,13 +131,16 @@ void setup() {
// the nice thing about this code is you can have a timer0 interrupt go off // 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 // every 1 millisecond, and read data from the GPS for you. that makes the
// loop code a heck of a lot easier! // loop code a heck of a lot easier!
#ifndef ESP8266 // Not on ESP8266
useInterrupt(true); useInterrupt(true);
#endif
Serial.println("Ready!"); Serial.println("Ready!");
} }
// Interrupt is called once a millisecond, looks for any new GPS data, and stores it // Interrupt is called once a millisecond, looks for any new GPS data, and stores it
#ifndef ESP8266 // Not on ESP8266
ISR(TIMER0_COMPA_vect) { ISR(TIMER0_COMPA_vect) {
char c = GPS.read(); char c = GPS.read();
// if you want to debug, this is a good time to do it! // if you want to debug, this is a good time to do it!
@ -165,6 +166,7 @@ void useInterrupt(boolean v) {
usingInterrupt = false; usingInterrupt = false;
} }
} }
#endif // ESP8266
void loop() { void loop() {
if (! usingInterrupt) { if (! usingInterrupt) {
@ -206,8 +208,3 @@ void loop() {
Serial.println(); Serial.println();
} }
} }
#else // Do nothing for other boards
void setup() {}
void loop() {}
#endif