projects
/
contrib
/
mraa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ee5e25
)
mraa.c: mraa_pin_mode_test should check against b->gpio_count -1
author
Brendan Le Foll
<brendan.le.foll@intel.com>
Thu, 18 Dec 2014 14:20:14 +0000
(14:20 +0000)
committer
Brendan Le Foll
<brendan.le.foll@intel.com>
Thu, 18 Dec 2014 14:28:36 +0000
(14:28 +0000)
It's already the case for rpi & MMAX but it should be noted that on 1 indexed
boards gpio_count should be +1
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
src/mraa.c
patch
|
blob
|
history
diff --git
a/src/mraa.c
b/src/mraa.c
index
765135d
..
70be118
100644
(file)
--- a/
src/mraa.c
+++ b/
src/mraa.c
@@
-228,7
+228,7
@@
mraa_pin_mode_test(int pin, mraa_pinmodes_t mode)
if (plat == NULL)
return 0;
}
- if (pin >
plat->phy_pin_count
|| pin < 0)
+ if (pin >
(plat->phy_pin_count -1)
|| pin < 0)
return 0;
switch(mode) {