add more logs
authorJeonghoon Park <jh1979.park@samsung.com>
Mon, 27 Aug 2018 10:52:51 +0000 (19:52 +0900)
committerJeonghoon Park <jh1979.park@samsung.com>
Mon, 27 Aug 2018 10:52:51 +0000 (19:52 +0900)
src/co2-sensor.c

index 5c58667..dba015a 100644 (file)
@@ -117,8 +117,10 @@ unsigned int co2_sensor_voltage_to_ppm(double voltage)
                return 400;
 
        ppm = pow(10, (voltage - co2_zp_volt)/slope_value + log400);
-//     if (ppm > 10000)
-//             ppm = 10000;
+       if (ppm > 10000) {
+               _W("ppm value[%lf] is too large - limiting to 10000ppm", ppm);
+               ppm = 10000;
+       }
 #endif /* USE_EXAMPLE_CODE */
 
        return (unsigned int)ppm;