Private
Public Access
2
0

aio: remove _u16 suffix from call. Make return type a uint16_t

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-05-13 22:25:21 +00:00
parent 9eb87fc665
commit f185877860
4 changed files with 7 additions and 6 deletions

View File

@@ -35,6 +35,7 @@ extern "C" {
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <stdint.h>
#include "maa.h" #include "maa.h"
#include "gpio.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, * @returns 16-bit unsigned integer representing the current input voltage,
* normalised to a 16-bit value * 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 /** Close the analog input context
* - Will free the memory for the context. * - Will free the memory for the context.

View File

@@ -30,7 +30,7 @@ int main ()
{ {
maa_init(); maa_init();
maa_aio_context* adc_a0; maa_aio_context* adc_a0;
unsigned int adc_value = 0; uint16_t adc_value = 0;
adc_a0 = maa_aio_init(0); adc_a0 = maa_aio_init(0);
if (adc_a0 == NULL) { if (adc_a0 == NULL) {
@@ -38,7 +38,7 @@ int main ()
} }
for(;;) { 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); fprintf(stdout, "ADC A0 read %X - %d\n", adc_value, adc_value);
} }

View File

@@ -99,10 +99,10 @@ maa_aio_context* maa_aio_init(unsigned int aio_channel)
* maa_aio_init() * maa_aio_init()
* *
* @returns * @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 * 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]; char buffer[16];
unsigned int analog_value = 0; unsigned int analog_value = 0;

View File

@@ -289,6 +289,6 @@ typedef struct {
} }
unsigned int read() unsigned int read()
{ {
return maa_aio_read_u16($self); return maa_aio_read($self);
} }
} }