extend "spminterface.h" for support of ATmega328 and ATmega328p
authorStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Tue, 2 Oct 2012 19:20:36 +0000 (21:20 +0200)
committerStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Tue, 2 Oct 2012 22:08:20 +0000 (22:08 +0000)
Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
firmware/spminterface.h

index 8640832..9195100 100644 (file)
@@ -118,6 +118,8 @@ ret
       #define  funcaddr___bootloader__do_spm 0x3868
     #elif defined (__AVR_ATmega324A__) || defined (__AVR_ATmega324P__) || defined (__AVR_ATmega324PA__)
       #define  funcaddr___bootloader__do_spm 0x707c
       #define  funcaddr___bootloader__do_spm 0x3868
     #elif defined (__AVR_ATmega324A__) || defined (__AVR_ATmega324P__) || defined (__AVR_ATmega324PA__)
       #define  funcaddr___bootloader__do_spm 0x707c
+    #elif defined (__AVR_ATmega328__) || defined (__AVR_ATmega328P__)
+      #define  funcaddr___bootloader__do_spm 0x7068
     #elif defined (__AVR_ATmega644__) || defined (__AVR_ATmega644A__) || defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644PA__)
       #define  funcaddr___bootloader__do_spm 0xe07c
     #elif defined (__AVR_ATmega1284__) || defined (__AVR_ATmega1284P__)
     #elif defined (__AVR_ATmega644__) || defined (__AVR_ATmega644A__) || defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644PA__)
       #define  funcaddr___bootloader__do_spm 0xe07c
     #elif defined (__AVR_ATmega1284__) || defined (__AVR_ATmega1284P__)
@@ -292,13 +294,17 @@ const uint16_t bootloader__do_spm[17] BOOTLIBLINK = {0x0000, 0x2dec, 0x2dfd, 0xb
   #if (BOOTLOADER_ADDRESS != 0x3800)
     #error BOOTLOADER_ADDRESS!=0x3800, on current MCU "funcaddr___bootloader__do_spm" might be currupted - please edit spminterface.h for nonstandard use
   #endif
   #if (BOOTLOADER_ADDRESS != 0x3800)
     #error BOOTLOADER_ADDRESS!=0x3800, on current MCU "funcaddr___bootloader__do_spm" might be currupted - please edit spminterface.h for nonstandard use
   #endif
+#elif defined (__AVR_ATmega328__) || defined (__AVR_ATmega328P__)
+  #if (BOOTLOADER_ADDRESS != 0x7000)
+    #error BOOTLOADER_ADDRESS!=0x7000, on current MCU "funcaddr___bootloader__do_spm" might be currupted - please edit spminterface.h for nonstandard use
+  #endif
 #else
   #error undefined device selection - this should not happen! 
 #endif
 
 //assume  SPMCR:=SPMCSR==0x37, SPMEN:=SELFPRGEN==0x0, RWWSRE=0x4, RWWSB=0x6
 const uint16_t bootloader__do_spm[17] BOOTLIBLINK = {0x0000, 0x2dec, 0x2dfd, 0xb6b7, 0xfcb0, 0xcffd, 0xbf27, 0x95e8, 0xb6b7,
 #else
   #error undefined device selection - this should not happen! 
 #endif
 
 //assume  SPMCR:=SPMCSR==0x37, SPMEN:=SELFPRGEN==0x0, RWWSRE=0x4, RWWSB=0x6
 const uint16_t bootloader__do_spm[17] BOOTLIBLINK = {0x0000, 0x2dec, 0x2dfd, 0xb6b7, 0xfcb0, 0xcffd, 0xbf27, 0x95e8, 0xb6b7,
-                                                    0xfcb0, 0xcffd, 0xe121, 0xb6b7, 0xfcb6, 0xcff4, 0x9508, 0xFFFF};
+                                                     0xfcb0, 0xcffd, 0xe121, 0xb6b7, 0xfcb6, 0xcff4, 0x9508, 0xFFFF};
 /*
 00001826 <bootloader__do_spm>:
     1826:      00 00           nop
 /*
 00001826 <bootloader__do_spm>:
     1826:      00 00           nop