Fix bitshift on read in ADE7953 (#2537)

This commit is contained in:
Oxan van Leeuwen 2021-10-17 08:53:49 +02:00 committed by GitHub
parent 94d518a418
commit 65d2b37496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,9 +76,9 @@ class ADE7953 : public i2c::I2CDevice, public PollingComponent {
return err; return err;
*value = 0; *value = 0;
*value |= ((uint32_t) recv[0]) << 24; *value |= ((uint32_t) recv[0]) << 24;
*value |= ((uint32_t) recv[1]) << 24; *value |= ((uint32_t) recv[1]) << 16;
*value |= ((uint32_t) recv[2]) << 24; *value |= ((uint32_t) recv[2]) << 8;
*value |= ((uint32_t) recv[3]) << 24; *value |= ((uint32_t) recv[3]);
return i2c::ERROR_OK; return i2c::ERROR_OK;
} }