MCP230xx - Add 1 and 0 as option for ON and OFF

MCP230xx - Add 1 and 0 as option for ON and OFF
This commit is contained in:
Andre Thomas 2019-09-30 17:19:15 +02:00 committed by GitHub
parent 9cc4bc67ba
commit bed26fd121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -628,11 +628,11 @@ bool MCP230xx_Command(void) {
#ifdef USE_MCP230xx_OUTPUT
if (Settings.mcp230xx_config[pin].pinmode >= 5) {
uint8_t pincmd = Settings.mcp230xx_config[pin].pinmode - 5;
if (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "ON")) {
if ((!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "ON")) || (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "1"))) {
MCP230xx_SetOutPin(pin,abs(pincmd-1));
return serviced;
}
if (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "OFF")) {
if ((!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "OFF")) || (!strcmp(subStr(sub_string, XdrvMailbox.data, ",", 2), "0"))) {
MCP230xx_SetOutPin(pin,pincmd);
return serviced;
}