aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2012-06-17 15:55:53 +0200
committerJakob Odersky <jodersky@gmail.com>2012-06-17 15:55:53 +0200
commitfcdd390bfd07c9db21dc62e178db518c71893e8b (patch)
tree008d39ade04bc15e79b7f37eee3346a71d243e99
parent15708601c84dc12c6cf5409a7b03d2d87806d1a2 (diff)
downloadk8055-fcdd390bfd07c9db21dc62e178db518c71893e8b.tar.gz
k8055-fcdd390bfd07c9db21dc62e178db518c71893e8b.tar.bz2
k8055-fcdd390bfd07c9db21dc62e178db518c71893e8b.zip
refactor a forgotten int to bool
-rw-r--r--src/k8055.c4
-rw-r--r--src/k8055.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/k8055.c b/src/k8055.c
index 92ff291..5b8f806 100644
--- a/src/k8055.c
+++ b/src/k8055.c
@@ -350,10 +350,10 @@ int k8055_set_all_digital(k8055_device* device, int bitmask) {
return k8055_write_data(device);
}
-int k8055_set_digital(k8055_device* device, int channel, int value) {
+int k8055_set_digital(k8055_device* device, int channel, bool value) {
unsigned char data = device->data_out[OUT_DIGITAL_OFFSET];
- if (value == 0) /* off */
+ if (value == false) /* off */
data = data & ~(1 << channel);
else
/* on */
diff --git a/src/k8055.h b/src/k8055.h
index 5154214..3b42a1c 100644
--- a/src/k8055.h
+++ b/src/k8055.h
@@ -73,10 +73,10 @@ int k8055_set_all_digital(k8055_device* device, int bitmask);
/**Sets a digital output at given channel.
* @param device k8055 board
* @param channel channel of port
- * @param value output status: '1' for 'on', '0' for 'off'
+ * @param value output status: 'true' for on, 'false' for off
* @return K8055_ERROR_CLOSED if the given device is not open
* @return K8055_ERROR_WRITE if another error occurred during the write process */
-int k8055_set_digital(k8055_device* device, int channel, int value);
+int k8055_set_digital(k8055_device* device, int channel, bool value);
/**Sets the values of both analog outputs.
* @param device k8055 board