Line 1017 in bma2x2.c writes 4 bytes to a one byte pointer, overwriting my stack.
I have attached a new version that fixes the problem.
And I changed other places where the #define for SHIFT was misused, but luckily causes no issue.
Thank you, i report this to our API team.
They will look into the code and your fix to see if we are able to merge your fix into next API release on Github.