Ringbuffer: clear first byte.

This commit is contained in:
Martin Preuss
2023-01-19 22:08:03 +01:00
parent cde7e4bb74
commit 4e310e82d9

View File

@@ -63,6 +63,17 @@ RingBuffer_Alloc:
RingBuffer_Alloc_l1: RingBuffer_Alloc_l1:
std y+RINGBUFFER_OFFS_WRITEPOS, r19 std y+RINGBUFFER_OFFS_WRITEPOS, r19
mov r16, r20 mov r16, r20
; preset first byte (this is the length byte in COM module) with 0
push yl
push yh
clr r17
add yl, r16
adc yh, r17
st y+RINGBUFFER_OFFS_DATA, r17
pop yh
pop yl
out SREG, r21 ; restore global interrupt enable bit in SREG out SREG, r21 ; restore global interrupt enable bit in SREG
sec sec
ret ret