[Tinyos-host-mote-wg] [Tinyos-2.0wg] Re: Generic preprocessing

Cory Sharp cory.sharp at gmail.com
Thu Apr 21 23:21:15 PDT 2005


I've got it figured out, now.  It was a matter of parameterizing the
lower layers and instatiating only the upper layers inside a generic
as needed.  (Instead of instatiating everything then trying to
parameterize on that.)  - Cory

On 4/21/05, Cory Sharp <cory.sharp at gmail.com> wrote:
> I have a number of similar modules that handle hardware events, let's
> call them AlarmB0C, AlarmB1C, etc.  I'd like to write in nesC "new
> AlarmC()" and have it return the next available module.  Because each
> module is handling hardware events, I'd like unused modules to never
> be pulled in.  Does anyone have an idea on how I can do this?
> 
> I'm currently doing this below, but the problem is that all of the
> interrupt handling code is included (unneccessary bloat), even if I
> only call "new AlarmC()" once.  My gut reaction is to want use #if
> processor directives to remove any unreferenced AlarmBXC modules.
> But, of course, this isn't exactly possible.  Any ideas?
> 
> Thanks, Cory
> 
> module AlarmMapC {
>   provides Alarm[uint8_t id];
> } implementation {
>   components AlarmB0C, AlarmB1C, AlarmB2C, AlarmB3C;
>   Alarm[0] = AlarmB0C;
>   Alarm[1] = AlarmB1C;
>   Alarm[2] = AlarmB2C;
>   Alarm[3] = AlarmB3C;
> }
> 
> generic module AlarmC() {
>   provides interface Alarm;
> } implementation {
>   components AlarmMapC;
>   enum { ALARM_ID = unique("AlarmMapC") };
>   Alarm = AlarmMapC.Alarm[ALARM_ID];
> }
>

_______________________________________________
Tinyos-2.0wg mailing list
Tinyos-2.0wg at Mail.Millennium.Berkeley.EDU
http://Mail.Millennium.Berkeley.EDU/mailman/listinfo/tinyos-2.0wg


More information about the Tinyos-host-mote-wg mailing list