abcminiuser / lufa

LUFA - the Lightweight USB Framework for AVRs.
http://www.lufa-lib.org
1.03k stars 321 forks source link

ISR() macros of LUFA and ASF interfering #124

Open laid opened 6 years ago

laid commented 6 years ago

There is a problem with ASF and LUFA fighting for what the ISR() has to be. Both actually end up defining the same thing at the end, but ASF does it using ISR macro with 3 parameters (out of which 2 are not used ...).

laid commented 6 years ago

My current workaround is to modify the asf.h file each time it is generated and insert

#undef ISR

right before LUFA include files are loaded. Like:

...
// From module: Interrupt management - UC3 implementation
#include <interrupt.h>

#undef ISR

// From module: LUFA Common Infrastructure
#include <LUFA/Common/Common.h>
#include <LUFA/Version.h>
...
...

This allows LUFA and ASF co-exist. (I am using only ISR() macro from LUFA, so I have not tested if any of the interrupt-driven ASF component fails on that or not)