-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6818442
commit a019cb9
Showing
3 changed files
with
256 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
BasedOnStyle: LLVM | ||
TabWidth: '4' | ||
UseTab: Always | ||
UseTab: Never | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* Modified at 2018 by Reinforce-II <[email protected]> * | ||
* Modified at 2018 by Reinforce-II <[email protected]> * | ||
***************************************************************************/ | ||
|
||
|
||
|
@@ -44,34 +44,34 @@ | |
.global _start | ||
_start: | ||
wait_fifo: | ||
ldr r6, [r2, #0] /* read wp */ | ||
cmp r6, #0 /* abort if wp == 0 */ | ||
beq exit | ||
ldr r5, [r2, #4] /* read rp */ | ||
cmp r5, r6 /* wait until rp != wp */ | ||
beq wait_fifo | ||
ldrb r6, [r5] /* "*target_address++ = *rp++" */ | ||
strb r6, [r4] | ||
adds r5, #1 | ||
adds r4, #1 | ||
ldr r6, [r2, #0] /* read wp */ | ||
cmp r6, #0 /* abort if wp == 0 */ | ||
beq exit | ||
ldr r5, [r2, #4] /* read rp */ | ||
cmp r5, r6 /* wait until rp != wp */ | ||
beq wait_fifo | ||
ldrb r6, [r5] /* "*target_address++ = *rp++" */ | ||
strb r6, [r4] | ||
adds r5, #1 | ||
adds r4, #1 | ||
busy: | ||
ldr r6, [r0, #0x20] /* wait until BUSY flag is reset */ | ||
movs r7, #0x10 | ||
tst r6, r7 | ||
bne busy | ||
cmp r5, r3 /* wrap rp at end of buffer */ | ||
bcc no_wrap | ||
mov r5, r2 | ||
adds r5, #8 | ||
ldr r6, [r0, #0x20] /* wait until BUSY flag is reset */ | ||
movs r7, #0x10 | ||
tst r6, r7 | ||
bne busy | ||
cmp r5, r3 /* wrap rp at end of buffer */ | ||
bcc no_wrap | ||
mov r5, r2 | ||
adds r5, #8 | ||
no_wrap: | ||
str r5, [r2, #4] /* store rp */ | ||
subs r1, r1, #1 /* decrement halfword count */ | ||
cmp r1, #0 | ||
beq exit /* loop if not done */ | ||
b wait_fifo | ||
str r5, [r2, #4] /* store rp */ | ||
subs r1, r1, #1 /* decrement halfword count */ | ||
cmp r1, #0 | ||
beq exit /* loop if not done */ | ||
b wait_fifo | ||
error: | ||
movs r0, #0 | ||
str r0, [r2, #4] /* set rp = 0 on error */ | ||
movs r0, #0 | ||
str r0, [r2, #4] /* set rp = 0 on error */ | ||
exit: | ||
mov r0, r6 /* return status in r0 */ | ||
bkpt #0 | ||
mov r0, r6 /* return status in r0 */ | ||
bkpt #0 |
Oops, something went wrong.