Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add new setting for retaining interrupt until next teleperiod = 0
New command:
sensor29 intretain,pin,0 // Disable interrupt retain for pin
sensor29 intretain,pin,1 // Enable interrupt retain for pin
Enabling interrupt retain will disable immediate telemetry and event reporting but will retain the fact that an interrupt has occurred for a particular pin.
This data is then reported when teleperiod reaches 0 as follows:
{"Time":"2018-12-06T23:59:26","MCP_INTRETAIN": {"D0":1,"D1":0,"D2":1,"D3":1,"D4":0,"Value":13}}
The pins on which interrupts occurred are reported as 1 and the combined bitset is represented as a decimal representation in Value.
For the functionality to work the relevant pins also need to be configured as INPUT with Interrupt (mode of choice) enabled.
All other interrupt-related responses are suppressed when interrupt retain is enabled for a particular pin but will still report as normal for pins not enabled for interrupt retain.
Once telemetry has been done the state of each retention is reset to 0.
This PR is related to user use case initially proposed by PR #4536 and then reworked after discussion on Discord Chat as to what the actual requirements need to be.