#ifndef CONFIG_H_
#define CONFIG_H_

#include <inttypes.h>

//Select one MCU

//For 328pb 
#ifdef _CPU_ATMEGA328PB_

	#define PAGE_SIZE 128UL	
	#define PAGE_SIZE_BIT 7

	//DONT FORGET TO CHANGE LINKER OPTIONS!!!!
	#define locationInBoot (0x3FE8UL)	//CAREFUL ONLY 48 byte in size for data
	#define locationInApp  (0x37C0UL)

	//FUSES
	#define F_Low	0xE0
	#define F_Ext	0xFC

	#ifdef DEBUG
		#define F_High	0xD0	//Allow DebugWIRE + EEPROM save 
		#define F_Lock	0xFF	//Disable LOCKS
	#else
		#define F_High	0xC8	//No DEBUG thing + No EEPROM save
		#define F_Lock	0xCC
	#endif

	#define SRAM_size 2048UL

#endif

//For 2560
#ifdef _CPU_ATMEGA2560_

	#define _LONG_ADDR_SPACE_ 
	#define _FAT_CRC_

	#define PAGE_SIZE	256ULL 
	#define PAGE_SIZE_BIT 8

	//Settings in the linker
	#define locationInBoot (0x1FF80ULL)
	#define locationInApp  (0x1EF80ULL)

	//FUSES
	#define F_Low	0xE0
	#define F_Ext	0xFC

	#ifdef DEBUG
		#define F_High	0x00	//Enable JTAG and OCD + EEPROM save
		#define F_Lock	0xFF	//Disable LOCKS
	#else
		#define F_High	0xC8	//No DEBUG thing + No EEPROM save
		#define F_Lock	0xCC
	#endif


	#define SRAM_size 8192UL

#endif

//COMMON Define
#define PAGE_COUNT  (((locationInApp<<1)/PAGE_SIZE)+1)

#endif /* CONFIG_H_ */