diff --git a/NmraDcc.cpp b/NmraDcc.cpp index 6c8f87f..dc14160 100644 --- a/NmraDcc.cpp +++ b/NmraDcc.cpp @@ -2,7 +2,7 @@ // // Model Railroading with Arduino - NmraDcc.cpp // -// Copyright (c) 2008 - 2105 Alex Shepherd +// Copyright (c) 2008 - 2017 Alex Shepherd // // This source file is subject of the GNU general public license 2, // that is available at the world-wide-web at @@ -32,6 +32,9 @@ //------------------------------------------------------------------------ #include "NmraDcc.h" +#ifdef __AVR_MEGA__ +#include +#endif //------------------------------------------------------------------------ // DCC Receive Routine @@ -290,9 +293,9 @@ void ExternalInterruptHandler(void) } DccBitVal = ( bitMicros < bitMax ); lastMicros = actMicros; - //#ifdef debug + #ifdef debug if(DccBitVal) {SET_TP2;} else {CLR_TP2;}; - //#endif + #endif DCC_IrqRunning = true; interrupts(); // time critical is only the micros() command,so allow nested irq's #ifdef DCC_DEBUG @@ -502,7 +505,11 @@ void writeEEPROM( unsigned int CV, uint8_t Value ) { } bool readyEEPROM() { - return true; + #ifdef __AVR_MEGA__ + return eeprom_is_ready(); + #else + return true; + #endif }