From fcdd390bfd07c9db21dc62e178db518c71893e8b Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Sun, 17 Jun 2012 15:55:53 +0200 Subject: refactor a forgotten int to bool --- src/k8055.c | 4 ++-- src/k8055.h | 4 ++-- 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 -- cgit v1.2.3