diff options
author | Jeonghoon Park <jh1979.park@samsung.com> | 2018-08-27 19:52:51 +0900 |
---|---|---|
committer | Jeonghoon Park <jh1979.park@samsung.com> | 2018-08-27 19:52:51 +0900 |
commit | 1bfb582a348f18e8565bbfcd4562ed3fed472c6d (patch) | |
tree | df442d7f5666bcdd77df76ee60eee6a7e5be9a60 | |
parent | 342df535790fbdfcad8ece3e988e6950de1f091d (diff) | |
download | st-things-co2-meter-1bfb582a348f18e8565bbfcd4562ed3fed472c6d.tar.gz st-things-co2-meter-1bfb582a348f18e8565bbfcd4562ed3fed472c6d.tar.bz2 st-things-co2-meter-1bfb582a348f18e8565bbfcd4562ed3fed472c6d.zip |
add more logs
-rw-r--r-- | src/co2-sensor.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/co2-sensor.c b/src/co2-sensor.c index 5c58667..dba015a 100644 --- a/src/co2-sensor.c +++ b/src/co2-sensor.c @@ -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; |