SHT3x driver - some minor changes

- lookup tables made const to be held in flash
- crc8 computation changed to a non table lookup version
- measurement duration is now given in ticks and can be used directly
  for vTaskDelay (documentation and examples changed accordingly)
This commit is contained in:
Gunar Schorcht 2017-10-13 17:43:43 +02:00
parent 5a0fc09989
commit 1525f61fe3
5 changed files with 55 additions and 73 deletions

View file

@ -17,7 +17,7 @@
* +------------------------+ +----------+
*/
// #define SINGLE_SHOT_MODE
#define SINGLE_SHOT_MODE
#include "espressif/esp_common.h"
#include "esp/uart.h"
@ -55,7 +55,7 @@ void user_task (void *pvParameters)
// passive waiting until measurement results are available
if (duration > 0)
vTaskDelay (duration/portTICK_PERIOD_MS);
vTaskDelay (duration);
// retrieve the values and do something with them
if (sht3x_get_results (sensor, &values))

View file

@ -18,7 +18,7 @@
* | GPIO 12 (SDA) ------- SDA |
* +------------------------+ +----------+
*/
#include "espressif/esp_common.h"
#include "esp/uart.h"
@ -61,7 +61,7 @@ void user_task_sensor1 (void *pvParameters)
// passive waiting until measurement results are available
if (duration > 0)
vTaskDelay (duration/portTICK_PERIOD_MS);
vTaskDelay (duration);
// retrieve the values and do something with them
if (sht3x_get_results (sensor1, &values))