* This declares a typical AVR core, using constants what appears
* to be in every io*.h file...
*/
+#if FUSE_MEMORY_SIZE == 6
+# ifndef FUSE0_DEFAULT
+# define FUSE0_DEFAULT 0xFF
+# endif
+# ifndef FUSE1_DEFAULT
+# define FUSE1_DEFAULT 0xFF
+# endif
+# ifndef FUSE2_DEFAULT
+# define FUSE2_DEFAULT 0xFF
+# endif
+# ifndef FUSE3_DEFAULT
+# define FUSE3_DEFAULT 0xFF
+# endif
+# ifndef FUSE4_DEFAULT
+# define FUSE4_DEFAULT 0xFF
+# endif
+# ifndef FUSE5_DEFAULT
+# define FUSE5_DEFAULT 0xFF
+# endif
+
+# define _FUSE_HELPER { FUSE1_DEFAULT, FUSE1_DEFAULT, FUSE2_DEFAULT, \
+ FUSE3_DEFAULT, FUSE4_DEFAULT, FUSE5_DEFAULT }
+#elif FUSE_MEMORY_SIZE == 3
+# define _FUSE_HELPER { LFUSE_DEFAULT, HFUSE_DEFAULT, EFUSE_DEFAULT }
+#elif FUSE_MEMORY_SIZE == 2
+# define _FUSE_HELPER { LFUSE_DEFAULT, HFUSE_DEFAULT }
+#elif FUSE_MEMORY_SIZE == 1
+# define _FUSE_HELPER { FUSE_DEFAULT }
+#else
+# define _FUSE_HELPER { 0 }
+#endif
+
#ifdef SIGNATURE_0
#define DEFAULT_CORE(_vector_size) \
.ramend = RAMEND, \
.flashend = FLASHEND, \
.e2end = E2END, \
.vector_size = _vector_size, \
- .fuse = { LFUSE_DEFAULT, HFUSE_DEFAULT, EFUSE_DEFAULT }, \
+ .fuse = _FUSE_HELPER, \
.signature = { SIGNATURE_0,SIGNATURE_1,SIGNATURE_2 }
#else
// Disable signature when using an old avr toolchain
typedef void (*avr_run_t)(
struct avr_t * avr);
+#define AVR_FUSE_LOW 0
+#define AVR_FUSE_HIGH 1
+#define AVR_FUSE_EXT 2
+
/*
* Main AVR instance. Some of these fields are set by the AVR "Core" definition files
* the rest is runtime data (as little as possible)
uint32_t e2end;
uint8_t vector_size;
uint8_t signature[3];
- uint8_t fuse[4];
+ uint8_t fuse[6];
avr_io_addr_t rampz; // optional, only for ELPM/SPM on >64Kb cores
avr_io_addr_t eind; // optional, only for EIJMP/EICALL on >64Kb cores
uint8_t address_size; // 2, or 3 for cores >128KB in flash