Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library doesn't compile on Mega board #5

Open
vossilius opened this issue Dec 5, 2016 · 2 comments
Open

Library doesn't compile on Mega board #5

vossilius opened this issue Dec 5, 2016 · 2 comments

Comments

@vossilius
Copy link

Hi,

thanks for sharing the library. However, I get error trying to compile the example.

Arduino: 1.6.12 (Mac OS X), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
In file included from /[...]/ArduinoBoardManager.h:140:31: error: '__AVR_ATmega1280__' was not declared in this scope
   static const uint16_t CPU = __AVR_ATmega1280__;
                               ^exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

I get the error with my Arduino Mega 2560 as well as Controllino (which is based on Arduino Mega). Any thoughts?

Thanks!

@billsewell
Copy link

There is a bug in ArduinoBoardManager.h
It will not compile for ATmega2560 because ATmega1280 and ATmega2560
are combined in the same #elif defined section and when ATmega2560 is defined,
the code attempts to assign the undefined symbol AVR_ATmega1280 to CPU which
causes a compile time error.

The solution is to break the #elif defined section into two sections, one for AVR_ATmega1280
and one for AVR_ATmega2560 and change the CPU assignment in the AVR_ATmega2560 define to
CPU = AVR_ATmega2560

@DeanBilotti
Copy link

I have submitted a pull request with a fix for this and some other issues: #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants