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

@@ -12,7 +12,7 @@
; ***************************************************************************
; defines
.equ COM_MAXWAIT = 200 ; maximum loop count when waiting for rising/falling clock (TODO: Make frequency-dependant)
.equ COM_MAXWAIT_US = 100 ; maximum wait time in microseconds when waiting for rising/falling clock
.equ COM_MAINTENANCE_ADDR = 0xf1
@@ -94,6 +94,8 @@ comDataEnd:
.cseg
COM_BEGIN:
comIsrPcint0:
push r15
@@ -213,33 +215,6 @@ COM_EnqueuePacket:
; ---------------------------------------------------------------------------
; 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
; ---------------------------------------------------------------------------
; comHandleNextPacketInQueue
;
@@ -325,3 +300,6 @@ comHandleReceivedPacket_l2:
COM_END:
.equ MODULE_SIZE_COM = COM_END-COM_BEGIN