From c42f0f5152956ca8b9eb80baeaeaaa485d4b4a14 Mon Sep 17 00:00:00 2001 From: mikee47 Date: Fri, 20 Oct 2023 20:39:52 +0100 Subject: [PATCH] Significant IO Control library updates ## Fixes Fix request ID defaulting to "null" string bugfix: Device state handling - Device::stop() doesn't update state - Clear fault state on successful request Fix `toString(Request)` not available compiler error Fix issue with TX DONE interrupt on RP2040 - Fires when FIFO drops below 25% so needs more padding. Fix Modbus GenericRequest 'bad_node' error Bugfix: Cannot flush uart from ISR (RS485) Fix possible double-call during modbus execute event Bugfix: activeConfig not set in Serial Fix uninitialised default values Fix RFSwitch output initialisation and idling ## Improvements Use nested namespaces (C++17) `Device::nodeIdMax()` is calculated, doesn't need to be virtual Tidy up Device factory inheritance Add devmgr `findDevice` method template to handle up-casting Add device parameter to support minimum interval between transactions Put `toString` function overloads in global namespace Omit `command` from JSON responses if undefined Improve DMX512 - Fix segment not being set - Add device `fade` option - Implement `query` command - Tidy up `Request::nodeSet()` and `nodeAdjust()`, virtualise `setValue()` Improve RS485 - Add gpio numbers to `Serial::open()` Revise modbus PDU structure - Structure for input/holding registers is identical - Add methods for accessing coil bits RS485 devices can override default transaction timeout Add modbus `GenericRequest` support, plus transfer callback hook Allow RS485 per-request Slave Address override (e.g. for broadcast requests) Reduce RS485 debug verbosity Complete RS485 receive using timer to avoid premature request completion. This enables support for general RS232 communication where responses may be a bit bursty. Add Custom class. May serve as a useful starting point for new devices. ## New devices Add RI-D35 modbus energy meter Add STM8Relay modbus relay board support. - New 4-channel modbus board uses coil commands (0-based) and has 4 digital inputs - Use `update` command to change stm8relay slave address Add NT18B07 NTC temperature sensor board Add STS fan controller sample project This is a real application used to control three PWM fans for cooling a hybrid solar inverter. Uses RPi Pico as hardware can generate PWM and measure speed. --- Sming/Libraries/IOControl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sming/Libraries/IOControl b/Sming/Libraries/IOControl index d6a6ba1999..f860a2ae08 160000 --- a/Sming/Libraries/IOControl +++ b/Sming/Libraries/IOControl @@ -1 +1 @@ -Subproject commit d6a6ba1999542c4eba74e0aca24eda26901ee4d8 +Subproject commit f860a2ae08d70819f4d4487f9ed559dc0164615c