Hi David

<snip />
> The only time I use "extern" is for prototyping in #include files.  Even
> so, the variable has to be declared somewhere without "extern"  and
> outside of a function in order to create the allocation. Make  sure you
> #include the prototype file in the source file which creates  the
> storage for the variable because avr-gcc will bellyache if the  two do
> not match. This is one of the ways one makes the compiler  double-check
> one's work.

Thanks for that; I do have everything in one file and I'm getting some
very, very odd and unpredictable actions.  The system is a pump
controller that reads pressure via an ADC and uses the AVR timer to
determine a minimum run time (unless a critical pressure is reached, in
which case the timer is ignored).

I've got an LED showing me when the timer is running and another on a
solid state relay showing what the pump is supposed to be doing.
Substituting a potentiometer for the pressure transducer, I've observed
it working as planned, but sometimes the timer never expires (or won't
start) and sometimes the "virtual" pump turns on, but never off.

Having been musing about what to try to rectify this, I'll remove the
extern declarations and see if this helps.

Cheers

M

-- 
Matthew Smith
South Australia
http://www.kbc.net.au


_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to