Fix #29 by adjusting interrupt code's serial handling.
This commit is contained in:
parent
91295fa8e2
commit
deef2c00ff
|
|
@ -140,10 +140,7 @@ void setup() {
|
|||
|
||||
// Interrupt is called once a millisecond, looks for any new GPS data, and stores it
|
||||
SIGNAL(TIMER0_COMPA_vect) {
|
||||
char c;
|
||||
while (mySerial.available())
|
||||
{
|
||||
c = GPS.read();
|
||||
char c = GPS.read();
|
||||
// if you want to debug, this is a good time to do it!
|
||||
#ifdef UDR0
|
||||
if (GPSECHO)
|
||||
|
|
@ -152,7 +149,6 @@ SIGNAL(TIMER0_COMPA_vect) {
|
|||
// but only one character can be written at a time.
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void useInterrupt(boolean v) {
|
||||
if (v) {
|
||||
|
|
@ -170,10 +166,10 @@ void useInterrupt(boolean v) {
|
|||
}
|
||||
|
||||
void loop() {
|
||||
char c;
|
||||
while (mySerial.available())
|
||||
{
|
||||
c = GPS.read();
|
||||
if (! usingInterrupt) {
|
||||
// read data from the GPS in the 'main loop'
|
||||
char c = GPS.read();
|
||||
// if you want to debug, this is a good time to do it!
|
||||
if (GPSECHO)
|
||||
if (c) Serial.print(c);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue