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
f8f106962f
commit
92dd2e6ac5
15
NmraDcc.cpp
15
NmraDcc.cpp
@@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Model Railroading with Arduino - NmraDcc.cpp
|
// 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,
|
// This source file is subject of the GNU general public license 2,
|
||||||
// that is available at the world-wide-web at
|
// that is available at the world-wide-web at
|
||||||
@@ -32,6 +32,9 @@
|
|||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "NmraDcc.h"
|
#include "NmraDcc.h"
|
||||||
|
#ifdef __AVR_MEGA__
|
||||||
|
#include <avr/eeprom.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
// DCC Receive Routine
|
// DCC Receive Routine
|
||||||
@@ -288,9 +291,9 @@ void ExternalInterruptHandler(void)
|
|||||||
}
|
}
|
||||||
DccBitVal = ( bitMicros < bitMax );
|
DccBitVal = ( bitMicros < bitMax );
|
||||||
lastMicros = actMicros;
|
lastMicros = actMicros;
|
||||||
//#ifdef debug
|
#ifdef debug
|
||||||
if(DccBitVal) {SET_TP2;} else {CLR_TP2;};
|
if(DccBitVal) {SET_TP2;} else {CLR_TP2;};
|
||||||
//#endif
|
#endif
|
||||||
DCC_IrqRunning = true;
|
DCC_IrqRunning = true;
|
||||||
interrupts(); // time critical is only the micros() command,so allow nested irq's
|
interrupts(); // time critical is only the micros() command,so allow nested irq's
|
||||||
#ifdef DCC_DEBUG
|
#ifdef DCC_DEBUG
|
||||||
@@ -500,7 +503,11 @@ void writeEEPROM( unsigned int CV, uint8_t Value ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool readyEEPROM() {
|
bool readyEEPROM() {
|
||||||
return true;
|
#ifdef __AVR_MEGA__
|
||||||
|
return eeprom_is_ready();
|
||||||
|
#else
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user