From defdba557d9d3264b78ad8238cded5be82221ad0 Mon Sep 17 00:00:00 2001 From: driverblock Date: Wed, 30 Jul 2014 09:18:03 -0400 Subject: [PATCH] Added interrupt support Added interrupt support to shield_sdlog sketch --- examples/shield_sdlog/shield_sdlog.ino | 97 +++++++++++++++++++------- 1 file changed, 73 insertions(+), 24 deletions(-) diff --git a/examples/shield_sdlog/shield_sdlog.ino b/examples/shield_sdlog/shield_sdlog.ino index 6b948f3..3e92e90 100644 --- a/examples/shield_sdlog/shield_sdlog.ino +++ b/examples/shield_sdlog/shield_sdlog.ino @@ -26,6 +26,11 @@ Adafruit_GPS GPS(&mySerial); /* set to true to only log to SD when GPS has a fix, for debugging, keep it false */ #define LOG_FIXONLY false +// this keeps track of whether we're using the interrupt +// off by default! +boolean usingInterrupt = false; +void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy + // Set the pins used #define chipSelect 10 #define ledPin 13 @@ -46,14 +51,14 @@ uint8_t parseHex(char c) { // blink out an error code void error(uint8_t errno) { -/* + /* if (SD.errorCode()) { - putstring("SD error: "); - Serial.print(card.errorCode(), HEX); - Serial.print(','); - Serial.println(card.errorData(), HEX); - } - */ + putstring("SD error: "); + Serial.print(card.errorCode(), HEX); + Serial.print(','); + Serial.println(card.errorData(), HEX); + } + */ while(1) { uint8_t i; for (i=0; i