mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-23 08:06:13 +01:00
Some additional fixes for typos.
This commit is contained in:
parent
c70ef3ffaa
commit
dd97c4ba49
|
@ -81,6 +81,8 @@ INTERRUPT_CALLBACK interruptHandler=0;
|
||||||
|
|
||||||
void DCCTimer::getSimulatedMacAddress(byte mac[6]) {
|
void DCCTimer::getSimulatedMacAddress(byte mac[6]) {
|
||||||
memcpy(mac,(void *) &SIGROW.SERNUM0,6); // serial number
|
memcpy(mac,(void *) &SIGROW.SERNUM0,6); // serial number
|
||||||
|
mac[0] &= 0xFE;
|
||||||
|
mac[0] |= 0x02;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(TEENSYDUINO)
|
#elif defined(TEENSYDUINO)
|
||||||
|
@ -115,13 +117,13 @@ INTERRUPT_CALLBACK interruptHandler=0;
|
||||||
#else
|
#else
|
||||||
read_mac(mac);
|
read_mac(mac);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(__IMXRT1062__)
|
#if !defined(__IMXRT1062__)
|
||||||
void DCCTimer::read_mac(byte mac[6]) {
|
void DCCTimer::read_mac(byte mac[6]) {
|
||||||
read(0xe,mac,0);
|
read(0xe,mac,0);
|
||||||
read(0xf,mac,3);
|
read(0xf,mac,3);
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://forum.pjrc.com/threads/91-teensy-3-MAC-address
|
// http://forum.pjrc.com/threads/91-teensy-3-MAC-address
|
||||||
void DCCTimer::read(uint8_t word, uint8_t *mac, uint8_t offset) {
|
void DCCTimer::read(uint8_t word, uint8_t *mac, uint8_t offset) {
|
||||||
|
|
|
@ -36,7 +36,8 @@
|
||||||
#include <NativeEthernetUdp.h>
|
#include <NativeEthernetUdp.h>
|
||||||
#else
|
#else
|
||||||
#include "Ethernet.h"
|
#include "Ethernet.h"
|
||||||
#endif#include "RingStream.h"
|
#endif
|
||||||
|
#include "RingStream.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Network Configuration
|
* @brief Network Configuration
|
||||||
|
|
|
@ -126,7 +126,9 @@ void MotorDriver::setSignal( bool high) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ARDUINO_TEENSY32) || defined(ARDUINO_TEENSY35)|| defined(ARDUINO_TEENSY36)
|
||||||
volatile unsigned int overflow_count=0;
|
volatile unsigned int overflow_count=0;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool MotorDriver::canMeasureCurrent() {
|
bool MotorDriver::canMeasureCurrent() {
|
||||||
return currentPin!=UNUSED_PIN;
|
return currentPin!=UNUSED_PIN;
|
||||||
|
@ -143,11 +145,6 @@ int MotorDriver::getCurrentRaw() {
|
||||||
if (currentPin==UNUSED_PIN) return 0;
|
if (currentPin==UNUSED_PIN) return 0;
|
||||||
int current;
|
int current;
|
||||||
#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41)
|
#if defined(ARDUINO_TEENSY40) || defined(ARDUINO_TEENSY41)
|
||||||
//if(isMain) {
|
|
||||||
// current = (uint16_t)adc->adc0->analogReadContinuous();
|
|
||||||
//} else {
|
|
||||||
// current = (uint16_t)adc->adc1->analogReadContinuous();
|
|
||||||
//}
|
|
||||||
bool irq = disableInterrupts();
|
bool irq = disableInterrupts();
|
||||||
current = analogRead(currentPin)-senseOffset;
|
current = analogRead(currentPin)-senseOffset;
|
||||||
enableInterrupts(irq);
|
enableInterrupts(irq);
|
||||||
|
@ -162,7 +159,6 @@ int MotorDriver::getCurrentRaw() {
|
||||||
current = analogRead(currentPin)-senseOffset;
|
current = analogRead(currentPin)-senseOffset;
|
||||||
#endif
|
#endif
|
||||||
if (current<0) current=0-current;
|
if (current<0) current=0-current;
|
||||||
|
|
||||||
if ((faultPin != UNUSED_PIN) && isLOW(fastFaultPin) && isHIGH(fastPowerPin))
|
if ((faultPin != UNUSED_PIN) && isLOW(fastFaultPin) && isHIGH(fastPowerPin))
|
||||||
return (current == 0 ? -1 : -current);
|
return (current == 0 ? -1 : -current);
|
||||||
return current;
|
return current;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
// WIFI_ON: All prereqs for running with WIFI are met
|
// WIFI_ON: All prereqs for running with WIFI are met
|
||||||
// Note: WIFI_CHANNEL may not exist in early config.h files so is added here if needed.
|
// Note: WIFI_CHANNEL may not exist in early config.h files so is added here if needed.
|
||||||
|
|
||||||
#if ENABLE_WIFI && (defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_SAMD_ZERO)) || defined(Teensyduino)
|
#if ENABLE_WIFI && (defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_SAMD_ZERO) || defined(TEENSYDUINO))
|
||||||
#define WIFI_ON true
|
#define WIFI_ON true
|
||||||
#ifndef WIFI_CHANNEL
|
#ifndef WIFI_CHANNEL
|
||||||
#define WIFI_CHANNEL 1
|
#define WIFI_CHANNEL 1
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
#define WIFI_ON false
|
#define WIFI_ON false
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLE_ETHERNET && (defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_SAMD_ZERO)) || defined(Teensyduino)
|
#if ENABLE_ETHERNET && (defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_SAMD_ZERO) || defined(TEENSYDUINO))
|
||||||
#define ETHERNET_ON true
|
#define ETHERNET_ON true
|
||||||
#else
|
#else
|
||||||
#define ETHERNET_ON false
|
#define ETHERNET_ON false
|
||||||
|
|
Loading…
Reference in New Issue
Block a user