Sorry if this has already been answered. I haven't had success searching on the forums except for this thread https://www.avrfreaks.net/forum/avr-gcc-register-usage-changeable?skey=calling%20convention but seeing that it was a long time ago I am wondering if this is a possibility now with the latest version of avr-gcc.
Basically I am coding in C using Atmel Studio + avr-gcc + libc.
I also have a library which was written using the IAR compiler which I am linking to. It is a pre-compiled library from a vendor, modifying the code is not an option.
I realised after futile attempts to call the IAR compiled functions from my avr-gcc code that avr-gcc and IAR use different function calling conventions (different set of registers for the function arguments and return value).
Is there a way to customise the calling convention at the avr-gcc side, like specifying which registers I want to use? Or is this IAR library basically unusable? For some reason, coding my main application for IAR is not an option.
Thanks in advance!!!