Re: Function prefix comments in C files

"Bo" <bo@xxxxxxxxxx> wrote in message
> How would you, in C, NOT use a global in the following circumstance?
> 100us counter incremented by an ISR
> access needed to read us counter by ALL modules?

I'm also anti-globals, but by "globals" I mean "global to all modules".
Within a given module (i.e. a .c file), I do allow globals - i.e. variables
that are within scope for that module, but out of scope to all others. (To
be precise, I usually define a class - actually a structure - which contains
any variables which are in-scope within that module.)

Accessor functions can then be of project-global scope, but provide real
protection: a read function can *only* read, while a write function (if
required) does so in a strictly controlled manner.

I haven't used an actual global global in maybe 15 years...



Relevant Pages

  • Re: Why does this freeze?
    ... A scope, some LEDs and ... Liberal use of LEDs is recommended to help trace what is ... is what is getting him by causing the ISR to be reentered recursively. ... Manually enabling interrupts while inside an ISR is ...
  • Re: Recommendations for Bag or Case for LX-90
    ... I will be the proud owner of an LX-90 next week, ... some kind of protection for the telescope while being moved. ... Nice scope! ...
  • Re: perl + doxygen + dbi
    ... virtualness => 'non_virtual', ... protection => 'public', ... scope => 'tm' ... type => 'int' ...
  • Re: Whale impaled by cruise ship!
    ... "Politics should be limited in its scope to war, ... protection of property, and the occasional ...
  • Re: Slow service ? at Starbucks? Imagine that.
    ... Québec is well within its rights to pass laws ... which are within the scope of sections 92 and 93 of the Constitution Act ... especially when it comes to the protection of the language of the ...