bugfix CS cast to uint8_t
This commit is contained in:
parent
29c7297591
commit
1093989aef
1 changed files with 6 additions and 6 deletions
|
@ -103,9 +103,9 @@ uint8_t DHT_Read_Data(uint16_t *temperature, uint16_t *humidity){
|
||||||
|
|
||||||
}
|
}
|
||||||
SREG = sreg; /* Enable interrupts. */
|
SREG = sreg; /* Enable interrupts. */
|
||||||
|
//printf("HUM %d %d %d %d %d %d",data[0],data[1],data[2],data[3],data[4],(uint8_t)(data[0] + data[1] + data[2] + data[3]) );
|
||||||
//Check if data received are correct by checking the CheckSum
|
//Check if data received are correct by checking the CheckSum
|
||||||
if (data[0] + data[1] + data[2] + data[3] == data[4]) {
|
if ((uint8_t)(data[0] + data[1] + data[2] + data[3]) == data[4]) {
|
||||||
#ifdef DHT11
|
#ifdef DHT11
|
||||||
*humidity = data[0];
|
*humidity = data[0];
|
||||||
*temperature = data[2];
|
*temperature = data[2];
|
||||||
|
|
Loading…
Reference in a new issue