I try to establish a connection between two Task (running on seperate cores).
One task initalizes an Interrupt on the chan resource and the second sends a message.
My problem is now to read the message from the chanend in the Interrupt handler Function.
I didn´t know how to make the chan public in the Interrupt handler from whom I should read the incomming message.
Code: Select all
int main(void) {
chan c1;
par
{
on stdcore[0]: Core0(c1);
on stdcore[1]: Core1(c1);
}
return 0;
}
void Core0(chanend chC0)
{
printf("start transmission\n");
chC0 <: 100;
printf("end of transmission\n");
}
void Core1(chanend chC1)
{
_v_InitInterrupt(chC1);
}
void ISR()
{
unsigned int x;
receive :> x; // here is the problem, i didn´t know how to make the chan public
asm("kret");
}
Code: Select all
ldap r11, ISR // get adr of interrupt handler
setv res[r0], r11 // set the interrupt vector of the timer
setc res[r0], XS1_SETC_IE_MODE_INTERRUPT // CTRL_IE_MODE_INTERRUPT
eeu res[r0]
setsr 0x2 // enable interrupts
Bernhard