⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.h

📁 AVR_butterfly_BOOT是AVR单片机的BOOT程序
💻 H
字号:
// mt: removed all definitions but mega169
//  added mega16 since mega169 is not supported by AVRPROG V1.37

#if defined(_ATMEGA169)
  #define sig_byte3 0x1E
  #define sig_byte2 0x94
  #define sig_byte1 0x05
  
  #define devtype 0x79       // Mega 169 device code
  
  #define PAGESIZE 128       // Size in Bytes
  
  #ifdef _B128
    #define APP_PAGES ((2*8192 / PAGESIZE)- (2*128 / PAGESIZE )) 
    #define APP_END APP_PAGES * PAGESIZE 
  #endif
  #ifdef _B256
    #define APP_PAGES ((2*8192 / PAGESIZE)- (2*256 / PAGESIZE )) 
    #define APP_END APP_PAGES * PAGESIZE 
  #endif
  #ifdef _B512
    #define APP_PAGES ((2*8192 / PAGESIZE)- (2*512 / PAGESIZE )) 
    #define APP_END APP_PAGES * PAGESIZE 
  #endif
   #ifdef _B1024
    #define APP_PAGES ((2*8192 / PAGESIZE)- (2*1024 / PAGESIZE )) 
    #define APP_END APP_PAGES * PAGESIZE 
  #endif  

// ATmega16 added by mt
#elif defined(_ATMEGA16)
  #define sig_byte3 0x1E
  #define sig_byte2 0x94
  #define sig_byte1 0x03
  
  #define devtype 0x75       // Mega16 device code
  
  #define PAGESIZE 128       // Size in Bytes
  
  #ifdef _B128
    #define APP_PAGES ((2*8192 / PAGESIZE)- (2*128 / PAGESIZE )) 
    #define APP_END APP_PAGES * PAGESIZE 
  #endif
  #ifdef _B256
    #define APP_PAGES ((2*8192 / PAGESIZE)- (2*256 / PAGESIZE )) 
    #define APP_END APP_PAGES * PAGESIZE 
  #endif
  #ifdef _B512
    #define APP_PAGES ((2*8192 / PAGESIZE)- (2*512 / PAGESIZE )) 
    #define APP_END APP_PAGES * PAGESIZE 
  #endif
   #ifdef _B1024
    #define APP_PAGES ((2*8192 / PAGESIZE)- (2*1024 / PAGESIZE )) 
    #define APP_END APP_PAGES * PAGESIZE 
  #endif  
#else
#error "unsupported"
#endif


#define UART_RX_BUFFER_SIZE PAGESIZE

#define TRUE    1
#define FALSE   0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -