mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +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
|
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
|
uint32_t input_state = SP4Mcp23S17Read16(SP4_MCP23S17_INTCAPA); // Read intcap and clear interrupt
|
||||||
input_state &= 0x806F; // Only test input bits
|
input_state &= 0x806F; // Only test input bits
|
||||||
|
|
||||||
@ -298,6 +302,8 @@ void ShellyProUpdateIsr(void) {
|
|||||||
mask <<= 1;
|
mask <<= 1;
|
||||||
}
|
}
|
||||||
SPro.input_state = input_state;
|
SPro.input_state = input_state;
|
||||||
|
|
||||||
|
attachInterrupt(SPro.pin_mcp23s17_int, ShellyProUpdateIsr, CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShellyProButton(void) {
|
bool ShellyProButton(void) {
|
||||||
|
@ -836,6 +836,7 @@ bool Xnrg07(uint32_t function) {
|
|||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
switch (function) {
|
switch (function) {
|
||||||
|
/*
|
||||||
case FUNC_ENERGY_EVERY_SECOND: // Use energy interrupt timer (fails on SPI)
|
case FUNC_ENERGY_EVERY_SECOND: // Use energy interrupt timer (fails on SPI)
|
||||||
if (!Ade7953.use_spi) { // No SPI
|
if (!Ade7953.use_spi) { // No SPI
|
||||||
Ade7953EnergyEverySecond();
|
Ade7953EnergyEverySecond();
|
||||||
@ -846,6 +847,11 @@ bool Xnrg07(uint32_t function) {
|
|||||||
Ade7953EnergyEverySecond();
|
Ade7953EnergyEverySecond();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
|
case FUNC_ENERGY_EVERY_SECOND: // Use energy interrupt timer (fails on SPI)
|
||||||
|
Ade7953EnergyEverySecond();
|
||||||
|
break;
|
||||||
|
|
||||||
case FUNC_COMMAND:
|
case FUNC_COMMAND:
|
||||||
result = Ade7953Command();
|
result = Ade7953Command();
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user