From 8a0e43e2ba062b35f20ddcd83a7811a9e1a71786 Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Wed, 31 Jul 2019 17:06:01 +0800 Subject: [PATCH] update mqttd for auto fill-in light and test ok --- mqttd/hal/tsl2561.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/mqttd/hal/tsl2561.c b/mqttd/hal/tsl2561.c index c83501f..9787d98 100644 --- a/mqttd/hal/tsl2561.c +++ b/mqttd/hal/tsl2561.c @@ -22,6 +22,7 @@ #include <errno.h> #include <time.h> +#include "hal.h" #include "tsl2561.h" @@ -37,11 +38,11 @@ tsl_fd = wiringPiI2CSetup(TSL2561_I2C_ADDR); if(tsl_fd < 0) { - printf("TSL2561 I2C setup failure: %s\n", strerror(errno)); + log_err("TSL2561 I2C setup failure: %s\n", strerror(errno)); } else { - printf("TSL2561 initialise ok, tsl_fd=%d\n", tsl_fd); + log_err("TSL2561 initialise ok, tsl_fd=%d\n", tsl_fd); } @@ -102,8 +103,6 @@ lux = 0.0; OUT: - printf("TSLl2561 get lux: %.3f\n", lux); - wiringPiI2CWrite(tsl_fd, CONTROL_REG); wiringPiI2CWrite(tsl_fd, POWER_DOWN); -- Gitblit v1.9.1