From 732d1963ed83abf4e5f1b06ec451a6943421d716 Mon Sep 17 00:00:00 2001
From: Guo Wenxue <guowenxue@gmail.com>
Date: Thu, 22 Sep 2022 00:36:11 +0800
Subject: [PATCH] update ds18b20.c to snprintf

---
 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