bugfix CS cast to uint8_t

This commit is contained in:
Harald Pichler 2013-11-12 15:58:55 +01:00
parent 29c7297591
commit 1093989aef

View file

@ -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];