Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
ReinForce-II committed Aug 31, 2018
1 parent 6818442 commit a019cb9
Show file tree
Hide file tree
Showing 3 changed files with 256 additions and 283 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
BasedOnStyle: LLVM
TabWidth: '4'
UseTab: Always
UseTab: Never

...
56 changes: 28 additions & 28 deletions contrib/loaders/flash/hc32f00x/hc32f00x.s
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
***************************************************************************/

/***************************************************************************
* Modified at 2018 by Reinforce-II <[email protected]> *
* Modified at 2018 by Reinforce-II <[email protected]> *
***************************************************************************/


Expand All @@ -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
Loading

0 comments on commit a019cb9

Please sign in to comment.