I work with CAN-bus technology and utilize the ATmega328, 1284 & 2560 in my prototyping and projects.
I would like to be able to re-write this file to allow for each of the 3 chips' pin defines. As it currently stands, if I'm working with say the 328 and the 2560 at the same time I'm having to quit the Arduino IDE, copy or rename the defaults.h for one type, copy or rename the defaults.h for the other into its place, launch the Arduino IDE, compile and upload, then do it again for the other type.
This is tedious.
I'm looking for a way to write the defaults.h file so the IDE can do a check for the appropriate type and utilize the matching #define.
How do I do this?
I'm utilizing the Spark Fun CAN-Bus library.
defaults.h for 328:
#ifndef DEFAULTS_H
#define DEFAULTS_H
#define P_MOSI B,3
#define P_MISO B,4
#define P_SCK B,5
//#define MCP2515_CS D,3 // Rev A
#define MCP2515_CS B,2 // Rev B
#define MCP2515_INT D,2
#define LED2_HIGH B,0
#define LED2_LOW B,0
#endif // DEFAULTS_H
defaults.h for 2560:
#ifndef DEFAULTS_H
#define DEFAULTS_H
#define P_MOSI B,2
#define P_MISO B,3
#define P_SCK B,1
//#define MCP2515_CS D,3 // Rev A
#define MCP2515_CS B,0 // Rev B
#define MCP2515_INT D,0
#define LED2_HIGH B,0
#define LED2_LOW B,0
#endif // DEFAULTS_H