mirror of https://github.com/arendst/Tasmota.git
Merge pull request #3805 from andrethomas/development
MCP230xx - Fix millisecond counter reset placement
This commit is contained in:
commit
2862ba739c
|
@ -280,7 +280,9 @@ void MCP230xx_CheckForInterrupt(void) {
|
|||
if (report_int) {
|
||||
bool int_tele = false;
|
||||
bool int_event = false;
|
||||
unsigned long millis_since_last_int = millis() - int_millis[intp+(mcp230xx_port*8)];
|
||||
unsigned long millis_now = millis();
|
||||
unsigned long millis_since_last_int = millis_now - int_millis[intp+(mcp230xx_port*8)];
|
||||
int_millis[intp+(mcp230xx_port*8)]=millis_now;
|
||||
switch (Settings.mcp230xx_config[intp+(mcp230xx_port*8)].int_report_mode) {
|
||||
case 0:
|
||||
int_tele=true;
|
||||
|
@ -304,7 +306,6 @@ void MCP230xx_CheckForInterrupt(void) {
|
|||
sprintf(command,"event MCPINT_D%i=%i",intp+(mcp230xx_port*8),((mcp230xx_intcap >> intp) & 0x01));
|
||||
ExecuteCommand(command, SRC_RULE);
|
||||
}
|
||||
int_millis[intp+(mcp230xx_port*8)]=millis();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue