1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-30 02:43:45 +02:00

Compare commits

...

12 Commits

Author SHA1 Message Date
Harald Barth
37904b5fa6 make rc1 2021-11-07 17:03:28 +01:00
Harald Barth
fbca15d2a7 Merge branch 'master-ex-rail' 2021-11-07 17:01:16 +01:00
Harald Barth
177c8c0367 Merge branch 'EX-RAIL-sensormod' 2021-11-07 16:17:22 +01:00
Harald Barth
7ea3faf177 Merge branch 'EX-RAIL' 2021-11-07 16:14:38 +01:00
Harald Barth
d3381c6b2d Committing a SHA 2021-11-07 15:05:58 +00:00
Harald Barth
8853b23f88 uopdate version.h 2021-11-07 16:04:49 +01:00
Harald Barth
a16f6c8749 configure pins correct even when HAL not used 2021-11-06 22:12:32 +01:00
Harald Barth
e3d771a24d set default pullup in EXRAIL begin code 2021-11-06 21:57:06 +01:00
Harald Barth
79ce71c2f9 Committing a SHA 2021-10-31 21:18:17 +00:00
Harald Barth
e3cbaf5f24 unknown locos should have speed forward 2021-10-31 22:17:51 +01:00
Harald Barth
250c372f5c Committing a SHA 2021-10-29 20:30:40 +00:00
Harald Barth
a9c31eb1ae YFROBOT: One more motor board with L298P 2021-10-29 22:30:01 +02:00
5 changed files with 31 additions and 10 deletions

View File

@@ -1 +1 @@
#define GITHUB_SHA "50fcbc0"
#define GITHUB_SHA "8853b23"

View File

@@ -160,7 +160,7 @@ void IODevice::write(VPIN vpin, int value) {
return;
}
#ifdef DIAG_IO
//DIAG(F("IODevice::write(): Vpin ID %d not found!"), (int)vpin);
DIAG(F("IODevice::write(): Vpin ID %d not found!"), (int)vpin);
#endif
}
@@ -179,7 +179,7 @@ void IODevice::writeAnalogue(VPIN vpin, int value, uint8_t param1, uint16_t para
return;
}
#ifdef DIAG_IO
//DIAG(F("IODevice::writeAnalogue(): Vpin ID %d not found!"), (int)vpin);
DIAG(F("IODevice::writeAnalogue(): Vpin ID %d not found!"), (int)vpin);
#endif
}
@@ -265,7 +265,7 @@ int IODevice::read(VPIN vpin) {
return dev->_read(vpin);
}
#ifdef DIAG_IO
//DIAG(F("IODevice::read(): Vpin %d not found!"), (int)vpin);
DIAG(F("IODevice::read(): Vpin %d not found!"), (int)vpin);
#endif
return false;
}
@@ -288,7 +288,17 @@ int IODevice::readAnalogue(VPIN vpin) {
// Minimal implementations of public HAL interface, to support Arduino pin I/O and nothing more.
void IODevice::begin() { DIAG(F("NO HAL CONFIGURED!")); }
bool IODevice::configure(VPIN, ConfigTypeEnum, int, int []) { return true; }
bool IODevice::configure(VPIN pin, ConfigTypeEnum, int, int p[]) {
#ifdef DIAG_IO
DIAG(F("Arduino _configurePullup Pin:%d Val:%d"), pin, p[0]);
#endif
if (p[0]) {
pinMode(pin, INPUT_PULLUP);
} else {
pinMode(pin, INPUT);
}
return true;
}
void IODevice::write(VPIN vpin, int value) {
digitalWrite(vpin, value);
pinMode(vpin, OUTPUT);
@@ -297,7 +307,6 @@ void IODevice::writeAnalogue(VPIN, int, uint8_t, uint16_t) {}
bool IODevice::isBusy(VPIN) { return false; }
bool IODevice::hasCallback(VPIN) { return false; }
int IODevice::read(VPIN vpin) {
pinMode(vpin, INPUT_PULLUP);
return !digitalRead(vpin); // Return inverted state (5v=0, 0v=1)
}
int IODevice::readAnalogue(VPIN vpin) {
@@ -434,7 +443,7 @@ int ArduinoPins::_readAnalogue(VPIN vpin) {
interrupts();
#ifdef DIAG_IO
//DIAG(F("Arduino Read Pin:%d Value:%d"), pin, value);
DIAG(F("Arduino Read Pin:%d Value:%d"), pin, value);
#endif
return value;
}

View File

@@ -82,5 +82,9 @@
#define IBT_2_WITH_ARDUINO F("IBT_2_WITH_ARDUINO_SHIELD"), \
new MotorDriver(4, 5, 6, UNUSED_PIN, A5, 41.54, 5000, UNUSED_PIN), \
new MotorDriver(11, 13, UNUSED_PIN, UNUSED_PIN, A1, 2.99, 2000, UNUSED_PIN)
// YFROBOT Motor Shield (V3.1)
#define YFROBOT_MOTOR_SHIELD F("YFROBOT_MOTOR_SHIELD"), \
new MotorDriver(5, 4, UNUSED_PIN, UNUSED_PIN, A0, 2.99, 2000, UNUSED_PIN), \
new MotorDriver(6, 7, UNUSED_PIN, UNUSED_PIN, A1, 2.99, 2000, UNUSED_PIN)
#endif

View File

@@ -66,6 +66,14 @@ byte RMFT2::flags[MAX_FLAGS];
byte opcode=GET_OPCODE;
if (opcode==OPCODE_ENDEXRAIL) break;
switch (opcode) {
case OPCODE_AT:
case OPCODE_AFTER:
case OPCODE_IF:
case OPCODE_IFNOT:
IODevice::configureInput((VPIN)GET_OPERAND(0),true);
}
if (opcode==OPCODE_SIGNAL) {
VPIN red=GET_OPERAND(0);
VPIN amber=GET_OPERAND(1);

View File

@@ -3,9 +3,8 @@
#include "StringFormatter.h"
#define VERSION "3.1.7 draft"
// 3.1.7 Major functional and non-functional changes.
#define VERSION "3.2.0 rc1"
// 3.2.0 Major functional and non-functional changes.
// New HAL added for I/O (digital and analogue inputs and outputs, servos etc).
// Support for MCP23008, MCP23017 and PCF9584 I2C GPIO Extender modules.
// Support for PCA9685 PWM (servo) control modules.
@@ -23,6 +22,7 @@
// from <a> command and <T> command.
// Increased use of display for showing loco decoder programming information.
// ...
// 3.1.7 Bugfix: Unknown locos should have speed forward
// 3.1.6 Make output ID two bytes and guess format/size of registered outputs found in EEPROM
// 3.1.5 Fix LCD corruption on power-up
// 3.1.4 Refactor OLED and LCD drivers and remove unused code