Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCP230xx - Add Interrupt Retain #4547

Merged
merged 2 commits into from
Dec 7, 2018
Merged

Conversation

andrethomas
Copy link
Contributor

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.

MCP230xx driver - add interrupt retention over teleperiod.
@arendst arendst merged commit cd65888 into arendst:development Dec 7, 2018
@andrethomas andrethomas deleted the mcp230xx branch December 7, 2018 09:52
gemu2015 pushed a commit to gemu2015/Sonoff-Tasmota that referenced this pull request Jan 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants