mraa.c: mraa_pin_mode_test should check against b->gpio_count -1
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>
This commit is contained in:
@@ -228,7 +228,7 @@ mraa_pin_mode_test(int pin, mraa_pinmodes_t mode)
|
|||||||
if (plat == NULL)
|
if (plat == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (pin > plat->phy_pin_count || pin < 0)
|
if (pin > (plat->phy_pin_count -1) || pin < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
switch(mode) {
|
switch(mode) {
|
||||||
|
|||||||
Reference in New Issue
Block a user