mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-29 05:36:39 +00:00
Fix broken I2C priority
Fix broken I2C priority regression from v12.3.1.3 (#17810)
This commit is contained in:
parent
91559ec883
commit
664b60332a
@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
- ADE7953 when calibration data for second channel is used regression from v12.2.0.2
|
- ADE7953 when calibration data for second channel is used regression from v12.2.0.2
|
||||||
- Shelly Pro 1/2 relay click at restart regression from v12.3.1.4
|
- Shelly Pro 1/2 relay click at restart regression from v12.3.1.4
|
||||||
- Zigbee extend plug-in modifiers to 16 bits
|
- Zigbee extend plug-in modifiers to 16 bits
|
||||||
|
- Broken I2C priority regression from v12.3.1.3 (#17810)
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
@ -267,30 +267,29 @@ void I2cScan(uint8_t bus = 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void I2cResetActive(uint32_t addr, uint32_t count = 1, uint8_t bus = 0) {
|
void I2cResetActive(uint32_t addr, uint8_t bus = 0) {
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
bus = 0;
|
bus = 0;
|
||||||
#endif
|
#endif
|
||||||
addr &= 0x7F; // Max I2C address is 127
|
addr &= 0x7F; // Max I2C address is 127
|
||||||
count &= 0x7F; // Max 4 x 32 bits available
|
i2c_active[bus][addr / 32] &= ~(1 << (addr % 32));
|
||||||
while (count-- && (addr < 128)) {
|
|
||||||
i2c_active[bus][addr / 32] &= ~(1 << (addr % 32));
|
// AddLog(LOG_LEVEL_DEBUG, PSTR("I2C: I2cResetActive bus0 %08X-%08X-%08X-%08X, bus1 %08X-%08X-%08X-%08X"),
|
||||||
addr++;
|
// i2c_active[0][0], i2c_active[0][1], i2c_active[0][2], i2c_active[0][3],
|
||||||
}
|
// i2c_active[1][0], i2c_active[1][1], i2c_active[1][2], i2c_active[1][3]);
|
||||||
// AddLog(LOG_LEVEL_DEBUG, PSTR("I2C: Active %08X,%08X,%08X,%08X"), i2c_active[bus][0], i2c_active[bus][1], i2c_active[bus][2], i2c_active[bus][3]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void I2cSetActive(uint32_t addr, uint32_t count = 1, uint8_t bus = 0) {
|
void I2cSetActive(uint32_t addr, uint8_t bus = 0) {
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
bus = 0;
|
bus = 0;
|
||||||
#endif
|
#endif
|
||||||
addr &= 0x7F; // Max I2C address is 127
|
addr &= 0x7F; // Max I2C address is 127
|
||||||
count &= 0x7F; // Max 4 x 32 bits available
|
i2c_active[bus][addr / 32] |= (1 << (addr % 32));
|
||||||
while (count-- && (addr < 128)) {
|
|
||||||
i2c_active[bus][addr / 32] |= (1 << (addr % 32));
|
// AddLog(LOG_LEVEL_DEBUG, PSTR("I2C: I2cSetActive addr %02X, bus%d, bus0 %08X-%08X-%08X-%08X, bus1 %08X-%08X-%08X-%08X"),
|
||||||
addr++;
|
// addr, bus,
|
||||||
}
|
// i2c_active[0][0], i2c_active[0][1], i2c_active[0][2], i2c_active[0][3],
|
||||||
// AddLog(LOG_LEVEL_DEBUG, PSTR("I2C: Active %08X,%08X,%08X,%08X"), i2c_active[bus][0], i2c_active[bus][1], i2c_active[bus][2], i2c_active[bus][3]);
|
// i2c_active[1][0], i2c_active[1][1], i2c_active[1][2], i2c_active[1][3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void I2cSetActiveFound(uint32_t addr, const char *types, uint8_t bus = 0) {
|
void I2cSetActiveFound(uint32_t addr, const char *types, uint8_t bus = 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user