Private
Public Access
2
0

aio: Change mraa_aio_read to use int and return -1

This commit changes also the _replace function and adds exceptions to the C++
API for errors in AIO read

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2016-04-22 11:57:18 +01:00
parent e961558fd2
commit 0b74aa68ab
5 changed files with 27 additions and 14 deletions

View File

@@ -340,12 +340,12 @@ mraa_firmata_i2c_stop(mraa_i2c_context dev)
return MRAA_SUCCESS;
}
static unsigned int
static int
mraa_firmata_aio_read(mraa_aio_context dev)
{
// careful, whilst you need to enable '0' for A0 you then need to read 14
// in t_firmata because well that makes sense doesn't it...
return (unsigned int) firmata_dev->pins[dev->channel].value;
return (int) firmata_dev->pins[dev->channel].value;
}
static mraa_result_t