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

fix various comment typos #3

Open
wants to merge 4 commits 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
2 changes: 1 addition & 1 deletion DCCpp_Uno/DCCpp_Uno.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Part of DCC++ BASE STATION for the Arduino
#endif

/////////////////////////////////////////////////////////////////////////////////////
// SELECT COMMUNICATION INTERACE
// SELECT COMMUNICATION INTERFACE
/////////////////////////////////////////////////////////////////////////////////////

#if COMM_INTERFACE == 0
Expand Down
16 changes: 8 additions & 8 deletions DCCpp_Uno/DCCpp_Uno.ino
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,18 @@ registers numbered 1 through MAX_MAIN_REGISTERS (as defined in DCCpp_Uno.h).
It is generally considered good practice to continuously send throttle control packets
to every cab so that if an engine should momentarily lose electrical connectivity with the tracks,
it will very quickly receive another throttle control signal as soon as connectivity is
restored (such as when a trin passes over rough portion of track or the frog of a turnout).
restored (such as when a train passes over a rough portion of track or the frog of a turnout).

DCC++ Base Station therefore sequentially loops through each main operations track packet regsiter
that has been loaded with a throttle control setting for a given cab. For each register, it
transmits the appropriate DCC packet bits to the track, then moves onto the next register
without any pausing to ensure continuous bi-polar power is being provided to the tracks.
Updates to the throttle setting stored in any given packet register are done in a double-buffered
fashion and the sequencer is pointed to that register immediately after being changes so that updated DCC bits
fashion and the sequencer is pointed to that register immediately after being changed so that updated DCC bits
can be transmitted to the appropriate cab without delay or any interruption in the bi-polar power signal.
The cabs identified in each stored throttle setting should be unique across registers. If two registers
contain throttle setting for the same cab, the throttle in the engine will oscillate between the two,
which is probably not a desireable outcome.
which is probably not a desirable outcome.

For both the main operations track and the programming track there is also a special packet register with id=0
that is used to store all other DCC packets that do not require continious transmittal to the tracks.
Expand Down Expand Up @@ -234,7 +234,7 @@ void setup(){
if(!digitalRead(A5))
showConfiguration();

Serial.print("<iDCC++ BASE STATION FOR ARDUINO "); // Print Status to Serial Line regardless of COMM_TYPE setting so use can open Serial Monitor and check configurtion
Serial.print("<iDCC++ BASE STATION FOR ARDUINO "); // Print Status to Serial Line regardless of COMM_TYPE setting so user can open Serial Monitor and check configuration
Serial.print(ARDUINO_TYPE);
Serial.print(" / ");
Serial.print(MOTOR_SHIELD_NAME);
Expand Down Expand Up @@ -284,7 +284,7 @@ void setup(){
pinMode(DIRECTION_MOTOR_CHANNEL_PIN_A,INPUT); // ensure this pin is not active! Direction will be controlled by DCC SIGNAL instead (below)
digitalWrite(DIRECTION_MOTOR_CHANNEL_PIN_A,LOW);

pinMode(DCC_SIGNAL_PIN_MAIN, OUTPUT); // THIS ARDUINO OUPUT PIN MUST BE PHYSICALLY CONNECTED TO THE PIN FOR DIRECTION-A OF MOTOR CHANNEL-A
pinMode(DCC_SIGNAL_PIN_MAIN, OUTPUT); // THIS ARDUINO OUTPUT PIN MUST BE PHYSICALLY CONNECTED TO THE PIN FOR DIRECTION-A OF MOTOR CHANNEL-A

bitSet(TCCR1A,WGM10); // set Timer 1 to FAST PWM, with TOP=OCR1A
bitSet(TCCR1A,WGM11);
Expand Down Expand Up @@ -401,11 +401,11 @@ void setup(){
// DCC ZERO and DCC ONE bits.

// These are hardware-driven interrupts that will be called automatically when triggered regardless of what
// DCC++ BASE STATION was otherwise processing. But once inside the interrupt, all other interrupt routines are temporarily diabled.
// DCC++ BASE STATION was otherwise processing. But once inside the interrupt, all other interrupt routines are temporarily disabled.
// Since a short pulse only lasts for 116 microseconds, and there are TWO separate interrupts
// (one for Main Track Registers and one for the Program Track Registers), the interrupt code must complete
// in much less than 58 microsends, otherwise there would be no time for the rest of the program to run. Worse, if the logic
// of the interrupt code ever caused it to run longer than 58 microsends, an interrupt trigger would be missed, the OCNA and OCNB
// in much less than 58 microseconds, otherwise there would be no time for the rest of the program to run. Worse, if the logic
// of the interrupt code ever caused it to run longer than 58 microseconds, an interrupt trigger would be missed, the OCNA and OCNB
// registers would not be updated, and the net effect would be a DCC signal that keeps sending the same DCC bit repeatedly until the
// interrupt code completes and can be called again.

Expand Down
6 changes: 3 additions & 3 deletions DCCpp_Uno/Outputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Part of DCC++ BASE STATION for the Arduino
/**********************************************************************

DCC++ BASE STATION supports optional OUTPUT control of any unused Arduino Pins for custom purposes.
Pins can be activited or de-activated. The default is to set ACTIVE pins HIGH and INACTIVE pins LOW.
Pins can be activated or de-activated. The default is to set ACTIVE pins HIGH and INACTIVE pins LOW.
However, this default behavior can be inverted for any pin in which case ACTIVE=LOW and INACTIVE=HIGH.

Definitions and state (ACTIVE/INACTIVE) for pins are retained in EEPROM and restored on power-up.
Expand Down Expand Up @@ -47,8 +47,8 @@ where
1 = state of pin set on power-up, or when first created, to either ACTIVE of INACTIVE
depending on IFLAG, bit 2

IFLAG, bit 2: 0 = state of pin set to INACTIVE uponm power-up or when first created
1 = state of pin set to ACTIVE uponm power-up or when first created
IFLAG, bit 2: 0 = state of pin set to INACTIVE upon power-up or when first created
1 = state of pin set to ACTIVE upon power-up or when first created

Once all outputs have been properly defined, use the <E> command to store their definitions to EEPROM.
If you later make edits/additions/deletions to the output definitions, you must invoke the <E> command if you want those
Expand Down
4 changes: 2 additions & 2 deletions DCCpp_Uno/Sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Part of DCC++ BASE STATION for the Arduino
**********************************************************************/
/**********************************************************************

DCC++ BASE STATION supports Sensor inputs that can be connected to any Aruidno Pin
DCC++ BASE STATION supports Sensor inputs that can be connected to any Arduino Pin
not in use by this program. Sensors can be of any type (infrared, magentic, mechanical...).
The only requirement is that when "activated" the Sensor must force the specified Arduino
Pin LOW (i.e. to ground), and when not activated, this Pin should remain HIGH (e.g. 5V),
Expand All @@ -25,7 +25,7 @@ To have this sketch monitor one or more Arduino pins for sensor triggers, first
sensor definitions using the following variation of the "S" command:

<S ID PIN PULLUP>: creates a new sensor ID, with specified PIN and PULLUP
if sensor ID already exists, it is updated with specificed PIN and PULLUP
if sensor ID already exists, it is updated with specified PIN and PULLUP
returns: <O> if successful and <X> if unsuccessful (e.g. out of memory)

<S ID>: deletes definition of sensor ID
Expand Down
10 changes: 5 additions & 5 deletions DCCpp_Uno/SerialCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void SerialCommand::process(){
sprintf(commandString,"");
else if(c=='>') // end of new command
parse(commandString);
else if(strlen(commandString)<MAX_COMMAND_LENGTH) // if comandString still has space, append character just read from serial line
else if(strlen(commandString)<MAX_COMMAND_LENGTH) // if commandString still has space, append character just read from serial line
sprintf(commandString,"%s%c",commandString,c); // otherwise, character is ignored (but continue to look for '<' or '>')
} // while

Expand All @@ -68,7 +68,7 @@ void SerialCommand::process(){
sprintf(commandString,"");
else if(c=='>') // end of new command
parse(commandString);
else if(strlen(commandString)<MAX_COMMAND_LENGTH) // if comandString still has space, append character just read from network
else if(strlen(commandString)<MAX_COMMAND_LENGTH) // if commandString still has space, append character just read from network
sprintf(commandString,"%s%c",commandString,c); // otherwise, character is ignored (but continue to look for '<' or '>')
} // while
}
Expand Down Expand Up @@ -401,7 +401,7 @@ void SerialCommand::parse(char *com){
/*
* stores settings for turnouts and sensors EEPROM
*
* returns: <e nTurnouts nSensors>
* returns: <e nTurnouts nSensors nOutputs>
*/

EEStore::store();
Expand Down Expand Up @@ -477,7 +477,7 @@ void SerialCommand::parse(char *com){

break;

/***** WRITE A DCC PACKET TO ONE OF THE REGSITERS DRIVING THE MAIN OPERATIONS TRACK ****/
/***** WRITE A DCC PACKET TO ONE OF THE REGISTERS DRIVING THE MAIN OPERATIONS TRACK ****/

case 'M': // <M REGISTER BYTE1 BYTE2 [BYTE3] [BYTE4] [BYTE5]>
/*
Expand All @@ -496,7 +496,7 @@ void SerialCommand::parse(char *com){
mRegs->writeTextPacket(com+1);
break;

/***** WRITE A DCC PACKET TO ONE OF THE REGSITERS DRIVING THE MAIN OPERATIONS TRACK ****/
/***** WRITE A DCC PACKET TO ONE OF THE REGISTERS DRIVING THE PROGRAMMING TRACK ****/

case 'P': // <P REGISTER BYTE1 BYTE2 [BYTE3] [BYTE4] [BYTE5]>
/*
Expand Down