Previously, pullups were enabled on GPIO Expander digital pins by default, even if the pin was only ever used as an output. This could lead to a spurious HIGH state being seen by external equipment before the output is initialised to LOW. To avoid this, the pin pullup is now not enabled until a configure or read operation is issued for the pin.
Alias for existing <D SERVO ...> command added as <D ANOUT ...> (since not all analogue outputs are servos). Also, <D ANIN vpin> added to display the value of an analogue input pin.
Remove virtual method hasCallback().
Optimise findDevice() method (used by read, write etc.).
Simplify Sensor handling with regard to IO Devices that support callbacks.
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.
Performance enhancements in IODevice::loop() function.
Improved error handling, device is placed off line if not responding.
Improved error reporting, device shown as offline if not operational (faulty or not present).
When writing to analogue outputs pins, the digital _read() function now returns the 'busy' status of the analogue pin. Consequently, the _isBusy() function becomes superfluous and has been removed. The static IODevice::isBusy() function now calls the object's _read() function instead.
Also, limit in DFPlayer of 3 pins has been removed.
HAL Driver for VL53L0X Time-Of-Flight sensor. Basic implementation, which doesn't include most of the calibration etc. so is very lean on memory and CPU but not as accurate as it could be.
line added to pause program steps during OVERLOAD. case BASELINE
if (DCCWaveform::progTrack.getPowerMode()==POWERMODE::OVERLOAD) return;
-- also added a line in DCCWaveform.cpp
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
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.
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).