I'm working on a project creating a new Arduino compatible board, which has more than one UART, I2C, and SPI interface. I'm trying to figure out from the software & compiler side how to support these new interfaces, specifically how to handle the hardware interrupts required. I've found documentation for the 328p interrupt table, and I've found the iom328p.h file which defines the vectors. I want to add vectors to the table and then attach ISRs to those vectors.
I thought perhaps I could modify the vector table simply by adding the following code as a starting point into my library:
#define MY_vect_num 26 #define MY_vect _VECTOR(26) #define _VECTORS_SIZE (27 * 4)
However, this code didn't have an impact on the compiled code so that can't be correct.
I know that there are different board variants in the Arduino libraries, do I need to create a new variant? Or am I putting my code in the wrong place? Or maybe I have the wrong idea on how to add new interrupts.