-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
I found the need to use the CRC peripheral from multiple tasks. I thought: no problem, wrap it in a global mutex, and each task can acquire it when needed. How to initialize it though? You can't use the peripheral passed to main. But there is steal()! That should work. Alas, you can't initialize a static with steal() because it isn't marked as const.
It looks like the peripheral is an entirely theoretical construct of the type system and doesn't contain anything so steal() doesn't have to actually initialize anything, so there's no reason it couldn't be const.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels