X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/4bc81323e51ac138e733c14eeb6f283ae706e904..aca998c354db4006fd821a47b09e55775c61371d:/z180/fifoio.180 diff --git a/z180/fifoio.180 b/z180/fifoio.180 index 27745d4..cbcece9 100644 --- a/z180/fifoio.180 +++ b/z180/fifoio.180 @@ -1,6 +1,9 @@ page 255 .z80 - + +; +; FIFO channels for communication with stm32 +; global f.init,f.in,f.out,f.i.st extrn buf.init @@ -12,21 +15,19 @@ ;-------------------------------------------------------------- dseg - - mkbuf rx.buf,rx.buf_len - mkbuf tx.buf,tx.buf_len + + mkbuf ci.fifo_id, rx.buf,rx.buf_len + mkbuf co.fifo_id, tx.buf,tx.buf_len ;-------------------------------------------------------------- cseg -; -; FIFO channels for communication with stm32 -; + ; Init Serial I/O for console input and output ; - + f.init: ld ix,rx.buf ld a,rx.buf.mask @@ -47,7 +48,7 @@ buf.empty: ret z or 0ffh ret - + f.in: push ix @@ -68,12 +69,12 @@ bg.wait: inc h bg.nc: ld l,(hl) - + ld a,(ix+o.out_idx) ; inc a and (ix+o.mask) ld (ix+o.out_idx),a - + ld a,l pop hl pop ix @@ -117,7 +118,7 @@ bp.wait: jr z,bp.wait ld (hl),b ld (ix+o.in_idx),a - + ld a,b pop bc pop hl @@ -125,4 +126,3 @@ bp.wait: ret end -