1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-30 03:26:13 +01:00
Commit Graph

1085 Commits

Author SHA1 Message Date
Ash-4
fc9aa71d9f
Merge pull request #189 from DCC-EX/EX-RAIL-Ash
Ex rail ash
2021-09-11 13:35:11 -05:00
Ash-4
72528658be
Merge branch 'EX-RAIL' into EX-RAIL-Ash 2021-09-11 13:32:17 -05:00
Neil McKechnie
4121a5f4da
Merge pull request #188 from DCC-EX/EX-RAIL-neil-AnalogueInputs
Ex rail neil analogue inputs
2021-09-11 14:22:48 +01:00
Neil McKechnie
2ed578821f Add analogue inputs to HAL.
Add ability to read analogue inputs on arduino and on external ADS1115 I2C modules.
2021-09-11 13:35:11 +01:00
Asbelos
70b59d491c Ash's OVERLOAD check
Makes prog track accesses wait if track in overload
2021-09-09 10:23:27 +01:00
Asbelos
254d83b6fc Remove SERIAL warning 2021-09-09 10:12:27 +01:00
Ash-4
ebabbbe59e
pause program steps if OVERLOAD
line added to pause program steps during OVERLOAD.  case BASELINE
if (DCCWaveform::progTrack.getPowerMode()==POWERMODE::OVERLOAD) return;
 -- also added a line in DCCWaveform.cpp
2021-09-08 14:06:39 -05:00
Ash-4
f8311b8c56
line added sentResetsSincePacket
in DCCWaveform::setPowerMode(POWERMODE mode)
 -- to pause while power is off due to PROG TRACK POWER OVERLOAD
and line added after case BASELINE in DCC.cpp
2021-09-08 14:00:42 -05:00
Asbelos
f38bf512ab Include SERIAL 2021-09-08 16:29:58 +01:00
Asbelos
9b3c6fe896 LCN and SERIAL/1/2/3 2021-09-08 16:21:04 +01:00
Asbelos
81dc512c86 Turnout print state and tell withrottle 2021-09-06 12:30:25 +01:00
Asbelos
222eca6524 XFON/XFOFF macros 2021-09-06 12:27:21 +01:00
Ash-4
4dff8a2b50
Restore ackManagerByte before retry Verify
Identify where initial value was not verified, but initial value returned with subsequent Read.
RCOUNT removed.  BIV and ITCBV added.
2021-09-05 16:43:24 -05:00
Ash-4
8d471d9f3f
Restore ackManagerByte before retry Verify 2021-09-05 16:19:03 -05:00
Asbelos
9ba13a62c9 Negative sensor ids 2021-09-04 10:38:38 +01:00
Asbelos
99222bd37f Turnout recursion test 2021-09-03 22:39:13 +01:00
Asbelos
9d5781a87c Signal pin corrections 2021-09-03 21:33:53 +01:00
Ash-4
b4fb76b6c8
Display running total ackRetrySum
RCOUNT added to Verify program to report if Read step occurs.
Report ackRetrySum on LCD when <D ACK RETRY nn> is sent
2021-08-30 17:02:05 -05:00
Ash-4
4b87c879a9
RCOUNT step added to Verify byte program 2021-08-30 16:52:50 -05:00
Ash-4
08810dafd7
Update retry counter
<D ACK RETRY nn>  will also display running total prior to its reset.
RCOUNT step included in Verify program will count when Verify fails
2021-08-30 16:37:06 -05:00
Neil McKechnie
afe9141671 RMFT SIGNAL macro to allow for RGB LEDs.
The SIGNAL macro has been changed to allow for use of RGB LEDs.  Connect R and G pins, and assign as SIGNAL(redpin,0,greenpin).  Then if amber is requested, the macro will set red and green on at the same time.
2021-08-29 12:14:23 +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
09eae0ea91 Fix FADE(pin,0,0) operation in RMFT 2021-08-29 01:10:47 +01:00
Neil McKechnie
0f55835b8b Add RMFT WAITFOR() and SERVO2() commands.
WAITFOR(pin) waits until the corresponding pin is not busy (e.g. has finished moving the servo).  SERVO2(pin, value, ms) moves to the nominated position in a time given in milliseconds by ms.
2021-08-28 17:39:48 +01:00
Neil McKechnie
40c6bb7f2e Output Turnout state change diagnostic if DIAG_IO #defined. 2021-08-27 21:47:48 +01:00
Neil McKechnie
7dea284ba8 DCCAccessoryDecoder class tidy. RCN-213 option.
Rationalise address calculation into three macros.  Ensure device is added to device chain.
Allow inversion of the DCC packet to match definition of packet D bit in RCN-213, D=0 for 'throw' (rather than the DCC++ usage of D=1 for 'throw').
2021-08-27 21:47:13 +01:00
Neil McKechnie
fb6ab85c4a Add flag to invert DCC Accessory command <a> behaviour
<a addr subaddr 1> command puts a D=1 into the DCC packet for a DCC Accessory Decoder.  This was previously though to correspond to a 'throw' request and a D=0 to a 'close' request.  RCN-213 standard identifies that D=1 is 'close' and D=0 is 'throw', so this change allows CS to be configured to invert the states to conform to the RCN-213 definition.
2021-08-27 21:43:24 +01:00
Neil McKechnie
23ed4e61af Remove compiler warning
If no route or automation definitions were present, the compiler warned that parameter stream is not used in function RMFT2::emitWithrottleDescriptions.
2021-08-27 17:09:40 +01:00
Neil McKechnie
b2ddb34273 RMFT: Add new FADE command for LED
LED FADE command allows an LED to be attached to a PCA9685 PWM module and controlled to any arbitrary brightness (0-4095), changing over a specified period of time in milliseconds.
FADE(vpin,value,ms)
2021-08-27 17:01:18 +01:00
Neil McKechnie
f8858b952e Servo positioning - correct handling of profile 0.
Ensure that profile 0 uses the duration parameter to calculate the number of steps.
2021-08-27 16:59:04 +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
93dfdcce53 Add <D HAL SHOW> command to list HAL device configuration.
Also, only display HAL device configurations at startup if DIAG_IO is #defined.
2021-08-27 15:44:26 +01:00
Neil McKechnie
7e601c38c4 HAL writeAnalogue function change.
IODevice::writeAnalogue() has an additional optional parameter "duration", specifying the time taken for the animation in units of 100ms (max 3276 seconds, or about 54 minutes).
2021-08-27 15:42:47 +01:00
Neil McKechnie
1dd574dc03 On <E> commmand, output EEPROM size and amount used.
Also, formatting and indentation fixed.
2021-08-27 12:56:27 +01:00
Neil McKechnie
0aea9169b1 Rename IODevice::isActive(vpin) to isBusy(vpin). 2021-08-27 11:18:15 +01:00
Neil McKechnie
0c218e1e13 Add HAL function configureInput(vpin,...) and configureServo(vpin,...). 2021-08-27 10:58:00 +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
Asbelos
5e30740c5b fix EXRAIL CALL/RETURN 2021-08-26 21:49:44 +01:00
Neil McKechnie
2469629cbb Temporarily use Wire for I2C. 2021-08-25 10:26:45 +01:00
Neil McKechnie
bad9e866f8
Merge pull request #185 from DCC-EX/EX-RAIL-neil-RCN213
Ex rail neil rcn213
2021-08-25 00:42:16 +01:00
Neil McKechnie
77d4d7c400
Merge branch 'EX-RAIL' into EX-RAIL-neil-RCN213 2021-08-25 00:38:38 +01:00
Neil McKechnie
fa04fa5084 I2C Manager, adjust loop code.
loop() contains startTransaction which is called after handleInterrupt().  However, startTransaction is called within handleInterrupt so remove the extra call.  This appears to solve strange problems encountered with the LCD display.
2021-08-25 00:34:19 +01:00
Neil McKechnie
80fc9e8a68 Make LCD Display I2C calls synchronous. 2021-08-25 00:29:57 +01:00
Neil McKechnie
d0fed2dd38 Make LCD output to I2C synchronous.
Temporary work-around to problems with LCD driver, until I can look at it in depth.
2021-08-24 23:02:24 +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
777d189cc5 Enable pullups for Arduino input pins as a default 2021-08-24 22:15:50 +01:00
Neil McKechnie
c45337d5d4 Enable pullups for Arduino input pins as a default (to match GPIO Extender modules). 2021-08-24 22:13:52 +01:00
Asbelos
8b498b8b49 </ROUTES> cmd for JMRI/Withrottle 2021-08-24 09:45:11 +01:00
Neil McKechnie
425de3fcc7 Create mySetup.cpp_example.txt
Provide an example showing directives for HAL device configuration.
2021-08-23 20:41:30 +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