[Tinyos-beta-commits] CVS: tinyos-1.x/beta/platform/telosb
hardware.h, 1.5, 1.6
Cory Sharp
cssharp at users.sourceforge.net
Sun Nov 7 01:10:30 PST 2004
Update of /cvsroot/tinyos/tinyos-1.x/beta/platform/telosb
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27469
Modified Files:
hardware.h
Log Message:
Fixed the reported race conditions on P1IE and P2IE. Marking these as no race
has to be done somewhat unusually because they're in a header file and not a
module.
Within header files, nesC has "atomic" and "norace" #defined to null
unless you explicitly #undef them, which is why adding atomic blocks
doesn't get rid race condition warnings inside a header file.
Likewise, the MSP430REG_NORACE macro is written to work within a nesC
module, redeclaring within module scope a register as norace. That
doesn't work in global scope (in headers) because the variable name isn't
module-mangled and the compiler bitches about a redeclared variable. The
trick is to use MSP430REG_NORACE2, declaring an equivalent but
differently-named variable in a local block.
Index: hardware.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/telosb/hardware.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** hardware.h 6 Nov 2004 23:20:56 -0000 1.5
--- hardware.h 7 Nov 2004 09:10:28 -0000 1.6
***************
*** 155,158 ****
--- 155,160 ----
P1IE = 0;
P2IE = 0;
+ //{ MSP430REG_NORACE2(p,P1IE); p=0; }
+ //{ MSP430REG_NORACE2(p,P2IE); p=0; }
//LEDS
More information about the Tinyos-beta-commits
mailing list