neu-rah / ArduinoMenu

Arduino generic menu/interactivity system
GNU Lesser General Public License v2.1
931 stars 189 forks source link

KeyIn With STM32F103 #362

Open danielvilas opened 2 years ago

danielvilas commented 2 years ago

Hi,

I had a problem with the KeyIn code with STM32F103, PA0 pin number is 192, and thats doesn't fit well with int8_t, (max is 127)

keyMap encBtn_map[] = {{-PA0, defaultNavCodes[enterCmd].ch}}; //negative pin numbers use internal pull-up, this is on when low
keyIn<1> encButton(encBtn_map);   

My QuickNDirty Solution was to duplicate the files (keyMapDef.h and keyIn.h) in my local include files and change the int8_t to int32_t, like the framework for STM32 uses. But this problem could rise on other people.

Maybe the good solution could be to detect the architecture and use the best type.

regards