aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2012-06-14 17:00:53 +0200
committerJakob Odersky <jodersky@gmail.com>2012-06-14 17:00:53 +0200
commit5c506a9f89cf8273b8b790fb77416fc68d96d20b (patch)
treebe407ddb8ff3f561a83885ec52bba25c3277ebbe
parent774eb21b30cddabf002d65bc686cf2450f82c8a0 (diff)
downloadk8055-5c506a9f89cf8273b8b790fb77416fc68d96d20b.tar.gz
k8055-5c506a9f89cf8273b8b790fb77416fc68d96d20b.tar.bz2
k8055-5c506a9f89cf8273b8b790fb77416fc68d96d20b.zip
use stdbool
-rw-r--r--src/k8055.c6
-rw-r--r--src/k8055.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/k8055.c b/src/k8055.c
index d136a4a..e383f3c 100644
--- a/src/k8055.c
+++ b/src/k8055.c
@@ -131,7 +131,7 @@
#include "k8055.h"
/** Represents a Vellemean K8055 USB board. */
-typedef struct k8055_device {
+struct k8055_device {
/** Data last read from device, used by read_data(). */
unsigned char data_in[PACKET_LENGTH];
@@ -141,7 +141,7 @@ typedef struct k8055_device {
/** Underlying libusb handle to device. NULL if the device is not open. */
libusb_device_handle *device_handle;
-} k8055_device;
+};
/** Libusb context. */
static libusb_context* context = NULL;
@@ -392,7 +392,7 @@ int k8055_set_debounce_time(k8055_device* device, int counter, int debounce) {
return k8055_write_data(device);
}
-int k8055_get_all_input(k8055_device* device, int *bitmask, int *analog0, int *analog1, int *counter0, int *counter1, int quick) {
+int k8055_get_all_input(k8055_device* device, int *bitmask, int *analog0, int *analog1, int *counter0, int *counter1, bool quick) {
int cycles = 2;
if (quick) cycles = 1;
int r = read_data(device, cycles);
diff --git a/src/k8055.h b/src/k8055.h
index 9b29a29..d287098 100644
--- a/src/k8055.h
+++ b/src/k8055.h
@@ -29,6 +29,8 @@
#ifndef K8055_H_
#define K8055_H_
+#include <stdbool.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -123,7 +125,7 @@ int k8055_set_debounce_time(k8055_device*, int counter, int debounce);
* @return 0 on success
* @return K8055_ERROR_CLOSED if the given device is not open
* @return K8055_ERROR_READ if another error occurred during the read process */
-int k8055_get_all_input(k8055_device*, int *digitalBitmask, int *analog0, int *analog1, int *counter0, int *counter1, int quick);
+int k8055_get_all_input(k8055_device*, int *digitalBitmask, int *analog0, int *analog1, int *counter0, int *counter1, bool quick);
#ifdef __cplusplus
}