mirror of https://github.com/arendst/Tasmota.git
Merge pull request #3597 from andrethomas/development
MCP230xx - Resolve compiler warnings
This commit is contained in:
commit
a434051be1
|
@ -108,9 +108,8 @@ if ((6 == pinmod) && (statu < 2)) { statu = abs(statu-1); }
|
||||||
return "TOGGLE";
|
return "TOGGLE";
|
||||||
break;
|
break;
|
||||||
#endif // USE_MCP230xx_OUTPUT
|
#endif // USE_MCP230xx_OUTPUT
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* IntModeTxt(uint8_t intmo) {
|
const char* IntModeTxt(uint8_t intmo) {
|
||||||
|
@ -127,10 +126,8 @@ const char* IntModeTxt(uint8_t intmo) {
|
||||||
case 3:
|
case 3:
|
||||||
return "DISABLED";
|
return "DISABLED";
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
return "UNKNOWN";
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t MCP230xx_readGPIO(uint8_t port) {
|
uint8_t MCP230xx_readGPIO(uint8_t port) {
|
||||||
|
@ -235,7 +232,7 @@ void MCP230xx_Detect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MCP230xx_CheckForInterrupt(void) {
|
void MCP230xx_CheckForInterrupt(void) {
|
||||||
uint8_t intf;
|
uint8_t intf;
|
||||||
uint8_t mcp230xx_intcap = 0;
|
uint8_t mcp230xx_intcap = 0;
|
||||||
uint8_t report_int;
|
uint8_t report_int;
|
||||||
|
@ -351,22 +348,22 @@ void MCP230xx_SetOutPin(uint8_t pin,uint8_t pinstate) {
|
||||||
if (interlock && (pinmo == Settings.mcp230xx_config[pin+pinadd].pinmode)) {
|
if (interlock && (pinmo == Settings.mcp230xx_config[pin+pinadd].pinmode)) {
|
||||||
if (pinstate < 2) {
|
if (pinstate < 2) {
|
||||||
if (6 == pinmo) {
|
if (6 == pinmo) {
|
||||||
if (pinstate) portpins |= (1 << pin-(port*8)); else portpins |= (1 << pin+pinadd-(port*8)),portpins &= ~(1 << pin-(port*8));
|
if (pinstate) portpins |= (1 << (pin-(port*8))); else portpins |= (1 << (pin+pinadd-(port*8))),portpins &= ~(1 << (pin-(port*8)));
|
||||||
} else {
|
} else {
|
||||||
if (pinstate) portpins &= ~(1 << pin+pinadd-(port*8)),portpins |= (1 << pin-(port*8)); else portpins &= ~(1 << pin-(port*8));
|
if (pinstate) portpins &= ~(1 << (pin+pinadd-(port*8))),portpins |= (1 << (pin-(port*8))); else portpins &= ~(1 << (pin-(port*8)));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (6 == pinmo) {
|
if (6 == pinmo) {
|
||||||
portpins |= (1 << pin+pinadd-(port*8)),portpins ^= (1 << pin-(port*8));
|
portpins |= (1 << (pin+pinadd-(port*8))),portpins ^= (1 << (pin-(port*8)));
|
||||||
} else {
|
} else {
|
||||||
portpins &= ~(1 << pin+pinadd-(port*8)),portpins ^= (1 << pin-(port*8));
|
portpins &= ~(1 << (pin+pinadd-(port*8))),portpins ^= (1 << (pin-(port*8)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (pinstate < 2) {
|
if (pinstate < 2) {
|
||||||
if (pinstate) portpins |= (1 << pin-(port*8)); else portpins &= ~(1 << pin-(port*8));
|
if (pinstate) portpins |= (1 << (pin-(port*8))); else portpins &= ~(1 << (pin-(port*8)));
|
||||||
} else {
|
} else {
|
||||||
portpins ^= (1 << pin-(port*8));
|
portpins ^= (1 << (pin-(port*8)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
I2cWrite8(mcp230xx_address, MCP230xx_GPIO + port, portpins);
|
I2cWrite8(mcp230xx_address, MCP230xx_GPIO + port, portpins);
|
||||||
|
|
Loading…
Reference in New Issue