AVR Bootloader (avrboot cleanup)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.0KB

  1. #ifndef CHIPDEF_H
  2. #define CHIPDEF_H
  3. #include <avr/io.h>
  4. #if defined (SPMCSR)
  5. #define SPM_REG SPMCSR
  6. #elif defined (SPMCR)
  7. #define SPM_REG SPMCR
  8. #else
  9. #error "AVR processor does not provide bootloader support!"
  10. #endif
  11. #define APP_END (FLASHEND - (BOOTSIZE * 2))
  12. #if (SPM_PAGESIZE > UINT8_MAX)
  13. typedef uint16_t pagebuf_t;
  14. #else
  15. typedef uint8_t pagebuf_t;
  16. #endif
  17. #if defined(__AVR_ATmega169__)
  18. #include "mega169.h"
  19. #elif defined(__AVR_ATmega16__)
  20. #include "mega16.h"
  21. #elif defined(__AVR_ATmega162__)
  22. #include "mega162.h"
  23. #elif defined(__AVR_ATmega8__)
  24. #include "mega8.h"
  25. #elif defined(__AVR_ATmega32__)
  26. #include "mega32.h"
  27. #elif defined(__AVR_ATmega324P__)
  28. #include "mega324p.h"
  29. #elif defined(__AVR_ATmega64__)
  30. #include "mega64.h"
  31. #elif defined(__AVR_ATmega644__)
  32. #include "mega644.h"
  33. #elif defined(__AVR_ATmega644P__)
  34. #include "mega644p.h"
  35. #elif defined(__AVR_ATmega128__)
  36. #include "mega128.h"
  37. #elif defined(__AVR_AT90CAN128__)
  38. #include "mega128can.h"
  39. #else
  40. #error "no definition for MCU available in chipdef.h"
  41. #endif
  42. #endif