mirror of
https://github.com/esphome/esphome.git
synced 2025-01-30 23:02:14 +01:00
Fixed wrong sizeof in digital_read
This commit is contained in:
parent
4fa1d61965
commit
5f3e4d7c04
@ -19,7 +19,7 @@ namespace gpio_expander {
|
||||
template<typename T, T N> class CachedGpioExpander {
|
||||
public:
|
||||
bool digital_read(T pin) {
|
||||
uint8_t bank = pin / (sizeof(uint8_t) * BITS_PER_BYTE);
|
||||
uint8_t bank = pin / (sizeof(T) * BITS_PER_BYTE);
|
||||
if (this->read_cache_invalidated_[bank]) {
|
||||
this->read_cache_invalidated_[bank] = false;
|
||||
if (!this->digital_read_hw(pin))
|
||||
|
Loading…
Reference in New Issue
Block a user