FreeCalypso > hg > freecalypso-sw
comparison target-utils/libcommon/serio.S @ 393:d7591faa1258
target-utils serial I/O made consistent with other projects
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Wed, 11 Jun 2014 17:22:55 +0000 |
parents | 40f607bb0a2c |
children |
comparison
equal
deleted
inserted
replaced
392:134c047c1269 | 393:d7591faa1258 |
---|---|
18 serial_in_poll: | 18 serial_in_poll: |
19 ldr r1, =uart_base | 19 ldr r1, =uart_base |
20 ldr r2, [r1] | 20 ldr r2, [r1] |
21 ldrb r3, [r2, #NS16550_LSR] | 21 ldrb r3, [r2, #NS16550_LSR] |
22 tst r3, #NS16550_LSR_DR | 22 tst r3, #NS16550_LSR_DR |
23 mvneq r0, #1 | 23 ldrneb r0, [r2, #NS16550_RBR] |
24 bxeq lr | 24 mvneq r0, #0 |
25 ldrb r0, [r2, #NS16550_RBR] | |
26 bx lr | 25 bx lr |
26 | |
27 .global serial_flush | |
28 serial_flush: | |
29 ldr r1, =uart_base | |
30 ldr r2, [r1] | |
31 1: ldrb r3, [r2, #NS16550_LSR] | |
32 tst r3, #NS16550_LSR_TEMP | |
33 beq 1b | |
34 bx lr |