With eeprom_is_ready() for AVR-processors (#13)

* with eepromReady for AVR

* with eepromReady for AVR
This commit is contained in:
Franz-Peter
2017-05-25 05:19:17 +02:00
committed by Alex Shepherd
parent f8f106962f
commit 92dd2e6ac5

View File

@@ -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 <avr/eeprom.h>
#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() {
#ifdef __AVR_MEGA__
return eeprom_is_ready();
#else
return true;
#endif
}