mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-01-23 02:58:52 +01:00
Rename parser
This commit is contained in:
parent
e933172ef3
commit
5144eb6764
@ -1,6 +1,6 @@
|
|||||||
#include "DCC.h"
|
#include "DCC.h"
|
||||||
#include "DIAG.h"
|
#include "DIAG.h"
|
||||||
#include "JMRIParser.h"
|
#include "DCCEXParser.h"
|
||||||
|
|
||||||
/* this code is here to test the waveforwe generator and reveal the issues involved in programming track operations.
|
/* this code is here to test the waveforwe generator and reveal the issues involved in programming track operations.
|
||||||
|
|
||||||
@ -37,6 +37,6 @@ void setup() {
|
|||||||
void loop() {
|
void loop() {
|
||||||
DCC::loop(); // required to keep locos running and check powwer
|
DCC::loop(); // required to keep locos running and check powwer
|
||||||
|
|
||||||
// This line passes input on Serial to the JMRIparser
|
// This line passes input on Serial to the DCCEXParser
|
||||||
StringParser::loop(Serial, JMRIParser::parse);
|
StringParser::loop(Serial, DCCEXParser::parse);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "StringParser.h"
|
#include "StringParser.h"
|
||||||
#include "JMRIParser.h"
|
#include "DCCEXParser.h"
|
||||||
#include "DCC.h"
|
#include "DCC.h"
|
||||||
#include "DCCWaveform.h"
|
#include "DCCWaveform.h"
|
||||||
#include "Turnouts.h"
|
#include "Turnouts.h"
|
||||||
@ -19,7 +19,8 @@ const char VERSION[]="99.666";
|
|||||||
|
|
||||||
|
|
||||||
// See documentation on DCC class for info on this section
|
// See documentation on DCC class for info on this section
|
||||||
void JMRIParser::parse(Stream & stream,const char *com) {
|
void DCCEXParser::parse(Stream & stream,const char *com) {
|
||||||
|
(void) EEPROM; // tell compiler not to warn thi is unused
|
||||||
int p[MAX_PARAMS];
|
int p[MAX_PARAMS];
|
||||||
bool result;
|
bool result;
|
||||||
int params=StringParser::parse(com+1,p,MAX_PARAMS);
|
int params=StringParser::parse(com+1,p,MAX_PARAMS);
|
||||||
@ -296,7 +297,7 @@ void JMRIParser::parse(Stream & stream,const char *com) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool JMRIParser::parseZ(Stream & stream, int params, int p[]){
|
bool DCCEXParser::parseZ(Stream & stream, int params, int p[]){
|
||||||
/*
|
/*
|
||||||
* <Z ID ACTIVATE>: sets output ID to either the "active" or "inactive" state
|
* <Z ID ACTIVATE>: sets output ID to either the "active" or "inactive" state
|
||||||
*
|
*
|
||||||
@ -340,7 +341,7 @@ bool JMRIParser::parseZ(Stream & stream, int params, int p[]){
|
|||||||
|
|
||||||
|
|
||||||
//===================================
|
//===================================
|
||||||
bool JMRIParser::parseT(Stream & stream, int params, int p[]) {
|
bool DCCEXParser::parseT(Stream & stream, int params, int p[]) {
|
||||||
switch(params){
|
switch(params){
|
||||||
case 0: // <T>
|
case 0: // <T>
|
||||||
Turnout::showAll(stream); // verbose show
|
Turnout::showAll(stream); // verbose show
|
||||||
@ -365,7 +366,7 @@ bool JMRIParser::parseT(Stream & stream, int params, int p[]) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JMRIParser::parseS(Stream & stream, int params, int p[]) {
|
bool DCCEXParser::parseS(Stream & stream, int params, int p[]) {
|
||||||
|
|
||||||
switch(params){
|
switch(params){
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
#ifndef JMRIParser_h
|
#ifndef DCCEXParser_h
|
||||||
#define JMRIParser_h
|
#define DCCEXParser_h
|
||||||
struct JMRIParser
|
struct DCCEXParser
|
||||||
{
|
{
|
||||||
static void parse(Stream & stream,const char * command);
|
static void parse(Stream & stream,const char * command);
|
||||||
|
|
@ -43,7 +43,6 @@ int Hardware::getCurrentMilliamps(bool isMainTrack) {
|
|||||||
int pin = isMainTrack ? MAIN_SENSE_PIN : PROG_SENSE_PIN;
|
int pin = isMainTrack ? MAIN_SENSE_PIN : PROG_SENSE_PIN;
|
||||||
float factor = isMainTrack ? MAIN_SENSE_FACTOR : PROG_SENSE_FACTOR;
|
float factor = isMainTrack ? MAIN_SENSE_FACTOR : PROG_SENSE_FACTOR;
|
||||||
int rawCurrent = analogRead(pin);
|
int rawCurrent = analogRead(pin);
|
||||||
// DIAG(F("\nCurrent on %d pin %d = %d"),isMainTrack,pin,rawCurrent);
|
|
||||||
return (int)(rawCurrent * factor);
|
return (int)(rawCurrent * factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user