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