Skip to content

Commit

Permalink
!8 Fix-gcc环境下的asm关键字问题
Browse files Browse the repository at this point in the history
Merge pull request !8 from ChenxuLu/Fix
  • Loading branch information
wendal authored and gitee-org committed Aug 31, 2023
2 parents 6ae28b7 + 6f0fb9b commit 1ff34ae
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions Libraries/AIR32F10xLib/src/air32f10x_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,25 +650,25 @@ __STATIC_INLINE void SetStrt(void)
#elif defined(__GNUC__)
void SetStrt(void)
{
asm("MOV R0, PC");
asm("LDR R1, [R0,#16]");
asm("LDR R1, [R0,#32]");
asm("LDR R0, =0x40022010");
asm("LDR R1, =0x60");
asm("STR R1,[R0]");
asm("NOP");
asm("NOP");
asm("NOP");
asm("NOP");
asm("NOP");
asm("NOP");
asm("FLAGLABLE:");
asm("LDR R1, =0x4002200C");
asm("LDR R2, [R1]");
asm("AND R2, #0x01");
asm("CMP R2, #0x00");
asm("BNE FLAGLABLE");
asm("BX lr");
__asm("MOV R0, PC");
__asm("LDR R1, [R0,#16]");
__asm("LDR R1, [R0,#32]");
__asm("LDR R0, =0x40022010");
__asm("LDR R1, =0x60");
__asm("STR R1,[R0]");
__asm("NOP");
__asm("NOP");
__asm("NOP");
__asm("NOP");
__asm("NOP");
__asm("NOP");
__asm("FLAGLABLE:");
__asm("LDR R1, =0x4002200C");
__asm("LDR R2, [R1]");
__asm("AND R2, #0x01");
__asm("CMP R2, #0x00");
__asm("BNE FLAGLABLE");
__asm("BX lr");
}

#endif
Expand Down

0 comments on commit 1ff34ae

Please sign in to comment.