From 1093989aefd770268ab687fd936fb088074d8630 Mon Sep 17 00:00:00 2001 From: Harald Pichler Date: Tue, 12 Nov 2013 15:58:55 +0100 Subject: [PATCH] bugfix CS cast to uint8_t --- platform/osd-merkur/dev/dht11.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/osd-merkur/dev/dht11.c b/platform/osd-merkur/dev/dht11.c index c163feb6b..07629bc74 100644 --- a/platform/osd-merkur/dev/dht11.c +++ b/platform/osd-merkur/dev/dht11.c @@ -67,8 +67,8 @@ uint8_t DHT_Read_Data(uint16_t *temperature, uint16_t *humidity){ //Repeat for each Transistions for (i=0; i= 15) { //If it was high for more than 40uS -// led1_on(); + //led1_on(); data[j/8]|=1; //it means it is bit '1' so make a logic -// led1_off(); + //led1_off(); } //OR with the value (save it) j++; //making an OR by 1 to this value 10101000 } //we will have the resault 10101001 @@ -103,9 +103,9 @@ uint8_t DHT_Read_Data(uint16_t *temperature, uint16_t *humidity){ } 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 - 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 *humidity = data[0]; *temperature = data[2];