From f1858778605a84d59d75b4b162412ce6ab23f4f1 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Tue, 13 May 2014 22:25:21 +0000 Subject: [PATCH] aio: remove _u16 suffix from call. Make return type a uint16_t Signed-off-by: Brendan Le Foll --- api/aio.h | 3 ++- examples/analogin_a0.c | 4 ++-- src/aio/aio.c | 4 ++-- src/maa.i | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/api/aio.h b/api/aio.h index 33eebba..7250c62 100644 --- a/api/aio.h +++ b/api/aio.h @@ -35,6 +35,7 @@ extern "C" { #include #include +#include #include "maa.h" #include "gpio.h" @@ -65,7 +66,7 @@ maa_aio_context* maa_aio_init(unsigned int aio_channel); * @returns 16-bit unsigned integer representing the current input voltage, * normalised to a 16-bit value */ -unsigned int maa_aio_read_u16(maa_aio_context* dev); +uint16_t maa_aio_read(maa_aio_context* dev); /** Close the analog input context * - Will free the memory for the context. diff --git a/examples/analogin_a0.c b/examples/analogin_a0.c index 4954a88..fd8d45b 100644 --- a/examples/analogin_a0.c +++ b/examples/analogin_a0.c @@ -30,7 +30,7 @@ int main () { maa_init(); maa_aio_context* adc_a0; - unsigned int adc_value = 0; + uint16_t adc_value = 0; adc_a0 = maa_aio_init(0); if (adc_a0 == NULL) { @@ -38,7 +38,7 @@ int main () } for(;;) { - adc_value = maa_aio_read_u16(adc_a0); + adc_value = maa_aio_read(adc_a0); fprintf(stdout, "ADC A0 read %X - %d\n", adc_value, adc_value); } diff --git a/src/aio/aio.c b/src/aio/aio.c index d81dc4f..9fc99a1 100644 --- a/src/aio/aio.c +++ b/src/aio/aio.c @@ -99,10 +99,10 @@ maa_aio_context* maa_aio_init(unsigned int aio_channel) * maa_aio_init() * * @returns - * 16-bit unsigned int representing the current input voltage, normalised to + * unsigned 16 bit int representing the current input voltage, normalised to * a 16-bit value */ -unsigned int maa_aio_read_u16(maa_aio_context* dev) +uint16_t maa_aio_read(maa_aio_context* dev) { char buffer[16]; unsigned int analog_value = 0; diff --git a/src/maa.i b/src/maa.i index c3acccc..8e4b383 100644 --- a/src/maa.i +++ b/src/maa.i @@ -289,6 +289,6 @@ typedef struct { } unsigned int read() { - return maa_aio_read_u16($self); + return maa_aio_read($self); } }