diff --git a/MCP79412RTC.h b/MCP79412RTC.h index edee9ad..b24fcd7 100644 --- a/MCP79412RTC.h +++ b/MCP79412RTC.h @@ -22,13 +22,17 @@ *----------------------------------------------------------------------*/ #ifndef MCP79412RTC_h -#define MCP79412RTC_h -#include + #define MCP79412RTC_h + #include #if defined(ARDUINO) && ARDUINO >= 100 -#include + #include #else -#include + #include +#endif + +#ifndef _BV //Macro is defined in AVR libraries not present in SAMD21 + #define _BV(bit) (1 << (bit)) //if the macro isn't defined, define it #endif //MCP7941x I2C Addresses @@ -127,6 +131,10 @@ class MCP79412RTC static uint8_t bcd2dec(uint8_t num); }; +#ifdef RTC // From Paul Stoffregen's DS1307RTC library + #undef RTC // workaround for Arduino Due/Zero, which defines "RTC"... +#endif + extern MCP79412RTC RTC; #endif