drivers: sensor: Fix DHT20 build failure with CRC configured
Fixes the build error: 'crc' undeclared for DHT20 sensor with CONFIG_DHT20_CRC option enabled. Signed-off-by: Konrad Sikora <kontakt@konradsikora.pl>
This commit is contained in:
parent
fb71ca2237
commit
f3af39b4d7
2 changed files with 2 additions and 1 deletions
|
@ -190,7 +190,7 @@ static int dht20_read_sample(const struct device *dev, uint32_t *t_sample, uint3
|
|||
|
||||
#if defined(CONFIG_DHT20_CRC)
|
||||
/* Compute and check CRC with last byte of measurement data */
|
||||
crc = crc8(rx_buf, 6, DHT20_CRC_POLYNOM, 0xFF, false);
|
||||
uint8_t crc = crc8(rx_buf, 6, DHT20_CRC_POLYNOM, 0xFF, false);
|
||||
|
||||
if (crc != rx_buf[6]) {
|
||||
rc = -EIO;
|
||||
|
|
|
@ -16,3 +16,4 @@ CONFIG_W1=y
|
|||
CONFIG_SENSOR=y
|
||||
CONFIG_ICM42605_TRIGGER_NONE=y
|
||||
CONFIG_EMUL=y
|
||||
CONFIG_DHT20_CRC=y
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue