Skip to content
Snippets Groups Projects
Commit b4a2c87c authored by ch3's avatar ch3
Browse files

DualCore: Wake up core0 from core1, too

parent 7ae2536d
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,10 @@ int main(void)
for (int i = 0; 1; i++) {
__asm volatile("wfe");
printf("core1: Hello! %d\n", i);
mxc_delay(3000000);
printf("core1: Waking up core0\n");
__asm volatile("sev");
__asm volatile("wfe");
#if 0
GPIO_OutSet(&motor_pin);
......
......@@ -39,6 +39,7 @@ int main(void)
}
int h = 0;
MXC_GCR->evten |= 0x04;
// Release core1
Core1_Start();
......@@ -54,7 +55,7 @@ int main(void)
}
leds_update();
TMR_Delay(MXC_TMR0, MSEC(10), 0);
TMR_Delay(MXC_TMR1, MSEC(10), 0);
h++;
// Send a txev using `sev` every once in a while to wake up core1
......@@ -62,6 +63,9 @@ int main(void)
if (h % 100 == 0) {
printf("core0: Triggering core1 using SEV ...\n");
__asm volatile("sev");
__asm volatile("wfe");
__asm volatile("wfe");
printf("core0 woke up\n");
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment