[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/tda5250/mac
DuplicateP.nc, 1.1, 1.2 DuplicateC.nc, 1.1, 1.2
akoepke
andreaskoepke at users.sourceforge.net
Thu Oct 4 02:40:52 PDT 2007
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/mac
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv32575
Modified Files:
DuplicateP.nc DuplicateC.nc
Log Message:
- age cache whenever a new messages arrives
- add debug interface
Index: DuplicateP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/mac/DuplicateP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DuplicateP.nc 1 Oct 2007 15:48:59 -0000 1.1
--- DuplicateP.nc 4 Oct 2007 09:40:49 -0000 1.2
***************
*** 40,48 ****
uses {
interface Timer<TMilli> as Timer;
}
}
! implementation {
known_t knownTable[TABLE_ENTRIES];
!
/** helper functions */
task void ageMsgsTask() {
--- 40,72 ----
uses {
interface Timer<TMilli> as Timer;
+ #ifdef DUPLICATE_DEBUG
+ interface SerialDebug;
+ #endif
}
}
! implementation {
known_t knownTable[TABLE_ENTRIES];
!
! #ifdef DUPLICATE_DEBUG
! void sdDebug(uint16_t p) {
! call SerialDebug.putPlace(p);
! }
! known_t dupOldest;
! unsigned last;
! task void dump() {
! sdDebug(3000 + last);
! sdDebug(dupOldest.src);
! sdDebug(dupOldest.seqno);
! sdDebug(dupOldest.age);
! sdDebug(4000);
! sdDebug(knownTable[last].src);
! sdDebug(knownTable[last].seqno);
! sdDebug(knownTable[last].age);
! sdDebug(5000);
! }
! #else
! void sdDebug(uint16_t p) {};
! #endif
!
/** helper functions */
task void ageMsgsTask() {
***************
*** 81,84 ****
--- 105,110 ----
}
}
+ sdDebug(100 + rVal);
+ sdDebug(200 + i);
return rVal;
}
***************
*** 86,92 ****
--- 112,124 ----
async command void Duplicate.remember(am_addr_t src, uint8_t seqno) {
unsigned oldest = findOldest();
+ #ifdef DUPLICATE_DEBUG
+ dupOldest = knownTable[oldest];
+ last = oldest;
+ post dump();
+ #endif
knownTable[oldest].src = src;
knownTable[oldest].seqno = seqno;
knownTable[oldest].age = 0;
+ post ageMsgsTask();
}
***************
*** 100,104 ****
for(i = 0; i < TABLE_ENTRIES; i++) {
atomic {
! knownTable[i].age = MAX_AGE;
}
}
--- 132,136 ----
for(i = 0; i < TABLE_ENTRIES; i++) {
atomic {
! knownTable[i].age = MAX_AGE;
}
}
Index: DuplicateC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/tda5250/mac/DuplicateC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DuplicateC.nc 1 Oct 2007 15:48:59 -0000 1.1
--- DuplicateC.nc 4 Oct 2007 09:40:49 -0000 1.2
***************
*** 48,50 ****
--- 48,56 ----
DuplicateP.Timer -> Timer; // make information soft state
MainC.SoftwareInit -> DuplicateP;
+
+ #ifdef DUPLICATE_DEBUG
+ components new SerialDebugC() as SD;
+ DuplicateP.SerialDebug -> SD;
+ #endif
+
}
More information about the Tinyos-2-commits
mailing list