Re: Function prefix comments in C files



On Fri, 07 Oct 2005 13:57:34 -0400, "Michael N. Moran"
<mike@xxxxxxxxxxx> wrote:

>Bo wrote:
>> "Peter Bushell" <NOpeter.bushell@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
>> message news:43464d78_4@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>I strongly agree with David over this. However, I do not believe he has
>>>gone far enough. Global variables are **bad news**! I've seen so many
>>>problems with their use over a long career, that I eventually decided to
>>>stop using them altogether.
>>
>> 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?
>>
>> When you are dealing with time critical code, you don't have the luxury of
>> accessor functions.
>> When you have very limited resources (RAM/ROM), ditto.
>> When you have a VERY limited stack? or no real C stack at all? (ie the stack
>> is emulated by use of registers by the compiler)
>>
>> I'm not going to argue the point that this is not the preferred/std method
>> of writing C.
>
>Good. What you described, however, are execeptions to the rule ...
>and there are *always* exceptions. However, the *rule* from
>a portability and maintainability point-of-view is best served
>as Peter suggests.
>
>Agreed, however, that in a resource constrained environment,
>execeptions are frequently legion.


This is why using the newer generation 8-bits are better than using
the older generation 8051, PICs etc. The performance and size impact
is much smaller on the newer generation 8-bits when doing things
"correctly" than for the older generation small MCUs. This is
something which is often forgotten when the various pros and cons
of using one or the other MCU are discussed in this forum.


Regards
Anton Erasmus

.