mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 10:46:31 +00:00
Attempt to stabilize Shelly Pro 4PM values
This commit is contained in:
parent
2d83c335bc
commit
692e9090c8
@ -272,6 +272,10 @@ void ShellyProUpdateIsr(void) {
|
||||
/*
|
||||
The goal if this function is to minimize SPI and SetVirtualPinState calls
|
||||
*/
|
||||
noInterrupts();
|
||||
detachInterrupt(SPro.pin_mcp23s17_int);
|
||||
interrupts();
|
||||
|
||||
uint32_t input_state = SP4Mcp23S17Read16(SP4_MCP23S17_INTCAPA); // Read intcap and clear interrupt
|
||||
input_state &= 0x806F; // Only test input bits
|
||||
|
||||
@ -298,6 +302,8 @@ void ShellyProUpdateIsr(void) {
|
||||
mask <<= 1;
|
||||
}
|
||||
SPro.input_state = input_state;
|
||||
|
||||
attachInterrupt(SPro.pin_mcp23s17_int, ShellyProUpdateIsr, CHANGE);
|
||||
}
|
||||
|
||||
bool ShellyProButton(void) {
|
||||
|
@ -836,6 +836,7 @@ bool Xnrg07(uint32_t function) {
|
||||
bool result = false;
|
||||
|
||||
switch (function) {
|
||||
/*
|
||||
case FUNC_ENERGY_EVERY_SECOND: // Use energy interrupt timer (fails on SPI)
|
||||
if (!Ade7953.use_spi) { // No SPI
|
||||
Ade7953EnergyEverySecond();
|
||||
@ -846,6 +847,11 @@ bool Xnrg07(uint32_t function) {
|
||||
Ade7953EnergyEverySecond();
|
||||
}
|
||||
break;
|
||||
*/
|
||||
case FUNC_ENERGY_EVERY_SECOND: // Use energy interrupt timer (fails on SPI)
|
||||
Ade7953EnergyEverySecond();
|
||||
break;
|
||||
|
||||
case FUNC_COMMAND:
|
||||
result = Ade7953Command();
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user