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 "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.
|
||||
|
||||
@ -37,6 +37,6 @@ void setup() {
|
||||
void loop() {
|
||||
DCC::loop(); // required to keep locos running and check powwer
|
||||
|
||||
// This line passes input on Serial to the JMRIparser
|
||||
StringParser::loop(Serial, JMRIParser::parse);
|
||||
// This line passes input on Serial to the DCCEXParser
|
||||
StringParser::loop(Serial, DCCEXParser::parse);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "StringParser.h"
|
||||
#include "JMRIParser.h"
|
||||
#include "DCCEXParser.h"
|
||||
#include "DCC.h"
|
||||
#include "DCCWaveform.h"
|
||||
#include "Turnouts.h"
|
||||
@ -19,7 +19,8 @@ const char VERSION[]="99.666";
|
||||
|
||||
|
||||
// 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];
|
||||
bool result;
|
||||
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
|
||||
*
|
||||
@ -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){
|
||||
case 0: // <T>
|
||||
Turnout::showAll(stream); // verbose show
|
||||
@ -365,7 +366,7 @@ bool JMRIParser::parseT(Stream & stream, int params, int p[]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool JMRIParser::parseS(Stream & stream, int params, int p[]) {
|
||||
bool DCCEXParser::parseS(Stream & stream, int params, int p[]) {
|
||||
|
||||
switch(params){
|
||||
|
@ -1,6 +1,6 @@
|
||||
#ifndef JMRIParser_h
|
||||
#define JMRIParser_h
|
||||
struct JMRIParser
|
||||
#ifndef DCCEXParser_h
|
||||
#define DCCEXParser_h
|
||||
struct DCCEXParser
|
||||
{
|
||||
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;
|
||||
float factor = isMainTrack ? MAIN_SENSE_FACTOR : PROG_SENSE_FACTOR;
|
||||
int rawCurrent = analogRead(pin);
|
||||
// DIAG(F("\nCurrent on %d pin %d = %d"),isMainTrack,pin,rawCurrent);
|
||||
return (int)(rawCurrent * factor);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user