From fff64ae41e5c6eb22b15ba04c0244fce26b062c4 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Wed, 15 Jan 2025 00:13:02 +0100 Subject: [PATCH] uart_hw: removed jumptable approach. --- avr/modules/uart_hw/defs.asm | 5 ----- avr/modules/uart_hw/lowlevel.asm | 21 --------------------- 2 files changed, 26 deletions(-) diff --git a/avr/modules/uart_hw/defs.asm b/avr/modules/uart_hw/defs.asm index 96ab2d0..1c4da51 100644 --- a/avr/modules/uart_hw/defs.asm +++ b/avr/modules/uart_hw/defs.asm @@ -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 - diff --git a/avr/modules/uart_hw/lowlevel.asm b/avr/modules/uart_hw/lowlevel.asm index ff2f527..cc6a902 100644 --- a/avr/modules/uart_hw/lowlevel.asm +++ b/avr/modules/uart_hw/lowlevel.asm @@ -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