I just wanted to know if I did this right:
I created a task on the 2nd core and inserted an interrupt in it.
xTaskCreatePinnedToCore(coreTask1, "CPU_1", 1000, NULL, 0, &Core1TaskHnd, 1); //Creating Task on Core 1
void coreTask1(void *parameter) //The Task I call
{
attachInterrupt(2, encoderEvent_Motor1, CHANGE);
//attachInterrupt(2, encoderEvent_Motor2, CHANGE); //TODO
//attachInterrupt(2, encoderEvent_Motor3, CHANGE); //TODO
//attachInterrupt(2, encoderEvent_Motor4, CHANGE); //TODO
Serial.println(xPortGetCoreID());
while (1)
{
/* code */
}
}
My question is: Is the interrupt really running on the 2nd core.