From 92dd2e6ac510d2bb24d5ac7a1190693285c2760f Mon Sep 17 00:00:00 2001 From: Franz-Peter Date: Thu, 25 May 2017 05:19:17 +0200 Subject: [PATCH] With eeprom_is_ready() for AVR-processors (#13) * with eepromReady for AVR * with eepromReady for AVR --- NmraDcc.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/NmraDcc.cpp b/NmraDcc.cpp index 51920c0..2ec843d 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 @@ -288,9 +291,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 @@ -500,7 +503,11 @@ void writeEEPROM( unsigned int CV, uint8_t Value ) { } bool readyEEPROM() { - return true; + #ifdef __AVR_MEGA__ + return eeprom_is_ready(); + #else + return true; + #endif }