I want core 1 on standby to do an independent action every 100ms.
(Use case: core 1 will read a requested status on shared memory and then lights a led strand, possibly with nicely timed effects depending on the requested status. Core 0 will do all the (USB) user interaction and contain the main program and do all the calculations and just write a request into memory --- relying on core 1 to do all the lighting effects on the led-pixel-strand in the background depending on what was written in memory).
I have a question on sleep_ms() on core 1. Before I will debug myself to death, maybe some help from more experienced people would do the trick....
Does sleep_ms(100) on core 1 works without further ado?
When I tried to find out in the SDK documentation I read "These functions allow the calling core to sleep..." in the sleep() documentation, but also I read "Lower powered sleep requires use of the default alarm pool", and that one is only set on core 0 and not useable by core 1 (if I understand the documentation on alarm pools right). I am confused, but the question is simple. Does sleep_ms() works on core 1 without extras? In the mean time I will use busy_wait_ms() and pay for the extra power needed to the power line company .
3 posts • Page 1 of 1
- Raspberry Pi Engineer & Forum Moderator
- Posts: 503
- Joined: Fri Apr 12, 2019 11:00 am
- Location: austin tx
sleep_ms should work on either core; the default alarm pool fires any interrupts on core 0 as that is where it is initialized, but that doesn't affect that functionality, just something you might care about in advanced cases.