avr-libc-corelib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Avr-libc-corelib] Re: proposed corelib style guide


From: Mike Perks
Subject: Re: [Avr-libc-corelib] Re: proposed corelib style guide
Date: Wed, 23 Sep 2009 09:42:28 -0500
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Ruddick Lawrence wrote:
[Do we want some way to tell if two init functions will conflict (ie, trying to use the same timer with both PWM and output compare)? I guess this goes back to determining the uses of each pin for each AVR model]
I think we should handle this case, at least in part. The simplest approach is by #defining "in-use" values at compile time so that any conflicts in the use of the headers results in a #error compilation error. Trying to do this at run-time is doable but much harder. This comes back to the issue of error checking and how much we should add. For example opening an SPI port twice in a row or opening a new SPI port before closing the previous one may not do any harm and the code should be written to take these use cases into account. Perhaps we need yet another #define which conditionally includes more thorough error checking paths for code development and debug. For production the user may decide to conserve code space and remove these extra paths e.g. develop on a mega328p but ship on a mega168p.

Mike Perks
Oak Micros (oakmicros.com)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]