diff --git a/hw-tests/dual-core/core1.c b/hw-tests/dual-core/core1.c index 605bf0e9a3353b163c89f00ff8c620528ada99ee..989c611a026d2241fcda709854fe1abe7e23ca7e 100644 --- a/hw-tests/dual-core/core1.c +++ b/hw-tests/dual-core/core1.c @@ -6,14 +6,16 @@ static const gpio_cfg_t motor_pin = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE int main(void) { + // Enable rxev on core1 + MXC_GCR->evten |= 0x20; for (int i = 0; 1; i++) { - printf("Hello from core 1! %d\n", i); + __asm volatile("wfe"); + printf("core1: Hello! %d\n", i); #if 0 GPIO_OutSet(&motor_pin); mxc_delay(30000); GPIO_OutClr(&motor_pin); #endif - mxc_delay(970000); } } diff --git a/hw-tests/dual-core/main.c b/hw-tests/dual-core/main.c index 8a8de068fb599855bda748345f6a0567a96d410e..d8e94276fc5572ac30bee069d98a9840f5f9e557 100644 --- a/hw-tests/dual-core/main.c +++ b/hw-tests/dual-core/main.c @@ -56,5 +56,12 @@ int main(void) leds_update(); TMR_Delay(MXC_TMR0, MSEC(10), 0); h++; + + // Send a txev using `sev` every once in a while to wake up core1 + // and let it do something + if (h % 100 == 0) { + printf("core0: Triggering core1 using SEV ...\n"); + __asm volatile("sev"); + } } }