Import Tim's version

This commit is contained in:
timschuerewegen 2021-04-16 22:46:08 -06:00 committed by Konrad Beckmann
parent e1143f9e5b
commit 905ed60d44
1 changed files with 45 additions and 15 deletions

View File

@ -1,3 +1,5 @@
.syntax unified
.section .text .section .text
.global _start .global _start
@ -44,23 +46,51 @@ foo:
nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
// __disable_interrupt();
CPSID I
// LTDC_Layer1->CR = 0; // disable layer
// LTDC_Layer1->DCCR = 0xFF0000FF; // blue
LDR R0, =0x50001084
MOVS R1, #0
STR R1, [R0, #0x00]
LDR R1, =0xFF0000FF
STR R1, [R0, #0x18]
mov r2, #0 // LTDC_Layer2->CR = 0; // disable layer
mov r4, #4 LDR R0, =0x50001104
loop: MOVS R1, #0
ldr r0, src STR R1, [R0, #0x00]
ldr r1, dst
add r0, r0, r2 // LTDC->SRCR = 1; // reload shadow registers now
add r1, r1, r2 // LTDC->BCCR = 0x000000; // black
LDR R0, =0x50001000
MOVS R1, #1
STR R1, [R0, #0x24]
MOVS R1, #0
STR R1, [R0, #0x2C]
ldr r3, [r0] // uint32_t *src = (uint32_t*)0x08000000;
str r3, [r1] // uint32_t *dst = (uint32_t*)0x24000000;
// for (int len = 0; len < 0x20000 / 4; len++)
// {
// *dst++ = *src++;
// }
MOV R0, #0x08000000
MOV R1, #0x24000000
MOV R2, #0x8000
loop1:
LDR R3, [R0], #4
STR R3, [R1], #4
SUBS R2, R2, #1
BNE loop1
add r2, r2, r4 // while (1)
// {
b loop // WWDG1->CR = 0x69;
// }
src: .long 0x08000000 LDR R0, =0x50003000
dst: .long 0x24000000 MOVS R1, #0x69
loop2:
STR R1, [R0, #0x00]
B loop2