BUG: fix __do_spm_Ex (spminterface.h) on architecture avr51 (atmega1284p)
authorStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Tue, 13 Nov 2012 16:58:25 +0000 (17:58 +0100)
committerStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Wed, 14 Nov 2012 20:54:33 +0000 (20:54 +0000)
Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
firmware/spminterface.h

index 544aceb..e0aa6c8 100644 (file)
@@ -164,17 +164,17 @@ ret
     "mov r0, %A[data]\n\t"                                                                     \
                                                                                                \
     /* finally call the bootloader-function */                                                 \
-    "icall\n\r"                                                                                        \
+    "icall\n\t"                                                                                        \
                                                                                                \
     "pop  r1\n\t"                                                                              \
     "pop  r0\n\t"                                                                              \
                                                                                                \
     :                                                                                          \
     : [flashaddress] "r" (flash_wordaddress),                                                  \
-      [spmfunctionaddress] "z" (___bootloader__do_spm__ptr),                                   \
+      [spmfunctionaddress] "z" ((uint16_t)(___bootloader__do_spm__ptr)),                       \
       [spmcrval] "r" (spmcrval),                                                               \
       [data] "r" (dataword)                                                                    \
-    : "r0","r1","r11","r12","r13","r18"                                                                \
+    : "r0","r1","r11","r12","r13","r18"                                                        \
     );                                                                                         \
 })