I want to change the interrupt vector on timer 1, TIMER1_COMPA_vect, to point into one of 16 different functions to call. The function called will depend on a variable who's value is changed by button pushes.
Yes I know I could just use a case statement to pick out the right one in a:-
ISR(TIMER1_COMPA_vect) { ..... }
ISR,
but time is of the essence here and I would like to do it in as few a clock cycles as possible.
Any one know of the syntax I need to change this interrupt vector to the appropriate function? I am assuming it is a matter of changing the vector to the address of my function.
Yes I will disable interrupts when changing the vector.
Any one know of the syntax I need to change this interrupt vector to the appropriate function? I am assuming it is a matter of changing the vector to the address of my function.
The interrupt vector table is stored in flash (either at the start of the flash or at the start of the boot loader section). As far as I know you cannot move the table to the RAM. So you probably end up having one interrupt handler and using a jump table there.