mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-24 16:46:13 +01:00
I2C left to test, all so far works well
This commit is contained in:
parent
88f1c0c580
commit
f2c9b5a496
|
@ -34,6 +34,7 @@
|
|||
#include "DIAG.h"
|
||||
#include "Portenta_H7_TimerInterrupt.h"
|
||||
#include <Arduino_AdvancedAnalog.h>
|
||||
//#include "config.h"
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Experimental code for High Accuracy (HA) DCC Signal mode
|
||||
// Warning - use of TIM2 and TIM3 can affect the use of analogWrite() function on certain pins,
|
||||
|
@ -121,18 +122,13 @@ void DCCTimer::clearPWM() {
|
|||
}
|
||||
|
||||
void DCCTimer::getSimulatedMacAddress(byte mac[6]) {
|
||||
volatile uint32_t *serno1 = (volatile uint32_t *)0x1FFF7A10;
|
||||
volatile uint32_t *serno2 = (volatile uint32_t *)0x1FFF7A14;
|
||||
// volatile uint32_t *serno3 = (volatile uint32_t *)0x1FFF7A18;
|
||||
|
||||
volatile uint32_t m1 = *serno1;
|
||||
volatile uint32_t m2 = *serno2;
|
||||
mac[0] = m1 >> 8;
|
||||
mac[1] = m1 >> 0;
|
||||
mac[2] = m2 >> 24;
|
||||
mac[3] = m2 >> 16;
|
||||
mac[4] = m2 >> 8;
|
||||
mac[5] = m2 >> 0;
|
||||
/*mac[0] = 0xDE;
|
||||
mac[1] = 0xAD;
|
||||
mac[2] = 0xBE;
|
||||
mac[3] = 0xEF;
|
||||
mac[4] = MAC_A;
|
||||
mac[5] = MAC_B;
|
||||
DIAG(F("MAC: %d:%d:%d:%d:%d:%d"),mac[0],mac[1],mac[2],mac[3],mac[4],mac[5]);*/
|
||||
}
|
||||
volatile int DCCTimer::minimum_free_memory=__INT_MAX__;
|
||||
|
||||
|
|
|
@ -55,8 +55,12 @@ void EthernetInterface::setup()
|
|||
*/
|
||||
EthernetInterface::EthernetInterface()
|
||||
{
|
||||
#if defined(ARDUINO_GIGA)
|
||||
byte mac[] = MAC_ADDRESS;
|
||||
#else // no giga
|
||||
byte mac[6];
|
||||
DCCTimer::getSimulatedMacAddress(mac);
|
||||
#endif // giga
|
||||
connected=false;
|
||||
|
||||
#ifdef IP_ADDRESS
|
||||
|
|
Loading…
Reference in New Issue
Block a user