drivers: sensor: Migrate to new logger
Move all sensor drivers and samples to new logging system. Signed-off-by: Punit Vara <punit.vara@intel.com>
This commit is contained in:
parent
86e69ddd8b
commit
e5620a2b87
129 changed files with 928 additions and 798 deletions
|
@ -11,9 +11,13 @@
|
|||
#include <sensor.h>
|
||||
#include <string.h>
|
||||
#include <zephyr.h>
|
||||
#include <logging/log.h>
|
||||
|
||||
#include "dht.h"
|
||||
|
||||
#define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL
|
||||
LOG_MODULE_REGISTER(DHT);
|
||||
|
||||
/**
|
||||
* @brief Measure duration of signal send by sensor
|
||||
*
|
||||
|
@ -141,7 +145,7 @@ static int dht_sample_fetch(struct device *dev, enum sensor_channel chan)
|
|||
|
||||
/* verify checksum */
|
||||
if (((buf[0] + buf[1] + buf[2] + buf[3]) & 0xFF) != buf[4]) {
|
||||
SYS_LOG_DBG("Invalid checksum in fetched sample");
|
||||
LOG_DBG("Invalid checksum in fetched sample");
|
||||
ret = -EIO;
|
||||
} else {
|
||||
memcpy(drv_data->sample, buf, 4);
|
||||
|
@ -216,7 +220,7 @@ static int dht_init(struct device *dev)
|
|||
|
||||
drv_data->gpio = device_get_binding(CONFIG_DHT_GPIO_DEV_NAME);
|
||||
if (drv_data->gpio == NULL) {
|
||||
SYS_LOG_ERR("Failed to get GPIO device.");
|
||||
LOG_ERR("Failed to get GPIO device.");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,10 +9,6 @@
|
|||
|
||||
#include <device.h>
|
||||
|
||||
#define SYS_LOG_DOMAIN "DHT"
|
||||
#define SYS_LOG_LEVEL CONFIG_SYS_LOG_SENSOR_LEVEL
|
||||
#include <logging/sys_log.h>
|
||||
|
||||
#define DHT_START_SIGNAL_DURATION 18000
|
||||
#define DHT_SIGNAL_MAX_WAIT_DURATION 100
|
||||
#define DHT_DATA_BITS_NUM 40
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue