RaspberrPi project source code
guowenxue
23 hours ago 2e84abfd073ec3047c7b3295c47f109007f3bd80
Update lightd code to get lux value without timeout
1 files modified
6 ■■■■ changed files
project/lightd/lightd.c 6 ●●●● patch | view | raw | blame | history
project/lightd/lightd.c
@@ -60,7 +60,6 @@
    int                rv;
    float              lux = 0.0;
    time_t             last_time = 0;
    iotd_ctx_t         ctx;
    hwinfo_t          *hwinfo = &ctx.hwinfo;
@@ -156,14 +155,11 @@
            goto nextloop;
        }
        /* TSL2561 update lux in every 10 minutes  */
        if(check_timeout(&last_time, 600))
        {
        /* TSL2561 update lux value now */
            if( tsl2561_get_lux(&lux) < 0 )
            {
                log_error("TSL2561 sample failed, do not turn on the light\n");
                goto nextloop;
            }
        }
        /* Check need auto light or not */