Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various spelling fixes to comments #408

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ For more information just check our code or read https://google.github.io/styleg

1. Clone the repository on your local machine
2. Create a working branch using the format "username-featurename" ex: "git branch -b frightrisk-turnouts"
3. Commit offen, ex: "git add ." and then "git commit -m "description of your changes"
3. Commit often, ex: "git add ." and then "git commit -m "description of your changes"
4. Push your changes to our repository "git push"
5. When you are ready, issue a pull request for your changes to be merged into the main branch

Expand All @@ -51,7 +51,7 @@ Contributors who do not follow the be nice rule in good faith may face temporary

## How Can I Contribute?

The DCC-EX Team has several projects and sub teams where you can help donate your epertise. See the sections below for the project or projects you are interested in.
The DCC-EX Team has several projects and sub teams where you can help donate your expertise. See the sections below for the project or projects you are interested in.

### Development
### Documentation
Expand Down
4 changes: 2 additions & 2 deletions CommandDistributor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void CommandDistributor::parse(byte clientId,byte * buffer, RingStream * stream
ring=stream;

// First check if the client is not known
// yet and in that case determinine type
// yet and in that case determine type
// NOTE: First character of transmission determines if this
// client is using the DCC++ protocol where all commands start
// with '<'
Expand Down Expand Up @@ -98,7 +98,7 @@ void CommandDistributor::parse(byte clientId,byte * buffer, RingStream * stream
DIAG(F("OUTBOUND FULL processing cmd:%s"),buffer);
}
} else {
DIAG(F("CD parse: was alredy committed")); //XXX Could have been committed by broadcastClient?!
DIAG(F("CD parse: was already committed")); //XXX Could have been committed by broadcastClient?!
}
}

Expand Down
4 changes: 2 additions & 2 deletions CommandStation-EX.ino
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void setup()

DIAG(F("License GPLv3 fsf.org (c) dcc-ex.com"));

// Initialise HAL layer before reading EEprom or setting up MotorDrivers
// Initialise HAL layer before reading EEprom or setting up MotorDrivers
IODevice::begin();

// As the setup of a motor shield may require a read of the current sense input from the ADC,
Expand Down Expand Up @@ -110,7 +110,7 @@ void setup()
// Responsibility 3: Start the DCC engine.
DCC::begin();

// Start RMFT aka EX-RAIL (ignored if no automnation)
// Start RMFT aka EX-RAIL (ignored if no automation)
RMFT::begin();


Expand Down
18 changes: 9 additions & 9 deletions DCC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// It has no visibility of the hardware, timers, interrupts
// nor of the waveform issues such as preambles, start bits checksums or cutouts.
//
// Nor should it have to deal with JMRI responsess other than the OK/FAIL
// Nor should it have to deal with JMRI responses other than the OK/FAIL
// or cv value returned. I will move that back to the JMRI interface later
//
// The interface to the waveform generator is narrowed down to merely:
Expand Down Expand Up @@ -250,7 +250,7 @@ void DCC::setAccessory(int address, byte port, bool gate, byte onoff /*= 2*/) {
// >1 => send both on and off packets.

// An accessory has an address, 4 ports and 2 gates (coils) each. That's how
// the initial decoders were orgnized and that influenced how the DCC
// the initial decoders were organized and that influenced how the DCC
// standard was made.
#ifdef DIAG_IO
DIAG(F("DCC::setAccessory(%d,%d,%d)"), address, port, gate);
Expand All @@ -262,7 +262,7 @@ void DCC::setAccessory(int address, byte port, bool gate, byte onoff /*= 2*/) {
return;
byte b[2];

// first byte is of the form 10AAAAAA, where AAAAAA represent 6 least signifcant bits of accessory address
// first byte is of the form 10AAAAAA, where AAAAAA represent 6 least significant bits of accessory address
// second byte is of the form 1AAACPPG, where C is 1 for on, PP the ports 0 to 3 and G the gate (coil).
b[0] = address % 64 + 128;
b[1] = ((((address / 64) % 8) << 4) + (port % 4 << 1) + gate % 2) ^ 0xF8;
Expand Down Expand Up @@ -365,7 +365,7 @@ const ackOp FLASH READ_BIT_PROG[] = {
const ackOp FLASH WRITE_BYTE_PROG[] = {
BASELINE,
WB,WACK,ITC1, // Write and callback(1) if ACK
// handle decoders that dont ack a write
// handle decoders that don't ack a write
VB,WACK,ITC1, // validate byte and callback(1) if correct
CALLFAIL // callback (-1)
};
Expand Down Expand Up @@ -467,7 +467,7 @@ const ackOp FLASH LOCO_ID_PROG[] = {
V0, WACK, MERGE,
V0, WACK, MERGE,
VB, WACK, NAKFAIL, // verify merged byte and return -1 it if not acked ok
COMBINELOCOID, // Combile byte with stash to make long locoid and callback
COMBINELOCOID, // Combine byte with stash to make long locoid and callback

// ITSKIP Skips to here if CV 29 bit 5 was zero. so read CV 1 and return that
SKIPTARGET,
Expand All @@ -489,7 +489,7 @@ const ackOp FLASH SHORT_LOCO_ID_PROG[] = {
BASELINE,
SETCV,(ackOp)19,
SETBYTE, (ackOp)0,
WB,WACK, // ignore dedcoder without cv19 support
WB,WACK, // ignore decoder without cv19 support
// Turn off long address flag
SETCV,(ackOp)29,
SETBIT,(ackOp)5,
Expand Down Expand Up @@ -632,12 +632,12 @@ bool DCC::issueReminder(int reg) {
case 4: // remind function group 4 F13-F20
if (flags & FN_GROUP_4)
setFunctionInternal(loco,222, ((functions>>13)& 0xFF));
flags&= ~FN_GROUP_4; // dont send them again
flags&= ~FN_GROUP_4; // don't send them again
break;
case 5: // remind function group 5 F21-F28
if (flags & FN_GROUP_5)
setFunctionInternal(loco,223, ((functions>>21)& 0xFF));
flags&= ~FN_GROUP_5; // dont send them again
flags&= ~FN_GROUP_5; // don't send them again
break;
}
loopStatus++;
Expand Down Expand Up @@ -691,7 +691,7 @@ int DCC::lookupSpeedTable(int locoId, bool autoCreate) {
void DCC::updateLocoReminder(int loco, byte speedCode) {

if (loco==0) {
// broadcast stop/estop but dont change direction
// broadcast stop/estop but don't change direction
for (int reg = 0; reg <= highestUsedReg; reg++) {
if (speedTable[reg].loco==0) continue;
byte newspeed=(speedTable[reg].speedCode & 0x80) | (speedCode & 0x7f);
Expand Down
12 changes: 6 additions & 6 deletions DCCACK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ void DCCACK::Setup(int cv, byte byteValueOrBitnum, ackOp const program[], ACK_C
progDriver=TrackManager::getProgDriver();
if (progDriver==NULL) {
TrackManager::setJoin(ackManagerRejoin);
callback(-3); // we dont have a prog track!
callback(-3); // we don't have a prog track!
return;
}
if (!progDriver->canMeasureCurrent()) {
TrackManager::setJoin(ackManagerRejoin);
callback(-2); // our prog track cant measure current
callback(-2); // our prog track can't measure current
return;
}

Expand Down Expand Up @@ -117,7 +117,7 @@ void DCCACK::Setup(int wordval, ackOp const program[], ACK_CALLBACK callback) {

const byte RESET_MIN=8; // tuning of reset counter before sending message

// checkRessets return true if the caller should yield back to loop and try later.
// checkResets return true if the caller should yield back to loop and try later.
bool DCCACK::checkResets(uint8_t numResets) {
return DCCWaveform::progTrack.getResets() < numResets;
}
Expand Down Expand Up @@ -223,7 +223,7 @@ void DCCACK::loop() {
break; // we have a genuine ACK result
}
case ITC0:
case ITC1: // If True Callback(0 or 1) (if prevous WACK got an ACK)
case ITC1: // If True Callback(0 or 1) (if previous WACK got an ACK)
if (ackReceived) {
callback(opcode==ITC0?0:1);
return;
Expand Down Expand Up @@ -375,8 +375,8 @@ void DCCACK::callback(int value) {
if (millis()-callbackStart < 100) break;
// stable after power maintained for 100mS

// If we are going to power off anyway, it doesnt matter
// but if we will keep the power on, we must off it for 30mS
// If we are going to power off anyway, it doesn't matter
// but if we will keep the power on, we must turn it off for 30mS
if (autoPowerOff) callbackState=READY;
else { // Need to cycle power off and on
progDriver->setPower(POWERMODE::OFF);
Expand Down
10 changes: 5 additions & 5 deletions DCCEXParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ RingStream *DCCEXParser::stashRingStream = NULL;
byte DCCEXParser::stashTarget=0;

// This is a JMRI command parser.
// It doesnt know how the string got here, nor how it gets back.
// It doesn't know how the string got here, nor how it gets back.
// It knows nothing about hardware or tracks... it just parses strings and
// calls the corresponding DCC api.
// Non-DCC things like turnouts, pins and sensors are handled in additional JMRI interface classes.
Expand Down Expand Up @@ -625,12 +625,12 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
return;

#ifndef DISABLE_EEPROM
case 'E': // STORE EPROM <E>
case 'E': // STORE EEPROM <E>
EEStore::store();
StringFormatter::send(stream, F("<e %d %d %d>\n"), EEStore::eeStore->data.nTurnouts, EEStore::eeStore->data.nSensors, EEStore::eeStore->data.nOutputs);
return;

case 'e': // CLEAR EPROM <e>
case 'e': // CLEAR EEPROM <e>
EEStore::clear();
StringFormatter::send(stream, F("<O>\n"));
return;
Expand Down Expand Up @@ -980,7 +980,7 @@ bool DCCEXParser::parseD(Print *stream, int16_t params, int16_t p[])
{
if (params == 0)
return false;
bool onOff = (params > 0) && (p[1] == 1 || p[1] == HASH_KEYWORD_ON); // dont care if other stuff or missing... just means off
bool onOff = (params > 0) && (p[1] == 1 || p[1] == HASH_KEYWORD_ON); // don't care if other stuff or missing... just means off
switch (p[0])
{
case HASH_KEYWORD_CABS: // <D CABS>
Expand Down Expand Up @@ -1042,7 +1042,7 @@ bool DCCEXParser::parseD(Print *stream, int16_t params, int16_t p[])
#endif
case HASH_KEYWORD_RESET:
DCCTimer::reset();
break; // and <X> if we didnt restart
break; // and <X> if we didn't restart


#ifndef DISABLE_EEPROM
Expand Down
13 changes: 8 additions & 5 deletions DCCRMT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,13 @@ RMTChannel::RMTChannel(pinpair pins, bool isMain) {
config.channel = channel = (rmt_channel_t)ch;
config.clk_div = RMT_CLOCK_DIVIDER;
config.gpio_num = (gpio_num_t)pins.pin;
config.mem_block_num = 2; // With longest DCC packet 11 inc checksum (future expansion)
// number of bits needed is 22preamble + start +
// 11*9 + extrazero + EOT = 124
// 2 mem block of 64 RMT items should be enough

// With longest DCC packet (11 bytes, including checksum (future expansion)):
// number of bits needed is PREAMBLE_BITS_PROG (22) + start (1) +
// data bytes (11*9) + extrazero (1) + EOT (1) = 124
//
// 2 mem blocks of 64 RMT items should be enough
config.mem_block_num = 2;

ESP_ERROR_CHECK(rmt_config(&config));
addPin(pins.invpin, true);
Expand Down Expand Up @@ -166,7 +169,7 @@ const byte transmitMask[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};

int RMTChannel::RMTfillData(const byte buffer[], byte byteCount, byte repeatCount=0) {
//int RMTChannel::RMTfillData(dccPacket packet) {
// dataReady: Signals to then interrupt routine. It is set when
// dataReady: Signals to the interrupt routine. It is set when
// we have data in the channel buffer which can be copied out
// to the HW. dataRepeat on the other hand signals back to
// the caller of this function if the data has been sent enough
Expand Down
4 changes: 2 additions & 2 deletions DCCTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* Other shields may be jumpered to PWM pins or run directly using the software interrupt.
*
* Because the PWM-based waveform is effectively set half a cycle after the software version,
* it is not acceptable to drive the two tracks on different methiods or it would cause
* it is not acceptable to drive the two tracks on different methods or it would cause
* problems for <1 JOIN> etc.
*
*/
Expand Down Expand Up @@ -98,7 +98,7 @@ class DCCTimer {

// Class ADCee implements caching of the ADC value for platforms which
// have a too slow ADC read to wait for. On these platforms the ADC is
// scanned continiously in the background from an ISR. On such
// scanned continuously in the background from an ISR. On such
// architectures that use the analog read during DCC waveform with
// specially configured ADC, for example AVR, init must be called
// PRIOR to the start of the waveform. It returns the current value so
Expand Down
4 changes: 2 additions & 2 deletions DCCTimerAVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int DCCTimer::freeMemory() {

void DCCTimer::reset() {
wdt_enable( WDTO_15MS); // set Arduino watchdog timer for 15ms
delay(50); // wait for the prescaller time to expire
delay(50); // wait for the prescaler time to expire

}

Expand Down Expand Up @@ -210,7 +210,7 @@ void ADCee::scan() {
// look for a valid track to sample or until we are around
while (true) {
if (mask & usedpins) {
// start new ADC aquire on id
// start new ADC acquire on id
#if defined(ADCSRB) && defined(MUX5)
if (ADCusesHighPort) { // if we ever have started to use high pins)
if (id > 7) // if we use a high ADC pin
Expand Down
4 changes: 2 additions & 2 deletions DCCTimerESP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int DCCTimer::getMinimumFreeMemory() {
int DCCTimer::freeMemory() {
return ESP.getFreeHeap();
}
#endif
#endif // ESP8266

////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -114,7 +114,7 @@ void DCCTimer::begin(INTERRUPT_CALLBACK callback) {
timerAlarmEnable(timer);
}

// We do not support to use PWM to make the Waveform on ESP
// We do not support using PWM to make the Waveform on ESP
bool IRAM_ATTR DCCTimer::isPWMPin(byte pin) {
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions DCCTimerSTM32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ HardwareSerial Serial1(PB7, PA15); // Rx=PB7, Tx=PA15 -- CN7 pins 17 and 21 - F
HardwareSerial Serial6(PA12, PA11); // Rx=PA12, Tx=PA11 -- CN10 pins 12 and 14 - F411RE
#elif defined(ARDUINO_NUCLEO_F446RE)
// Nucleo-64 boards don't have additional serial ports defined by default
// On the F446RE, Serial1 isn't really useable as it's Rx/Tx pair sit on already used D2/D10 pins
// On the F446RE, Serial1 isn't really useable as its Rx/Tx pair sit on already used D2/D10 pins
// HardwareSerial Serial1(PA10, PB6); // Rx=PA10 (D2), Tx=PB6 (D10) -- CN10 pins 17 and 9 - F446RE
// Serial2 is defined to use USART2 by default, but is in fact used as the diag console
// via the debugger on the Nucleo-64. It is therefore unavailable for other DCC-EX uses like WiFi, DFPlayer, etc.
Expand Down Expand Up @@ -369,7 +369,7 @@ void ADCee::scan() {
// look for a valid track to sample or until we are around
while (true) {
if (mask & usedpins) {
// start new ADC aquire on id
// start new ADC acquire on id
ADC1->SQR3 = analogchans[id]; //1st conversion in regular sequence
ADC1->CR2 |= (1 << 30); //Start 1st conversion SWSTART
#ifdef DEBUG_ADC
Expand Down
2 changes: 1 addition & 1 deletion DCCTimerTEENSY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void DCCTimer::setPWM(byte pin, bool high) {
}

void DCCTimer::clearPWM() {
// Do nothing unless we implent HA
// Do nothing unless we implement HA
}

#if defined(__IMXRT1062__) //Teensy 4.0 and Teensy 4.1
Expand Down
10 changes: 5 additions & 5 deletions DCCWaveform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ DCCWaveform DCCWaveform::mainTrack(PREAMBLE_BITS_MAIN, true);
DCCWaveform DCCWaveform::progTrack(PREAMBLE_BITS_PROG, false);


// This bitmask has 9 entries as each byte is trasmitted as a zero + 8 bits.
// This bitmask has 9 entries as each byte is transmitted as a zero + 8 bits.
const byte bitMask[] = {0x00, 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};

const byte idlePacket[] = {0xFF, 0x00, 0xFF};
Expand Down Expand Up @@ -88,7 +88,7 @@ void DCCWaveform::interruptHandler() {
mainTrack.state=stateTransform[mainTrack.state];
progTrack.state=stateTransform[progTrack.state];

// WAVE_PENDING means we dont yet know what the next bit is
// WAVE_PENDING means we don't yet know what the next bit is
if (mainTrack.state==WAVE_PENDING) mainTrack.interrupt2();
if (progTrack.state==WAVE_PENDING) progTrack.interrupt2();
else DCCACK::checkAck(progTrack.getResets());
Expand All @@ -99,7 +99,7 @@ void DCCWaveform::interruptHandler() {
// An instance of this class handles the DCC transmissions for one track. (main or prog)
// Interrupts are marshalled via the statics.
// A track has a current transmit buffer, and a pending buffer.
// When the current buffer is exhausted, either the pending buffer (if there is one waiting) or an idle buffer.
// When the current buffer is exhausted, send either the pending buffer (if there is one waiting) or an idle buffer.



Expand Down Expand Up @@ -144,7 +144,7 @@ void DCCWaveform::interrupt2() {
//end of Byte
bits_sent = 0;
bytes_sent++;
// if this is the last byte, prepere for next packet
// if this is the last byte, prepare for next packet
if (bytes_sent >= transmitLength) {
// end of transmission buffer... repeat or switch to next message
bytes_sent = 0;
Expand Down Expand Up @@ -247,7 +247,7 @@ void DCCWaveform::schedulePacket(const byte buffer[], byte byteCount, byte repea
pendingPacket[byteCount] = checksum;
pendingLength = byteCount + 1;
pendingRepeats = repeats;
// DIAG repeated commands (accesories)
// DIAG repeated commands (accessories)
// if (pendingRepeats > 0)
// DIAG(F("Repeats=%d on %s track"), pendingRepeats, isMainTrack ? "MAIN" : "PROG");
// The resets will be zero not only now but as well repeats packets into the future
Expand Down
8 changes: 4 additions & 4 deletions EXRAIL2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const int16_t HASH_KEYWORD_RED=26099;
const int16_t HASH_KEYWORD_AMBER=18713;
const int16_t HASH_KEYWORD_GREEN=-31493;

// One instance of RMFT clas is used for each "thread" in the automation.
// One instance of RMFT class is used for each "thread" in the automation.
// Each thread manages a loco on a journey through the layout, and/or may manage a scenery automation.
// The threads exist in a ring, each time through loop() the next thread in the ring is serviced.

Expand Down Expand Up @@ -1145,7 +1145,7 @@ void RMFT2::handleEvent(const FSH* reason,LookList* handlers, int16_t id) {
int pc= handlers->find(id);
if (pc<0) return;

// Check we dont already have a task running this handler
// Check we don't already have a task running this handler
RMFT2 * task=loopTask;
while(task) {
if (task->onEventStartPosition==pc) {
Expand Down Expand Up @@ -1231,8 +1231,8 @@ void RMFT2::thrungeString(uint32_t strfar, thrunger mode, byte id) {
stream->write(c);
}
#else
// UNO/NANO CPUs dont have high memory
// 32 bit cpus dont care anyway
// UNO/NANO CPUs don't have high memory
// 32 bit cpus don't care anyway
stream->print((FSH *)strfar);
#endif

Expand Down
Loading