guowenxue
2022-04-10 c7685f9912e89509acff5d2db54f9b3e955df2ee
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);