- small corrections
- changes to use the same source code with ESP8266 (esp-open-rtos) and ESP32 (ESP-IDF)
This commit is contained in:
parent
c3ae04c93f
commit
f0425e7abd
9 changed files with 251 additions and 138 deletions
|
@ -1,14 +1,16 @@
|
|||
/*
|
||||
* Driver for ams CCS811 digital temperature, humity, pressure and
|
||||
* gas sensor connected to I2C or SPI
|
||||
* Driver for AMS CCS811 digital gas sensor connected to I2C.
|
||||
*
|
||||
* Part of esp-open-rtos [https://github.com/SuperHouse/esp-open-rtos]
|
||||
* This driver is for the usage with the ESP8266 and FreeRTOS (esp-open-rtos)
|
||||
* [https://github.com/SuperHouse/esp-open-rtos]. It is also working with ESP32
|
||||
* and ESP-IDF [https://github.com/espressif/esp-idf.git] as well as Linux
|
||||
* based systems using a wrapper library for ESP8266 functions.
|
||||
*
|
||||
* ---------------------------------------------------------------------------
|
||||
*
|
||||
* The BSD License (3-clause license)
|
||||
*
|
||||
* Copyright (c) 2017 Gunar Schorcht (https://github.com/gschorcht]
|
||||
* Copyright (c) 2017 Gunar Schorcht (https://github.com/gschorcht)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -39,14 +41,7 @@
|
|||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "espressif/esp_common.h"
|
||||
#include "espressif/sdk_private.h"
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
|
||||
#include "i2c/i2c.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "ccs811.h"
|
||||
|
||||
|
@ -239,7 +234,7 @@ bool ccs811_set_mode (ccs811_sensor_t* dev, ccs811_mode_t mode)
|
|||
|
||||
// check whether setting measurement mode were succesfull
|
||||
if (!ccs811_reg_read(dev, CCS811_REG_MEAS_MODE, (uint8_t*)®, 1) ||
|
||||
!reg.drive_mode == mode)
|
||||
reg.drive_mode != mode)
|
||||
{
|
||||
error_dev ("Could not set measurement mode to %d", __FUNCTION__, dev, mode);
|
||||
return ccs811_check_error_status (dev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue