eclipse/upm

problem in button_context - gpio_pin defined as uint8_t in button.h

BinduRao2018 opened this issue · 2 comments

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 'uint8_t', 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'?

Good catch, this was supposed to go in b367a63 but it was missed.

Fixed with 07a9af0. Thanks!