UPM is a high level repository that provides software drivers for a wide variety of commonly used sensors and actuators. These software drivers interact with the underlying hardware platform through calls to MRAA APIs.
MIT License
661
stars
410
forks
source link
problem in button_context - gpio_pin defined as uint8_t in button.h #664
I am using Grove PI board connected to UP-Squared board. To test Grove button, I used button APIs from button.h available on UPM (v1.6.0). The Grove button doesn't work.
I see that in 'button_context', gpio_pin is declared as '_uint8t', which results in a problem when an offset of 512 is added along with the digital pin number to initialize gpio in button_init().
ie. For a Grove button connected to digital pin 7, mraa_gpio_init() call is made with the value set to 7 instead of 519 due to overflow.
I am using Grove PI board connected to UP-Squared board. To test Grove button, I used button APIs from button.h available on UPM (v1.6.0). The Grove button doesn't work. I see that in 'button_context', gpio_pin is declared as '_uint8t', which results in a problem when an offset of 512 is added along with the digital pin number to initialize gpio in button_init().
ie. For a Grove button connected to digital pin 7, mraa_gpio_init() call is made with the value set to 7 instead of 519 due to overflow.
Shouldn't this be declared as 'int'?