mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-02-21 08:16:04 +01:00
better mac address
This commit is contained in:
parent
f2c9b5a496
commit
b98ddf7886
@ -122,13 +122,20 @@ void DCCTimer::clearPWM() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DCCTimer::getSimulatedMacAddress(byte mac[6]) {
|
void DCCTimer::getSimulatedMacAddress(byte mac[6]) {
|
||||||
/*mac[0] = 0xDE;
|
volatile uint32_t *serno1 = (volatile uint32_t *)UID_BASE;
|
||||||
mac[1] = 0xAD;
|
volatile uint32_t *serno2 = (volatile uint32_t *)UID_BASE+4;
|
||||||
mac[2] = 0xBE;
|
|
||||||
mac[3] = 0xEF;
|
volatile uint32_t m1 = *serno1;
|
||||||
mac[4] = MAC_A;
|
volatile uint32_t m2 = *serno2;
|
||||||
mac[5] = MAC_B;
|
mac[0] = m1 >> 8;
|
||||||
DIAG(F("MAC: %d:%d:%d:%d:%d:%d"),mac[0],mac[1],mac[2],mac[3],mac[4],mac[5]);*/
|
mac[1] = m1 >> 0;
|
||||||
|
mac[2] = m2 >> 24;
|
||||||
|
mac[3] = m2 >> 16;
|
||||||
|
mac[4] = m2 >> 8;
|
||||||
|
mac[5] = m2 >> 0;
|
||||||
|
DIAG(F("MAC: %P:%P:%P:%P:%P:%P"),mac[0],mac[1],mac[2],mac[3],mac[4],mac[5]);
|
||||||
|
DIAG(F("Ser1: %P Ser2: %P"),m1,m2);
|
||||||
|
|
||||||
}
|
}
|
||||||
volatile int DCCTimer::minimum_free_memory=__INT_MAX__;
|
volatile int DCCTimer::minimum_free_memory=__INT_MAX__;
|
||||||
|
|
||||||
|
@ -55,12 +55,8 @@ void EthernetInterface::setup()
|
|||||||
*/
|
*/
|
||||||
EthernetInterface::EthernetInterface()
|
EthernetInterface::EthernetInterface()
|
||||||
{
|
{
|
||||||
#if defined(ARDUINO_GIGA)
|
|
||||||
byte mac[] = MAC_ADDRESS;
|
|
||||||
#else // no giga
|
|
||||||
byte mac[6];
|
byte mac[6];
|
||||||
DCCTimer::getSimulatedMacAddress(mac);
|
DCCTimer::getSimulatedMacAddress(mac);
|
||||||
#endif // giga
|
|
||||||
connected=false;
|
connected=false;
|
||||||
|
|
||||||
#ifdef IP_ADDRESS
|
#ifdef IP_ADDRESS
|
||||||
|
Loading…
Reference in New Issue
Block a user