Browse Source

stdio: fix broken ReadC logic

Looping inside ReadC broke the shell's hook logic. We have to
return immediately when nothing is typed.
pull/10/head
Virgil Dupras 5 years ago
parent
commit
23354eba94
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      kernel/stdio.asm

+ 4
- 1
kernel/stdio.asm View File

@@ -112,11 +112,14 @@ printHexPair:
;
; This routine also takes care of echoing received characters back to the TTY.
;
; This routine doesn't wait after a typed char. If nothing is typed, we return
; immediately with Z flag unset.
;
; Note that this routine doesn't bother returning the typed character.
stdioReadC:
; Let's wait until something is typed.
call stdioGetC
jr nz, stdioReadC ; nothing typed? loop
ret nz ; nothing typed? nothing to do
; got it. Now, is it a CR or LF?
cp ASCII_CR
jr z, .complete ; char is CR? buffer complete!


Loading…
Cancel
Save