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

src/resource/resource_gas_detection_sensor.c

index ae7a97bb4c1f0f3b3ab71ff115323c949feb20a4..60e187af910b5db16123881e7d73b4afc08b0e3a 100644 (file)
@@ -51,8 +51,14 @@ 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;
 }