[Tinyos-2-commits] CVS: tinyos-2.x/tos/platforms/eyesIFX/byte_radio
RssiFixedThresholdCMP.nc, 1.4, 1.5 RssiFixedThresholdCMC.nc,
1.4, 1.5
akoepke
andreaskoepke at users.sourceforge.net
Tue Jul 10 06:13:44 PDT 2007
Update of /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/byte_radio
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29286/tos/platforms/eyesIFX/byte_radio
Modified Files:
RssiFixedThresholdCMP.nc RssiFixedThresholdCMC.nc
Log Message:
instrument for debug
Index: RssiFixedThresholdCMP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/byte_radio/RssiFixedThresholdCMP.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** RssiFixedThresholdCMP.nc 12 Dec 2006 18:23:41 -0000 1.4
--- RssiFixedThresholdCMP.nc 10 Jul 2007 13:13:42 -0000 1.5
***************
*** 50,61 ****
interface Read<uint16_t> as Voltage;
interface Timer<TMilli> as Timer;
! // interface Resource as RssiAdcResource;
! // interface GeneralIO as Led3;
! // interface GeneralIO as Led2;
}
}
implementation
! {
! //#define CM_DEBUG // debug...
/* Measure internal voltage every 20s */
#define VOLTAGE_SAMPLE_INTERVALL 20000
--- 50,68 ----
interface Read<uint16_t> as Voltage;
interface Timer<TMilli> as Timer;
! #ifdef RSSI_FIXED_DEBUG
! interface SerialDebug;
! #endif
}
}
implementation
! {
! #ifdef RSSI_FIXED_DEBUG
! void sdDebug(uint16_t p) {
! call SerialDebug.putPlace(p);
! }
! #else
! void sdDebug(uint16_t p) {};
! #endif
!
/* Measure internal voltage every 20s */
#define VOLTAGE_SAMPLE_INTERVALL 20000
***************
*** 85,90 ****
#define THREE_SIGMA 145
! // 92 mV measured against 3V Vcc
! #define INITIAL_BUSY_DELTA 120
// 3000/2 mV measured against 2.5V Ref
--- 92,97 ----
#define THREE_SIGMA 145
! // 75 mV measured against 3V Vcc
! #define INITIAL_BUSY_DELTA 100
// 3000/2 mV measured against 2.5V Ref
***************
*** 137,152 ****
/***************** Helper function *************/
- #ifdef CM_DEBUG
- void signalFailure() {
- atomic {
- for(;;) {
- ;
- }
- }
- }
- #else
- inline void signalFailure() {
- };
- #endif
int16_t computeSNR(uint16_t r) {
--- 144,147 ----
***************
*** 175,178 ****
--- 170,176 ----
call Led3.clr(); */
}
+ #ifdef RSSI_FIXED_DEBUG
+ call SerialDebug.putShortDesc("Rssi");
+ #endif
return SUCCESS;
}
***************
*** 197,203 ****
error_t rssiRead() {
! error_t res = call Rssi.read();
! if(res != SUCCESS) signalFailure();
! return res;
}
--- 195,199 ----
error_t rssiRead() {
! return call Rssi.read();
}
***************
*** 247,250 ****
--- 243,250 ----
atomic bD = busyDelta;
d = batteryLevel - nbl;
+ sdDebug(10000 + batteryLevel);
+ sdDebug(20000 + data);
+ sdDebug(30000 + nbl);
+ sdDebug(40000U + busyDelta);
if(d > 75 || d < -75) {
// recalculate busyDelta,
***************
*** 254,258 ****
batteryLevel = nbl;
}
! } else {
post GetVoltageTask();
}
--- 254,260 ----
batteryLevel = nbl;
}
! sdDebug(50000U + busyDelta);
! }
! else {
post GetVoltageTask();
}
***************
*** 282,297 ****
}
- /* task void GetChannelStateTask() {
- atomic {
- if((state != IDLE) && (state != CCA)) {
- post GetChannelStateTask();
- } else {
- state = CCA;
- rssiRead();
- //if(call RssiAdcResource.request() != SUCCESS) signalFailure();
- }
- }
- }
- */
task void UpdateNoiseFloorTask() {
shellsort(rssisamples,NSAMPLES);
--- 284,287 ----
***************
*** 300,303 ****
--- 290,294 ----
rssiindex = 0;
}
+ sdDebug(60000U + noisefloor);
}
***************
*** 353,357 ****
} else {
rssiRead();
- // call RssiAdcResource.request();
}
}
--- 344,347 ----
***************
*** 375,392 ****
}
- /** get SNR in dB **/
- /* task void GetSnrTask() {
- state_t s;
- atomic s = state;
- if(s == SNR) {
- if(call RssiAdcResource.immediateRequest() == SUCCESS) {
- rssiRead();
- } else {
- atomic if(state == SNR) state = IDLE;
- }
- }
- }
- */
-
async command error_t ChannelMonitorData.getSnr() {
error_t res = FAIL;
--- 365,368 ----
Index: RssiFixedThresholdCMC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/byte_radio/RssiFixedThresholdCMC.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** RssiFixedThresholdCMC.nc 12 Dec 2006 18:23:41 -0000 1.4
--- RssiFixedThresholdCMC.nc 10 Jul 2007 13:13:42 -0000 1.5
***************
*** 35,38 ****
--- 35,39 ----
* @author: Andreas Koepke (koepke at tkn.tu-berlin.de)
*/
+ // #define RSSI_FIXED_DEBUG
configuration RssiFixedThresholdCMC
{
***************
*** 66,73 ****
BatteryLevel = RssiFixedThresholdCMP;
- /* components PlatformLedsC;
- RssiFixedThresholdCMP.Led3 -> PlatformLedsC.Led3;
- RssiFixedThresholdCMP.Led2 -> PlatformLedsC.Led2;
- */
RssiFixedThresholdCMP.Timer -> Timer;
}
--- 67,74 ----
BatteryLevel = RssiFixedThresholdCMP;
RssiFixedThresholdCMP.Timer -> Timer;
+ #ifdef RSSI_FIXED_DEBUG
+ components new SerialDebugC() as SD;
+ RssiFixedThresholdCMP.SerialDebug -> SD;
+ #endif
}
More information about the Tinyos-2-commits
mailing list