avr: added RingBufferY_PeekByte
This commit is contained in:
@@ -52,9 +52,9 @@ RingBufferY_WriteByte:
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @macro m_ringbuffer_y_readbyte
|
||||
; @routine RingBufferY_ReadByte
|
||||
;
|
||||
; @param Y base address of ringbuffer struct
|
||||
; @param Y base address of ringbuffer struct
|
||||
; @return CFLAG set if okay, cleared on error (i.e. buffer empty)
|
||||
; @return R16 byte read
|
||||
; @clobbers R17, R18, X
|
||||
@@ -71,6 +71,31 @@ RingBufferY_ReadByte:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine RingBufferY_PeekByte
|
||||
;
|
||||
; @param Y base address (for "LDD Y+nn" and "STD Y+nn")
|
||||
; @param %0 offset to Y to access maxBytes variable (for "LDD Y+nn" and "STD Y+nn")
|
||||
; @param %1 offset to Y to access usedBytes
|
||||
; @param %2 offset to Y to access readPos variable
|
||||
; @param %3 offset to Y to access writePos variable
|
||||
; @param %4 offset to Y to access buffer
|
||||
; @return CFLAG set if okay, cleared on error (i.e. buffer empty)
|
||||
; @return R16 byte read
|
||||
; @clobbers R17, R18, X
|
||||
|
||||
RingBufferY_PeekByte:
|
||||
m_ringbuffer_y_peekbyte \
|
||||
RINGBUFFERY_OFFS_MAXSIZE, \
|
||||
RINGBUFFERY_OFFS_USED, \
|
||||
RINGBUFFERY_OFFS_READPOS, \
|
||||
RINGBUFFERY_OFFS_WRITEPOS, \
|
||||
RINGBUFFERY_OFFS_DATA
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @macro m_ringbuffer_y_reset
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user