From 22023b7356c9b92019d47e6a27168da4f4863c04 Mon Sep 17 00:00:00 2001 From: Fabian Date: Fri, 13 Dec 2019 10:46:58 +0100 Subject: [PATCH] add macro for shared isr call --- Firmware/Chameleon-Mini/ISRSharing.S | 30 +++++++++++++--------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/Firmware/Chameleon-Mini/ISRSharing.S b/Firmware/Chameleon-Mini/ISRSharing.S index 1496cea..9a18a82 100644 --- a/Firmware/Chameleon-Mini/ISRSharing.S +++ b/Firmware/Chameleon-Mini/ISRSharing.S @@ -9,26 +9,24 @@ #include "Codec/Codec.h" #include +; Use this macro to call isr functions +.macro call_isr isr_address +push r30 +push r31 +lds r30, \isr_address +lds r31, \isr_address+1 +icall +pop r31 +pop r30 +reti +.endm + ; Find first pause and start sampling .global CODEC_DEMOD_IN_INT0_VECT CODEC_DEMOD_IN_INT0_VECT: - push r30 - push r31 - lds r30, isr_func_CODEC_DEMOD_IN_INT0_VECT - lds r31, isr_func_CODEC_DEMOD_IN_INT0_VECT + 1 - icall - pop r31 - pop r30 - reti + call_isr isr_func_CODEC_DEMOD_IN_INT0_VECT ; Frame Delay Time PCD to PICC ends .global CODEC_TIMER_SAMPLING_CCC_VECT CODEC_TIMER_SAMPLING_CCC_VECT: - push r30 - push r31 - lds r30, isr_func_TCD0_CCC_vect - lds r31, isr_func_TCD0_CCC_vect + 1 - icall - pop r31 - pop r30 - reti + call_isr isr_func_TCD0_CCC_vect