mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-24 05:11:24 +01:00
Working with 15 positions
This commit is contained in:
parent
b0d8510127
commit
6cad794411
@ -692,6 +692,8 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
|
||||
}
|
||||
StringFormatter::send(stream, F(">\n"));
|
||||
return;
|
||||
// No turntables without HAL support
|
||||
#ifndef IO_NO_HAL
|
||||
case HASH_KEYWORD_O: // <JO returns turntable list
|
||||
StringFormatter::send(stream, F("<jO"));
|
||||
if (params==1) { // <JO>
|
||||
@ -721,15 +723,19 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
|
||||
}
|
||||
StringFormatter::send(stream, F(">\n"));
|
||||
return;
|
||||
#endif
|
||||
default: break;
|
||||
} // switch(p[1])
|
||||
break; // case J
|
||||
}
|
||||
|
||||
// No turntables without HAL support
|
||||
#ifndef IO_NO_HAL
|
||||
case 'I': // TURNTABLE <I ...>
|
||||
if (parseI(stream, params, p))
|
||||
return;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default: //anything else will diagnose and drop out to <X>
|
||||
DIAG(F("Opcode=%c params=%d"), opcode, params);
|
||||
@ -1051,12 +1057,13 @@ bool DCCEXParser::parseD(Print *stream, int16_t params, int16_t p[])
|
||||
}
|
||||
|
||||
// ==========================
|
||||
// Turntable
|
||||
// Turntable - no support if no HAL
|
||||
// <I> - list all
|
||||
// <I id steps> - operate (DCC)
|
||||
// <I id steps activity> - operate (EXTT)
|
||||
// <I id EXTT i2caddress vpin position1 position2 ...> - create EXTT
|
||||
// <I id DCC linear1 linear2 ...> - create DCC? - This TBA
|
||||
#ifndef IO_NO_HAL
|
||||
bool DCCEXParser::parseI(Print *stream, int16_t params, int16_t p[])
|
||||
{
|
||||
switch (params)
|
||||
@ -1114,6 +1121,7 @@ bool DCCEXParser::parseI(Print *stream, int16_t params, int16_t p[])
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// CALLBACKS must be static
|
||||
bool DCCEXParser::stashCallback(Print *stream, int16_t p[MAX_COMMAND_PARAMS], RingStream * ringStream)
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <Arduino.h>
|
||||
#include "FSH.h"
|
||||
#include "RingStream.h"
|
||||
#include "defines.h"
|
||||
|
||||
typedef void (*FILTER_CALLBACK)(Print * stream, byte & opcode, byte & paramCount, int16_t p[]);
|
||||
typedef void (*AT_COMMAND_CALLBACK)(HardwareSerial * stream,const byte * command);
|
||||
@ -37,7 +38,7 @@ struct DCCEXParser
|
||||
static void setFilter(FILTER_CALLBACK filter);
|
||||
static void setRMFTFilter(FILTER_CALLBACK filter);
|
||||
static void setAtCommandCallback(AT_COMMAND_CALLBACK filter);
|
||||
static const int MAX_COMMAND_PARAMS=10; // Must not exceed this
|
||||
static const int MAX_COMMAND_PARAMS=MAX_PARSER_PARAMS; // Must not exceed this
|
||||
|
||||
private:
|
||||
|
||||
@ -49,7 +50,9 @@ struct DCCEXParser
|
||||
static bool parseS(Print * stream, int16_t params, int16_t p[]);
|
||||
static bool parsef(Print * stream, int16_t params, int16_t p[]);
|
||||
static bool parseD(Print * stream, int16_t params, int16_t p[]);
|
||||
#ifndef IO_NO_HAL
|
||||
static bool parseI(Print * stream, int16_t params, int16_t p[]);
|
||||
#endif
|
||||
|
||||
static Print * getAsyncReplyStream();
|
||||
static void commitAsyncReplyStream();
|
||||
|
@ -27,12 +27,6 @@
|
||||
// Define symbol DIAG_LOOPTIMES to enable CS loop execution time to be reported
|
||||
//#define DIAG_LOOPTIMES
|
||||
|
||||
// Define symbol IO_NO_HAL to reduce FLASH footprint when HAL features not required
|
||||
// The HAL is disabled by default on Nano and Uno platforms, because of limited flash space.
|
||||
#if defined(ARDUINO_AVR_NANO) || defined(ARDUINO_AVR_UNO)
|
||||
#define IO_NO_HAL
|
||||
#endif
|
||||
|
||||
// Define symbol IO_SWITCH_OFF_SERVO to set the PCA9685 output to 0 when an
|
||||
// animation has completed. This switches off the servo motor, preventing
|
||||
// the continuous buzz sometimes found on servos, and reducing the
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include "EXRAIL2.h"
|
||||
#include "DCC.h"
|
||||
|
||||
// No turntable support without HAL
|
||||
#ifndef IO_NO_HAL
|
||||
|
||||
/*
|
||||
* Protected static data
|
||||
@ -180,3 +182,5 @@ EXTTTurntable::EXTTTurntable(uint16_t id, VPIN vpin, uint8_t i2caddress) :
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -25,6 +25,9 @@
|
||||
#include "IODevice.h"
|
||||
#include "StringFormatter.h"
|
||||
|
||||
// No turntable support without HAL
|
||||
#ifndef IO_NO_HAL
|
||||
|
||||
// Turntable type definitions
|
||||
// EXTT = EX-Turntable
|
||||
// DCC = DCC accessory turntables - to be added later
|
||||
@ -203,3 +206,5 @@ protected:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
20
defines.h
20
defines.h
@ -213,6 +213,26 @@
|
||||
//
|
||||
#define WIFI_SERIAL_LINK_SPEED 115200
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Define symbol IO_NO_HAL to reduce FLASH footprint when HAL features not required
|
||||
// The HAL is disabled by default on Nano and Uno platforms, because of limited flash space.
|
||||
//
|
||||
#if defined(ARDUINO_AVR_NANO) || defined(ARDUINO_AVR_UNO)
|
||||
#define IO_NO_HAL
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// This defines the maximum number of parameters DCCEXParser will accept.
|
||||
// The increase is required to allow for a sufficient number of turntable positions.
|
||||
//
|
||||
#ifdef IO_NO_HAL
|
||||
#define MAX_PARSER_PARAMS 10
|
||||
#else
|
||||
#define MAX_PARSER_PARAMS 20
|
||||
#endif
|
||||
|
||||
#if __has_include ( "myAutomation.h")
|
||||
#if defined(HAS_ENOUGH_MEMORY) || defined(DISABLE_EEPROM) || defined(DISABLE_PROG)
|
||||
#define EXRAIL_ACTIVE
|
||||
|
Loading…
Reference in New Issue
Block a user