With eeprom_is_ready() for AVR-processors (#13)
* with eepromReady for AVR * with eepromReady for AVR
This commit is contained in:
committed by
Alex Shepherd
parent
07933e42a8
commit
0d2e8daeaf
15
NmraDcc.cpp
15
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 <avr/eeprom.h>
|
||||
#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
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user