From b43588cf8c3308d156c25726d7ec5c3ba7d8ddbf Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Sat, 6 Jan 2018 15:32:19 +0100 Subject: [PATCH] minor changes --- examples/ccs811/ccs811_one_sensor/ccs811_one_sensor.c | 2 ++ extras/ccs811/README.md | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/ccs811/ccs811_one_sensor/ccs811_one_sensor.c b/examples/ccs811/ccs811_one_sensor/ccs811_one_sensor.c index a53b8a6..51e6c08 100644 --- a/examples/ccs811/ccs811_one_sensor/ccs811_one_sensor.c +++ b/examples/ccs811/ccs811_one_sensor/ccs811_one_sensor.c @@ -174,5 +174,7 @@ void user_init(void) // start periodic measurement with one measurement per second ccs811_set_mode (sensor, ccs811_mode_1s); } + else + printf("Could not initialize CCS811 sensor\n"); } diff --git a/extras/ccs811/README.md b/extras/ccs811/README.md index fa660ae..3d39ae5 100644 --- a/extras/ccs811/README.md +++ b/extras/ccs811/README.md @@ -305,12 +305,14 @@ ccs811_set_mode (sensor, ccs811_mode_1s); ... ``` -Last, the user task that uses the sensor has to be created. +Finally, a user task that uses the sensor has to be created. ``` xTaskCreate(user_task, "user_task", 256, NULL, 2, 0); ``` +**Please note:** To avoid concurrency situations when driver functions are used to access the sensor, for example to read data, the user task must not be created until the sensor configuration is completed. + The user task can use different approaches to fetch new data. Either new data are fetched periodically or the interrupt signal *nINT* is used when new data are available or eCO2 value exceeds defined thresholds. If new data are fetched **periodically** the implementation of the user task is quite simply and could look like following. @@ -564,6 +566,8 @@ void user_init(void) // start periodic measurement with one measurement per second ccs811_set_mode (sensor, ccs811_mode_1s); } + else + printf("Could not initialize CCS811 sensor\n"); } ```