mirror of
https://github.com/adafruit/Adafruit_GPS.git
synced 2026-10-27 06:20:18 +00:00
Merge branch 'master' of github.com:adafruit/Adafruit-GPS-Library
This commit is contained in:
commit
e0beddd274
3 files changed
+13
-10
No files matched your search
+6
-6
@@ -9,7 +9,7 @@ Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
BSD license, check license.txt for more information
|
||||
All text above must be included in any redistribution
|
||||
****************************************/
|
||||
#ifdef __AVR__
|
||||
#if defined(__AVR__) && defined(USE_SW_SERIAL)
|
||||
// Only include software serial on AVR platforms (i.e. not on Due).
|
||||
#include <SoftwareSerial.h>
|
||||
#endif
|
||||
@@ -268,7 +268,7 @@ char Adafruit_GPS::read(void) {
|
||||
|
||||
if (paused) return c;
|
||||
|
||||
#ifdef __AVR__
|
||||
#if defined(__AVR__) && defined(USE_SW_SERIAL)
|
||||
if(gpsSwSerial) {
|
||||
if(!gpsSwSerial->available()) return c;
|
||||
c = gpsSwSerial->read();
|
||||
@@ -310,7 +310,7 @@ char Adafruit_GPS::read(void) {
|
||||
return c;
|
||||
}
|
||||
|
||||
#ifdef __AVR__
|
||||
#if defined(__AVR__) && defined(USE_SW_SERIAL)
|
||||
// Constructor when using SoftwareSerial or NewSoftSerial
|
||||
#if ARDUINO >= 100
|
||||
Adafruit_GPS::Adafruit_GPS(SoftwareSerial *ser)
|
||||
@@ -331,7 +331,7 @@ Adafruit_GPS::Adafruit_GPS(HardwareSerial *ser) {
|
||||
|
||||
// Initialization code used by all constructor types
|
||||
void Adafruit_GPS::common_init(void) {
|
||||
#ifdef __AVR__
|
||||
#if defined(__AVR__) && defined(USE_SW_SERIAL)
|
||||
gpsSwSerial = NULL; // Set both to NULL, then override correct
|
||||
#endif
|
||||
gpsHwSerial = NULL; // port pointer in corresponding constructor
|
||||
@@ -352,7 +352,7 @@ void Adafruit_GPS::common_init(void) {
|
||||
|
||||
void Adafruit_GPS::begin(uint32_t baud)
|
||||
{
|
||||
#ifdef __AVR__
|
||||
#if defined(__AVR__) && defined(USE_SW_SERIAL)
|
||||
if(gpsSwSerial)
|
||||
gpsSwSerial->begin(baud);
|
||||
else
|
||||
@@ -363,7 +363,7 @@ void Adafruit_GPS::begin(uint32_t baud)
|
||||
}
|
||||
|
||||
void Adafruit_GPS::sendCommand(const char *str) {
|
||||
#ifdef __AVR__
|
||||
#if defined(__AVR__) && defined(USE_SW_SERIAL)
|
||||
if(gpsSwSerial)
|
||||
gpsSwSerial->println(str);
|
||||
else
|
||||
|
||||
+6
-3
@@ -21,7 +21,10 @@ All text above must be included in any redistribution
|
||||
#ifndef _ADAFRUIT_GPS_H
|
||||
#define _ADAFRUIT_GPS_H
|
||||
|
||||
#ifdef __AVR__
|
||||
//comment this out if you don't want to include software serial in the library
|
||||
#define USE_SW_SERIAL
|
||||
|
||||
#if defined(__AVR__) && defined(USE_SW_SERIAL)
|
||||
#if ARDUINO >= 100
|
||||
#include <SoftwareSerial.h>
|
||||
#else
|
||||
@@ -102,7 +105,7 @@ class Adafruit_GPS {
|
||||
public:
|
||||
void begin(uint32_t baud);
|
||||
|
||||
#ifdef __AVR__
|
||||
#if defined(__AVR__) && defined(USE_SW_SERIAL)
|
||||
#if ARDUINO >= 100
|
||||
Adafruit_GPS(SoftwareSerial *ser); // Constructor when using SoftwareSerial
|
||||
#else
|
||||
@@ -155,7 +158,7 @@ class Adafruit_GPS {
|
||||
boolean paused;
|
||||
|
||||
uint8_t parseResponse(char *response);
|
||||
#ifdef __AVR__
|
||||
#if defined(__AVR__) && defined(USE_SW_SERIAL)
|
||||
#if ARDUINO >= 100
|
||||
SoftwareSerial *gpsSwSerial;
|
||||
#else
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
name=Adafruit GPS Library
|
||||
version=1.0.1
|
||||
version=1.0.2
|
||||
author=Adafruit
|
||||
maintainer=Adafruit <info@adafruit.com>
|
||||
sentence=An interrupt-based GPS library for no-parsing-required use
|
||||
|
||||
Reference in new issue
Block a user