Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I kinda understand the principal of "no globals" when it comes to large team projects. However, most of my projects will only have myself writing code so i'm more comfortable with globals. I do try to reduce my use as much as reasonable as they do eat ram but having function calls just to read/write a private variable eats up program space. Hence, when it comes to \[ \mu \]controllers I tend to use them as needed.
So why does my one symbol take multiple paragraphs?no #5 was just a "quote" from your post #4
But then if you need a g_string local variable you are screwedHow about g_
(g underscore)
A quick look will allow you to realize that it's a global variable.
Recently, I spent some time programming in c#. No global variables allowed at all. Sometimes, they make things so easy.
Unless they're being shared by multiple threads, in which case you have to be sure to use a locking construct (mutex)
Microcontrollers are a different animal. You're not running more than one thread, so there's no risk.
But you have to be careful if the same global variable is being accessed from more than one interrupt.
(Break out the atomic locking gizmo... )