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.
<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.
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.
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.
* 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.
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.
In prep for Wifi siolution, all output functions changed to expect Print class instead of Stream... Can still pass Serial1 etc because Stream extends Print, but this allows for an output-only class extending Print to collect a response buffer for Wifi sending with AT commands.