diff --git a/teensy/CrashReport.cpp b/teensy/CrashReport.cpp new file mode 100644 index 000000000..1b66900ff --- /dev/null +++ b/teensy/CrashReport.cpp @@ -0,0 +1,19 @@ +#include +#include + +size_t CrashReportClass::printTo(Print& p) const +{ + p.println("CrashReport is not available on Teensy 2.0"); + return 1; +} + +void CrashReportClass::clear() +{ +} + +CrashReportClass::operator bool() +{ + return false; +} + +CrashReportClass CrashReport; diff --git a/teensy/CrashReport.h b/teensy/CrashReport.h new file mode 100644 index 000000000..a92ff0091 --- /dev/null +++ b/teensy/CrashReport.h @@ -0,0 +1,13 @@ +#pragma once + +#include +#include + +class CrashReportClass: public Printable { +public: + virtual size_t printTo(Print& p) const; + void clear(); + operator bool(); +}; + +extern CrashReportClass CrashReport; diff --git a/teensy/WProgram.h b/teensy/WProgram.h index 6fb547125..dbdf504e1 100644 --- a/teensy/WProgram.h +++ b/teensy/WProgram.h @@ -24,6 +24,7 @@ #include "WString.h" #include "HardwareSerial.h" #include "elapsedMillis.h" +#include "CrashReport.h" uint16_t makeWord(uint16_t w); uint16_t makeWord(byte h, byte l); diff --git a/teensy3/CrashReport.cpp b/teensy3/CrashReport.cpp new file mode 100644 index 000000000..969e774ed --- /dev/null +++ b/teensy3/CrashReport.cpp @@ -0,0 +1,19 @@ +#include +#include + +size_t CrashReportClass::printTo(Print& p) const +{ + p.println("CrashReport is not available on Teensy LC & 3.x"); + return 1; +} + +void CrashReportClass::clear() +{ +} + +CrashReportClass::operator bool() +{ + return false; +} + +CrashReportClass CrashReport; diff --git a/teensy3/CrashReport.h b/teensy3/CrashReport.h new file mode 100644 index 000000000..a92ff0091 --- /dev/null +++ b/teensy3/CrashReport.h @@ -0,0 +1,13 @@ +#pragma once + +#include +#include + +class CrashReportClass: public Printable { +public: + virtual size_t printTo(Print& p) const; + void clear(); + operator bool(); +}; + +extern CrashReportClass CrashReport; diff --git a/teensy3/WProgram.h b/teensy3/WProgram.h index 0b4f7fe9f..79c65409a 100644 --- a/teensy3/WProgram.h +++ b/teensy3/WProgram.h @@ -70,6 +70,7 @@ #include "WString.h" #include "elapsedMillis.h" #include "IntervalTimer.h" +#include "CrashReport.h" uint16_t makeWord(uint16_t w); uint16_t makeWord(byte h, byte l);