avr: cleanup, added labels to calculate module sizes.

This commit is contained in:
Martin Preuss
2023-04-08 18:18:19 +02:00
parent 4a915a3c85
commit 0f678d7d5a
21 changed files with 416 additions and 167 deletions

View File

@@ -15,6 +15,35 @@
.cseg
COM_BUFFER_BEGIN:
; ---------------------------------------------------------------------------
; COM_AllocBufferAndGetXY
;
; IN:
; - nothing
; OUT:
; - CFLAG: set if okay, clear otherwise
; - Y: pointer to buffer
; - X: pointer to data portion of the buffer
; MODIFIED REGS: R16, R17 (R21)
COM_AllocBufferAndGetXY:
rcall COM_BufferAlloc ; (r16, r17, r21)
brcc COM_AllocBufferAndGetXY_error
mov xl, yl
mov xh, yh
adiw xh:xl, COM_BUFFER_OFFS_DATA
sec
ret
COM_AllocBufferAndGetXY_error:
ldi xl, LOW(comStatsSendNoBuffer)
ldi xh, HIGH(comStatsSendNoBuffer)
clc
ret
; ---------------------------------------------------------------------------
; COM_BufferAlloc
@@ -170,5 +199,8 @@ COM_BufferPosToY:
ret
COM_BUFFER_END:
.equ MODULE_SIZE_COM_BUFFER = COM_BUFFER_END-COM_BUFFER_BEGIN