bugfix dht11 config

This commit is contained in:
Harald Pichler 2016-07-04 20:26:06 +02:00
parent 349f6bf429
commit e534bcaa25
4 changed files with 10 additions and 3 deletions

View file

@ -64,6 +64,11 @@
extern resource_t res_info; extern resource_t res_info;
#endif #endif
#if PLATFORM_HAS_DHT11
uint16_t dht11_hum=0;
uint16_t dht11_temp=0;
#endif
#if PLATFORM_HAS_DHT11HUM #if PLATFORM_HAS_DHT11HUM
#include "dev/dht11.h" #include "dev/dht11.h"
extern resource_t res_dht11hum; extern resource_t res_dht11hum;
@ -107,6 +112,7 @@ hw_init()
//DHT_INIT(); //DHT_INIT();
DHT_Read_Data(&dht11_temp, &dht11_hum); DHT_Read_Data(&dht11_temp, &dht11_hum);
#endif #endif
NETSTACK_MAC.off(1);
} }
#define MESURE_INTERVAL (20 * CLOCK_SECOND) #define MESURE_INTERVAL (20 * CLOCK_SECOND)
#define READ_TIME ( 2 * CLOCK_SECOND) #define READ_TIME ( 2 * CLOCK_SECOND)
@ -153,7 +159,7 @@ PROCESS_THREAD(rest_server_example, ev, data)
#if PLATFORM_HAS_DS1820 #if PLATFORM_HAS_DS1820
rest_activate_resource(&res_ds1820,"s/temp"); rest_activate_resource(&res_ds1820,"s/temp");
#endif #endif
#if PLATFORM_HAS_DHT11 #if PLATFORM_HAS_DHT11HUM
rest_activate_resource(&res_dht11hum,"s/hum"); rest_activate_resource(&res_dht11hum,"s/hum");
#endif #endif
#if PLATFORM_HAS_DHT11TEMP #if PLATFORM_HAS_DHT11TEMP

View file

@ -33,6 +33,7 @@
#define PROJECT_ERBIUM_CONF_H_ #define PROJECT_ERBIUM_CONF_H_
#define DHT11 1 #define DHT11 1
#define PLATFORM_HAS_DHT11 1
#define PLATFORM_HAS_INFO 1 #define PLATFORM_HAS_INFO 1
#define PLATFORM_HAS_BATTERY 1 #define PLATFORM_HAS_BATTERY 1
#define PLATFORM_HAS_DS1820 1 #define PLATFORM_HAS_DS1820 1

View file

@ -61,7 +61,7 @@ RESOURCE(res_dht11hum,
NULL, NULL,
NULL); NULL);
uint16_t dht11_hum=0; extern uint16_t dht11_hum;
static void static void
res_get_dht11hum_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset) res_get_dht11hum_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)

View file

@ -64,7 +64,7 @@ RESOURCE(res_dht11temp,
NULL, NULL,
NULL); NULL);
uint16_t dht11_temp=0; extern uint16_t dht11_temp;
static void static void
res_get_dht11temp_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset) res_get_dht11temp_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)