2006-05-19 21:00:23 +02:00
|
|
|
#ifndef CHIPDEF_H
|
|
|
|
#define CHIPDEF_H
|
|
|
|
|
|
|
|
#include <avr/io.h>
|
|
|
|
|
2006-05-19 21:52:00 +02:00
|
|
|
#if defined (SPMCSR)
|
|
|
|
#define SPM_REG SPMCSR
|
|
|
|
#elif defined (SPMCR)
|
|
|
|
#define SPM_REG SPMCR
|
|
|
|
#else
|
|
|
|
#error "AVR processor does not provide bootloader support!"
|
|
|
|
#endif
|
|
|
|
|
2006-05-19 21:52:42 +02:00
|
|
|
#define APP_END (FLASHEND - (BOOTSIZE * 2))
|
2006-05-19 21:00:23 +02:00
|
|
|
|
2006-05-20 00:06:27 +02:00
|
|
|
#if (SPM_PAGESIZE > UINT8_MAX)
|
|
|
|
typedef uint16_t pagebuf_t;
|
|
|
|
#else
|
|
|
|
typedef uint8_t pagebuf_t;
|
|
|
|
#endif
|
|
|
|
|
2006-05-19 21:00:23 +02:00
|
|
|
#if defined(__AVR_ATmega169__)
|
2006-05-19 21:52:42 +02:00
|
|
|
#include "mega169.h"
|
2006-05-19 21:00:23 +02:00
|
|
|
|
|
|
|
#elif defined(__AVR_ATmega16__)
|
2006-05-19 21:52:42 +02:00
|
|
|
#include "mega16.h"
|
2006-05-19 21:00:23 +02:00
|
|
|
|
|
|
|
#elif defined(__AVR_ATmega8__)
|
2006-05-19 21:52:42 +02:00
|
|
|
#include "mega8.h"
|
2006-05-19 21:00:23 +02:00
|
|
|
|
|
|
|
#elif defined(__AVR_ATmega32__)
|
2006-05-19 21:52:42 +02:00
|
|
|
#include "mega32.h"
|
2006-05-19 21:00:23 +02:00
|
|
|
|
|
|
|
#elif defined(__AVR_ATmega128__)
|
2006-05-19 21:52:42 +02:00
|
|
|
#include "mega128.h"
|
2006-05-19 21:00:23 +02:00
|
|
|
|
|
|
|
#elif defined(__AVR_AT90CAN128__)
|
2006-05-19 21:52:42 +02:00
|
|
|
#include "mega128can.h"
|
2006-05-19 21:00:23 +02:00
|
|
|
|
|
|
|
#else
|
2006-05-19 21:52:42 +02:00
|
|
|
#error "no definition for MCU available in chipdef.h"
|
2006-05-19 21:00:23 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|