maxgerhardt / platform-raspberrypi

Raspberry Pi: development platform for PlatformIO
Apache License 2.0
107 stars 54 forks source link

Variables shared between cores #20

Closed MadTooler closed 1 year ago

MadTooler commented 1 year ago

This is more of a question than an issue at this time.

When accessing the same variables from both active cores on the pico, does the platform either auto set the variables to volatile or already handle them in a manner that corruption is not an issue if they are not declared as volatile?

Thanks.

maxgerhardt commented 1 year ago

I'm pretty sure the C/C++ compiler doesn't do that automatically for you. You'd have to use a mutual exclusion method for changing them concurrently.

MadTooler commented 1 year ago

OK. Thanks.