Reverse the out value of the gas sensor
authorGeunsun, Lee <gs86.lee@samsung.com>
Thu, 7 Sep 2017 08:32:09 +0000 (17:32 +0900)
committerGeunsun, Lee <gs86.lee@samsung.com>
Thu, 7 Sep 2017 08:32:09 +0000 (17:32 +0900)
Change-Id: I02fa0b591ff320aca92df5da2cf878c4c9d42ea0

src/resource/resource_gas_detection_sensor.c

index ae7a97b..97c283c 100644 (file)
@@ -51,8 +51,13 @@ int resource_read_gas_detection_sensor(int pin_num, int *out_value)
                resource_get_info(pin_num)->close = resource_close_gas_detection_sensor;
        }
 
+       /**
+        * This model(FC-22) normally outputs 1, and outputs 0 as out_value when a flame is detected.
+        */
        ret = peripheral_gpio_read(resource_get_info(pin_num)->sensor_h, out_value);
        retv_if(ret < 0, -1);
 
+       *out_value = !*out_value;
+
        return 0;
 }