1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-26 22:01:25 +01:00
Commit Graph

56 Commits

Author SHA1 Message Date
Harald Barth
df7b890758 No EEPROM so you do not need this 2023-05-07 23:58:47 +02:00
Harald Barth
8a425fe0ef do not broadcast a turnout state that has not changed 2 2023-03-25 19:28:37 +01:00
Harald Barth
1ec378281b do not broadcast a turnout state that has not changed 2023-03-25 12:14:58 +01:00
pmantoine
67bd886a98 USB Serial fixes for EX-RAIL & debug 2023-02-15 08:51:21 +08:00
Harald Barth
4ebf7978d8 rename all RMFT_ACTIVE to EXTAIL_ACTVE 2022-01-31 03:00:29 +01:00
Fred
bd7c8bf78e
Rename RMFT files and references to EXRAIL (#201)
Make naming consistent with our marketing of ex-rail for files and defines

* Rename RMFT.h to EXRAIL.h

* Rename RMFT2.cpp to EXRAIL2.cpp

* Rename RMFT2.h to EXRAIL2.h

* Rename RMFT2MacroReset.h to EXRAIL2MacroReset.h

* Rename RMFTMacros.h to EXRAILMacros.h

* Rename RMFT references to EXRAIL
2022-01-30 12:31:26 -05:00
Harald Barth
d45585ce3d update copyright notes 2022-01-07 02:28:35 +01:00
Asbelos
18695888dd Fixing broadcast 2021-12-07 00:24:48 +00:00
Asbelos
0a40ef5ceb Merge branch 'master' into Broadcast 2021-12-05 12:13:39 +00:00
Asbelos
0f36ccdc57 Broadcast changes (1) UNTESTED 2021-12-05 12:08:59 +00:00
Harald Barth
1807189183 make it possible to disable EEPROM code to save flash space 2021-11-08 02:07:21 +01:00
Neil McKechnie
e287af83ff DCC Turnouts: Store address/subaddress separately. Enable address 0.
The range of accessory decoder addresses for the <a> command is 0-511 in line with the DCC packet contents.  The turnout command previously rejected address 0; this has been changed to the same range of addresses can be used by both commands, i.e. address 0-511 and subaddress 0-3.  The linear address mapping remains so that linear address 1 is addr/subaddr 1/0; i.e. the first decoder address is not accessible by linear address.
2021-09-22 10:38:11 +01:00
Asbelos
81dc512c86 Turnout print state and tell withrottle 2021-09-06 12:30:25 +01:00
Neil McKechnie
1bb7b5cc77 Make defaults for PWM (servo) positions 0 (PWM off) if not configured.
When writing to a PWM device (servo or LED for example), it is possible to request the target position in the call, or to ask for a SET or RESET position.  In the latter case, the positions corresponding to SET and RESET must be known, i.e. preconfigured.  Defaults were assigned for this, but because the correct values will depend on the hardware device being driven, the defaults have been removed.
In addition, the <T> command, when defining a servo turnout, now configures the PWM positions (not required by <T> commands, but desirable for consistency with other commands).
2021-08-29 12:04:13 +01:00
Neil McKechnie
40c6bb7f2e Output Turnout state change diagnostic if DIAG_IO #defined. 2021-08-27 21:47:48 +01:00
Neil McKechnie
6ebf908802 Ensure Turnout changes are notified on LCN activity.
Also, some comment updates.
2021-08-27 15:45:22 +01:00
Neil McKechnie
0a9fcf6ebc
Neil bugfixes. (#186)
* Re-enable native I2C driver.

* Minor non-functional changes to native I2C Manager.

* Minor changes to make variable types explicit in comparisons.

* Fix IODevice::loop() to avoid null pointer dereference.

Strange problems with LCD driver tracked down to being caused by a call to p->_loop() when p is NULL.

* Correct sense of comparison in LCN support function Turnout::setClosedStateOnly()

* Remove code (now unused) from LCD driver.

* Add I2C textual error messages.

* Add I2C textual error messages.

* Fix compile error in 4809 I2C driver.

* Remove init function call from SSD1306 driver.
2021-08-26 23:04:13 +01:00
Neil McKechnie
08cfe41cf3 Revert to original DCC++ Classic Turnout command polarity.
Revert to <T id 1> command being 'throw' and <T id 0> being 'close', for turnouts.
2021-08-24 22:18:51 +01:00
Neil McKechnie
0d235b65d3 Turnouts - make code clearer.
Overlay of flags bits added in struct TurnoutData,, called flags.  This simplifies the the EEPROM update code.
2021-08-23 17:36:50 +01:00
Neil McKechnie
f0cd96fed3 Changes associated with RCN-213 DCC Accessory Packet format 2021-08-23 12:43:14 +01:00
Neil McKechnie
fdaa7b51b9 Move Turnout code from .h to .cpp.
Move implementation of Turnout::printState from Turnouts.h to Turnouts.cpp.  No functional changes.
2021-08-22 22:30:09 +01:00
Neil McKechnie
7b47b86143 Turnouts: adjust the split of code between .h and .cpp file. No functional changes. 2021-08-22 22:25:23 +01:00
Neil McKechnie
0875d27b0a Remove 'activate' functions from turnout classes.
Remove the static 'activate' function and rename the virtual 'activate' function to 'setClosedInternal'.
2021-08-22 14:07:16 +01:00
Neil McKechnie
39a69e340e Turnout EEPROM improvements.
Ensure state is saved and restored from EEPROM as expected.
Make constructors for turnouts private.  Otherwise, a statically created turnout may be initialising itself before the underlying HAL device has been created.  By requiring the create() call be used, there is more control over the timing of the turnout object's creation.
2021-08-21 23:16:52 +01:00
Neil McKechnie
d8366f33c8 Make <s> output turnout state rather than full turnout definition.
<s> command currently prints the current states for outputs and for sensors, but prints the full configuration of turnouts.  This change makes the turnout output consistent, i.e. just <H id state> is output for each turnout.  The <T> command still outputs the full turnout definition.
2021-08-21 00:25:00 +01:00
Neil McKechnie
482f4b1c79 Tidy up recent changes to Turnout class. 2021-08-20 14:36:18 +01:00
Neil McKechnie
b4a3b503bc Turnout notification handling enhanced.
Ensure that the <H> message is sent on the serial USB (to JMRI) whenever the turnout is closed or thrown, even if the request didn't originate on the serial USB.
2021-08-20 00:07:50 +01:00
Neil McKechnie
7f6173825f Various corrections to Turnout code. 2021-08-19 21:43:55 +01:00
Neil McKechnie
fd36ca2b92 Restructure Turnout class.
Turnout class split into a base class for common code and specific subclasses for Servo, DCC, VPIN and LCN turnouts.
Interface further narrowed to reduce direct access to member variables.
Turnout creation command handling has been moved into the DCCEXParser class.
Turnout function and parameter names changed to make the Throw and Close functionality explicit.
Turnout commands <T id C> (close) and <T id T> (throw) added.
2021-08-19 21:22:59 +01:00
Asbelos
36f6e2f9ce Narrowing Turnout publics 2021-08-18 18:55:22 +01:00
Neil McKechnie
9dacd24d27
Various HAL enhancements. (#182)
* Add <D SERVO vpin position> command

Allow a PWM servo to be driven to any arbitrary position.

* Enhancements for HAL drivers

Add state change notification for external GPIO module drivers;
Allow drivers to be installed statically by declaration (as an alternative to the 'create' call).

* Create IO_HCSR04.h

HAL driver for HC-SR04 ultrasonic distance sensor (sonar).

* Enable servo commands in NO-HAL mode, but return error.

Avoid compile errors in RMFT.cpp when compiled with basic HAL by including the Turnout::createServo function as a stub that returns NULL.

* Update IO_HCSR04.h

Minor changes

* Change <D SERVO>

Give the <D SERVO> command an optional parameter of the profile.  For example, <D SERVO 100 200 3> will slowly move the servo on pin 100 to PWM position corresponding to 200.  If omitted, the servo will move immediately (no animation).

* IODevice (HAL) changes

1) Put new devices on the end of the chain instead of the beginning.  This will give better performance for devices created first (ArduinoPins and extender GPIO devices, typically).
2) Remove unused functions.

* Update IO_HCSR04.h

Allow thresholds for ON and OFF to be separately configured at creation.

* Update IODevice.cpp

Fix compile error on IO_NO_HAL minimal HAL version.

* Update IO_PCA9685.cpp

Remove unnecessary duplicated call to min() function.
2021-08-17 23:41:34 +01:00
FrightRisk
5eff4c5ee5 Squash all commits on RMFT branch to create EX-RAIL branch 2021-08-03 17:12:25 -04:00
Harald Barth
2443e5903c Fix type warnings 2021-07-27 18:39:54 +02:00
Neil McKechnie
107e9d1d62
Fix turnout handling of EEPROM (#147)
On activation, Turnout code was saving entire EEPROM twice, even if EEPROM save was switched off with the <e> command.  It's now been changed so that only the tStatus byte is updated, and only if the turnout has previously been saved into EEPROM.
2021-05-07 00:12:33 +01:00
Asbelos
a0538ca61b 3.0.9 newlines 2021-03-30 22:01:37 +01:00
Asbelos
85a2b9231b <* *> wrapped diags
And lots of \n cleanups.
2021-03-25 14:23:38 +00:00
Fred
d7b2cf3d76
Assorted bits (#138)
* LCN

* Prevent deprecated compiler warning

* Implement huge function numbers

* new commands

<! [cab]> forget locos.
<9> ESTOP ALL.
<D RESET> reboot arduino

* Waveform accuracy msg

* Drop post-write verify

* UNUSED_PIN current measure

and callback -2 for cv actions.

* Correct diags

* ESTOP a forget loco

* ESTOP loco on forget

* Avoid compiler warning

* current sensor offset

* Restore <1 JOIN> after prog track operation

* <!> ESTOP <-> FORGET

* Auto current offset detection

* manage current offset and diagnostics

* neater msg at startup

* Add startup message to LCN master

* DCC::setJoinRelayPin

Co-authored-by: Asbelos <asbelos@btinternet.com>
2021-03-23 10:37:05 -04:00
mstevetodd
42075f838e
<T> should send turnout definitions, not just states (#110)
* use int, not byte for witSpeed

* add turnout, sensor and output states to 's'tatus message

* <T> should send turnout definitions, not just states
2021-01-04 10:57:03 -05:00
Harald Barth
75d7547f11 Turnouts stored to EEPROM without trashing other stuff 2020-10-03 14:07:25 +02:00
Asbelos
4e0c227012 Cleaning of Turnout/Output/Sensor
PLEASE BE AWARE, I have not tested Outputs or Sensors either before or after this change.
(and they were certainly wrong before!)
2020-09-06 12:44:19 +01:00
Asbelos
f7557f1436 Turn out changes for WiThrottle 2020-08-20 12:38:09 +01:00
Asbelos
cdcb01d300 Compiled motorDriver
New motorDriver design...
2020-08-15 11:32:32 +01:00
Asbelos
e01b929fd0 Merge branch 'Stream-Reference-Fix' 2020-08-01 17:00:31 +01:00
Asbelos
9044cce2a3 Change Stream refernces to pointers
I misunderstood that references can never be changed.
2020-08-01 16:32:16 +01:00
Harald Barth
b886a09f82 Autocreate turnouts 2020-07-25 18:50:23 +02:00
Asbelos
575b5da606 WiThrottle turnout improvement 2020-07-23 17:34:35 +01:00
Asbelos
57178dac4d Turnout status display bug 2020-07-23 15:42:07 +01:00
Asbelos
964f39d376 Fix hanging turnouts
Caused by tt->activate call when Turnouts was a struct not a class!
2020-07-23 12:48:38 +01:00
Asbelos
46d1f3e237 Copyrights etc 2020-07-03 17:35:02 +01:00
Asbelos
1a1429bf72 Servo Turnouts 2020-06-23 20:01:43 +01:00