Merge pull request #3805 from andrethomas/development

MCP230xx - Fix millisecond counter reset placement
This commit is contained in:
Theo Arends 2018-09-15 19:20:14 +02:00 committed by GitHub
commit 2862ba739c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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();
}
}
}