uart_hw: removed jumptable approach.
This commit is contained in:
@@ -42,8 +42,3 @@
|
||||
.equ UART_HW_IFACE_SIZE = UART_HW_IFACE_OFFS_MSGIDBUF_DATA+UART_HW_IFACE_MSGIDBUF_SIZE
|
||||
|
||||
|
||||
.equ UART_HW_IFACE_FN_ISR_CHECKATTN = 0
|
||||
.equ UART_HW_IFACE_FN_ISR_READCHAR = 1
|
||||
.equ UART_HW_IFACE_FN_ISR_WRITECHAR = 2
|
||||
.equ UART_HW_IFACE_FN_COUNT = 3
|
||||
|
||||
|
||||
@@ -43,27 +43,6 @@ UART_HW_InitInterface:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine UART_HW_JumpToFunction @global
|
||||
;
|
||||
; @param R16 function number (see @ref UART_HW_IFACE_FN_ISR_CHECKATTN)
|
||||
; @param Y pointer to interface data in SRAM (see @ref UART_HW_IFACE_OFFS_STATE)
|
||||
; @param Z pointer to IFACE jump table for the given interface
|
||||
; @clobbers R16, R17, X
|
||||
|
||||
UART_HW_JumpToFunction:
|
||||
cpi r16, UART_HW_IFACE_FN_COUNT
|
||||
brcc UART_HW_JumpToFunction_ret ; return with cleared CFLAG
|
||||
mov xl, zl
|
||||
mov xh, zh
|
||||
add xl, r16
|
||||
adc xh, xl
|
||||
sub xh, xl
|
||||
push xl
|
||||
push xh
|
||||
UART_HW_JumpToFunction_ret:
|
||||
ret ; indirect jump to address we just pushed onto the stack or return on error
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user