[CCC DEV] Changes in plumbing.module, wiring.module, etc.

Matt Jadud jadudm at gmail.com
Wed Jul 7 04:45:22 BST 2010


Hi all,

I don't think anyone will be upset/surprised, but we're seriously
re-arranging plumbing.module and things under it in the avr-mega
branch.

1. We have broken things out according to architecture-specific
("arch") and board-specific ("platforms") code.

We're supporting two architectures ("m328" and "m1280") and multiple
boards ("arduino", "arduinomega", "ardupilotmega", "seeedmega", and
soon, "bare"). We have done this to avoid #IFDEF-type code, and to
make clear for library development whether something is specific to an
architecture or it is specific to a particular piece of hardware that
makes use of an ATmega 328 or 1280. ("bare", as a platform, is for
things like an AVR on a breadboard, or the Cardboarduino. We haven't
added it yet, but realized we probably should.)

2. We want Plumbing to run on multiple architectures/platforms.

This means we have to look again at what we used to have in Plumbing,
and rework it somewhat so that code written in Plumbing works on any
board. (Obviously, Plumbing code that uses RX2/TX2 on the Mega won't
run on the Arduino... but it should be able to write Plumbing code on
the Arduino and have it "just work" on the Mega. That, I think, is our
goal.)

Another practical consideration is that there should never be a
reference to the ports[] array in Plumbing. That ties things to a
particular platform/architecture in a way that probably isn't
portable.

3. Plumbing does not need to be build on Wiring, nor should it necessarily be.

We have stripped Plumbing and Wiring in this process, breaking things
out into "arch" and "platform" as appropriate. Wiring can be
re-implemented easily enough (the goal is to make it look like the C
version). Plumbing can, and should, be implemented independently. We
had (previously) built Plumbing on Wiring out of convenience. Now,
that we've reworked things, it doesn't particularly matter... they're
just higher-level APIs on top of lower-level portability layers.

My hope is that this separation will free us up to write more general
code for Plumbing, and allow us to more clearly focus on developing a
good process-oriented library.

--

I think that's it. We're getting towards the point that we could
consider merging things back in (probably another few days). Around
the end of the week, I may ask for comments/feedback on what you see
in the avr-mega branch. If you want to look/comment sooner, please do.

(We will occamdoc, check for style, and add GPL headers before a merge.)

Cheers,
Matt

-- 
Sent from my TRS-80




More information about the developers mailing list