app.c
上传用户:joranyuan
上传日期:2022-06-23
资源大小:3306k
文件大小:323k
- 3 << 1)) | (1 << 0);
- CC1000ControlM$gCurrentParameters[0x11] = ((5 << 4) | (1 << 2)) | (
- 1 << 0);
- CC1000ControlM$cc1000SetModem();
- CC1000ControlM$gCurrentParameters[0x13] = 1 << 0;
- CC1000ControlM$HPLChipcon$write(0x13, CC1000ControlM$gCurrentParameters[0x13]);
- CC1000ControlM$gCurrentParameters[0x1e] = TRUE;
- CC1000ControlM$CC1000Control$TunePreset(0x00);
- return SUCCESS;
- }
- # 63 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t CC1000RadioIntM$CC1000StdControl$init(void){
- #line 63
- unsigned char result;
- #line 63
- #line 63
- result = CC1000ControlM$StdControl$init();
- #line 63
- #line 63
- return result;
- #line 63
- }
- #line 63
- # 143 "../../tos/platform/mica2/hardware.h"
- static __inline void TOSH_MAKE_MOSI_INPUT(void)
- #line 143
- {
- #line 143
- * (volatile uint8_t *)(0x17 + 0x20) &= ~(1 << 2);
- }
- static __inline void TOSH_MAKE_SPI_SCK_INPUT(void)
- #line 146
- {
- #line 146
- * (volatile uint8_t *)(0x17 + 0x20) &= ~(1 << 1);
- }
- static inline
- # 90 "../../tos/platform/mica2/HPLSpiM.nc"
- result_t HPLSpiM$SpiByteFifo$initSlave(void)
- #line 90
- {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 91
- {
- TOSH_MAKE_SPI_SCK_INPUT();
- TOSH_MAKE_MISO_INPUT();
- TOSH_MAKE_MOSI_INPUT();
- * (volatile uint8_t *)(0x0D + 0x20) &= ~(1 << 3);
- * (volatile uint8_t *)(0x0D + 0x20) &= ~(1 << 2);
- * (volatile uint8_t *)(0x0D + 0x20) |= 1 << 7;
- * (volatile uint8_t *)(0x0D + 0x20) |= 1 << 6;
- }
- #line 99
- __nesc_atomic_end(__nesc_atomic); }
- return SUCCESS;
- }
- # 38 "../../tos/platform/mica2/SpiByteFifo.nc"
- inline static result_t CC1000RadioIntM$SpiByteFifo$initSlave(void){
- #line 38
- unsigned char result;
- #line 38
- #line 38
- result = HPLSpiM$SpiByteFifo$initSlave();
- #line 38
- #line 38
- return result;
- #line 38
- }
- #line 38
- static inline
- # 648 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- result_t CC1000RadioIntM$StdControl$init(void)
- #line 648
- {
- char i;
- ecnMsgType *ecnMsgPtr = (ecnMsgType *)CC1000RadioIntM$ecnMsgHdr.data;
- #line 651
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 651
- {
- CC1000RadioIntM$RadioState = CC1000RadioIntM$DISABLED_STATE;
- CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_PREAMBLE;
- CC1000RadioIntM$rxbufptr = &CC1000RadioIntM$RxBuf;
- CC1000RadioIntM$rxbufptr->length = 0;
- CC1000RadioIntM$rxlength = MSG_DATA_SIZE - 2;
- CC1000RadioIntM$RxBitOffset = 0;
- CC1000RadioIntM$iSquelchCount = 0;
- CC1000RadioIntM$PreambleCount = 0;
- CC1000RadioIntM$RSSISampleFreq = 0;
- CC1000RadioIntM$RxShiftBuf.W = 0;
- CC1000RadioIntM$iRSSIcount = 0;
- CC1000RadioIntM$bTxPending = FALSE;
- CC1000RadioIntM$bTxBusy = FALSE;
- CC1000RadioIntM$bRSSIValid = FALSE;
- CC1000RadioIntM$bAckEnable = FALSE;
- CC1000RadioIntM$bCCAEnable = TRUE;
- CC1000RadioIntM$CC1K_PulseLevel = 300;
- CC1000RadioIntM$sMacDelay = -1;
- CC1000RadioIntM$usRSSIVal = -1;
- CC1000RadioIntM$usSquelchIndex = 0;
- CC1000RadioIntM$pulse_check_count = 0;
- CC1000RadioIntM$lplpower = 0;
- CC1000RadioIntM$RSSIInitState = CC1000RadioIntM$NULL_STATE;
- CC1000RadioIntM$usSquelchVal = 0x120;
- CC1000RadioIntM$currentMAC = CC1000RadioIntM$BMAC;
- CC1000RadioIntM$congBackOffs = 0;
- CC1000RadioIntM$packetsSent = 0;
- CC1000RadioIntM$pktsLastSync = 0;
- CC1000RadioIntM$avgLoss = 0.0;
- CC1000RadioIntM$curHCLlist = 0;
- CC1000RadioIntM$globalFrameLength = 32;
- CC1000RadioIntM$localFrameLength = 32;
- CC1000RadioIntM$slotSize = 50;
- CC1000RadioIntM$localFrameSize = CC1000RadioIntM$localFrameLength * CC1000RadioIntM$slotSize;
- CC1000RadioIntM$globalFrameSize = CC1000RadioIntM$globalFrameLength * CC1000RadioIntM$slotSize;
- CC1000RadioIntM$ackOrig = CC1000RadioIntM$bAckEnable;
- CC1000RadioIntM$ecnPending = FALSE;
- CC1000RadioIntM$ecnforward = FALSE;
- CC1000RadioIntM$enableHCL = FALSE;
- CC1000RadioIntM$pureHCL = FALSE;
- CC1000RadioIntM$HCLselect = 1;
- CC1000RadioIntM$needTimeSync = FALSE;
- CC1000RadioIntM$slots_since_ecnsend = 0;
- CC1000RadioIntM$slots_since_ecnrecv = 0;
- CC1000RadioIntM$slots_since_ecncheck = 0;
- CC1000RadioIntM$ecnMsgHdr.type = 222;
- CC1000RadioIntM$ecnMsgHdr.addr = TOS_BCAST_ADDR;
- CC1000RadioIntM$ecnMsgHdr.length = sizeof(ecnMsgType );
- CC1000RadioIntM$ecnMsgHdr.group = 125;
- CC1000RadioIntM$ecnMsgHdr.crc = 0;
- CC1000RadioIntM$ecnForwardMsgHdr.type = 222;
- CC1000RadioIntM$ecnForwardMsgHdr.addr = TOS_BCAST_ADDR;
- CC1000RadioIntM$ecnForwardMsgHdr.length = sizeof(ecnMsgType );
- CC1000RadioIntM$ecnForwardMsgHdr.group = 125;
- CC1000RadioIntM$ecnForwardMsgHdr.crc = 0;
- CC1000RadioIntM$syncMsgHdr.type = 223;
- CC1000RadioIntM$syncMsgHdr.addr = TOS_BCAST_ADDR;
- CC1000RadioIntM$syncMsgHdr.length = sizeof(syncMsgType );
- CC1000RadioIntM$syncMsgHdr.group = 125;
- CC1000RadioIntM$syncMsgHdr.crc = 0;
- ecnMsgPtr->hopCount = 0;
- ecnMsgPtr->nextHop = CC1000RadioIntM$nextHop;
- ecnMsgPtr->senderAddress = TOS_LOCAL_ADDRESS;
- }
- #line 727
- __nesc_atomic_end(__nesc_atomic); }
- for (i = 0; i < 9; i++)
- CC1000RadioIntM$usSquelchTable[(int )i] = 0x120;
- CC1000RadioIntM$SpiByteFifo$initSlave();
- CC1000RadioIntM$CC1000StdControl$init();
- CC1000RadioIntM$CC1000Control$SelectLock(0x9);
- CC1000RadioIntM$bInvertRxData = CC1000RadioIntM$CC1000Control$GetLOStatus();
- CC1000RadioIntM$ADCControl$bindPort(TOS_ADC_CC_RSSI_PORT, TOSH_ACTUAL_CC_RSSI_PORT);
- CC1000RadioIntM$ADCControl$init();
- CC1000RadioIntM$Random$init();
- CC1000RadioIntM$TimerControl$init();
- CC1000RadioIntM$LocalAddr = TOS_LOCAL_ADDRESS;
- return SUCCESS;
- }
- # 63 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t AMPromiscuous$RadioControl$init(void){
- #line 63
- unsigned char result;
- #line 63
- #line 63
- result = CC1000RadioIntM$StdControl$init();
- #line 63
- #line 63
- return result;
- #line 63
- }
- #line 63
- static inline
- # 60 "/home/testuser/tinyos-1.x/tos/system/UARTM.nc"
- result_t UARTM$Control$init(void)
- #line 60
- {
- {
- }
- #line 61
- ;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 62
- {
- UARTM$state = FALSE;
- }
- #line 64
- __nesc_atomic_end(__nesc_atomic); }
- return SUCCESS;
- }
- # 63 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t FramerM$ByteControl$init(void){
- #line 63
- unsigned char result;
- #line 63
- #line 63
- result = UARTM$Control$init();
- #line 63
- #line 63
- return result;
- #line 63
- }
- #line 63
- static inline
- # 291 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
- result_t FramerM$StdControl$init(void)
- #line 291
- {
- FramerM$HDLCInitialize();
- return FramerM$ByteControl$init();
- }
- # 63 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t AMPromiscuous$UARTControl$init(void){
- #line 63
- unsigned char result;
- #line 63
- #line 63
- result = FramerM$StdControl$init();
- #line 63
- #line 63
- return result;
- #line 63
- }
- #line 63
- inline static result_t AMPromiscuous$TimerControl$init(void){
- #line 63
- unsigned char result;
- #line 63
- #line 63
- result = TimerM$StdControl$init();
- #line 63
- #line 63
- return result;
- #line 63
- }
- #line 63
- static inline
- # 92 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- result_t AMPromiscuous$Control$init(void)
- #line 92
- {
- result_t ok1;
- #line 93
- result_t ok2;
- #line 94
- AMPromiscuous$TimerControl$init();
- ok1 = AMPromiscuous$UARTControl$init();
- ok2 = AMPromiscuous$RadioControl$init();
- AMPromiscuous$state = FALSE;
- AMPromiscuous$lastCount = 0;
- AMPromiscuous$counter = 0;
- AMPromiscuous$promiscuous_mode = FALSE;
- AMPromiscuous$crc_check = TRUE;
- {
- }
- #line 102
- ;
- return rcombine(ok1, ok2);
- }
- # 63 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t MultiHopEngineM$CommStdControl$init(void){
- #line 63
- unsigned char result;
- #line 63
- #line 63
- result = AMPromiscuous$Control$init();
- #line 63
- #line 63
- return result;
- #line 63
- }
- #line 63
- # 91 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
- static void MultiHopEngineM$initialize(void)
- #line 91
- {
- int n;
- for (n = 0; n < MultiHopEngineM$FWD_QUEUE_SIZE; n++) {
- MultiHopEngineM$FwdBufList[n] = &MultiHopEngineM$FwdBuffers[n];
- }
- MultiHopEngineM$iFwdBufHead = MultiHopEngineM$iFwdBufTail = 0;
- }
- static inline result_t MultiHopEngineM$StdControl$init(void)
- #line 101
- {
- MultiHopEngineM$initialize();
- MultiHopEngineM$CommStdControl$init();
- return MultiHopEngineM$SubControl$init();
- }
- # 63 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t RealMain$StdControl$init(void){
- #line 63
- unsigned char result;
- #line 63
- #line 63
- result = TimerM$StdControl$init();
- #line 63
- result = rcombine(result, MultiHopEngineM$StdControl$init());
- #line 63
- result = rcombine(result, TimerM$StdControl$init());
- #line 63
- result = rcombine(result, MultiHopTtestM$StdControl$init());
- #line 63
- #line 63
- return result;
- #line 63
- }
- #line 63
- static inline
- # 149 "/home/testuser/tinyos-1.x/tos/platform/mica/HPLClock.nc"
- result_t HPLClock$Clock$setRate(char interval, char scale)
- #line 149
- {
- scale &= 0x7;
- scale |= 0x8;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 152
- {
- * (volatile uint8_t *)(0x37 + 0x20) &= ~(1 << 0);
- * (volatile uint8_t *)(0x37 + 0x20) &= ~(1 << 1);
- * (volatile uint8_t *)(0x30 + 0x20) |= 1 << 3;
- * (volatile uint8_t *)(0x33 + 0x20) = scale;
- * (volatile uint8_t *)(0x32 + 0x20) = 0;
- * (volatile uint8_t *)(0x31 + 0x20) = interval;
- * (volatile uint8_t *)(0x37 + 0x20) |= 1 << 1;
- }
- #line 162
- __nesc_atomic_end(__nesc_atomic); }
- return SUCCESS;
- }
- # 96 "/home/testuser/tinyos-1.x/tos/interfaces/Clock.nc"
- inline static result_t TimerM$Clock$setRate(char arg_0x882c878, char arg_0x882c9b8){
- #line 96
- unsigned char result;
- #line 96
- #line 96
- result = HPLClock$Clock$setRate(arg_0x882c878, arg_0x882c9b8);
- #line 96
- #line 96
- return result;
- #line 96
- }
- #line 96
- # 128 "../../tos/platform/mica2/hardware.h"
- static __inline void TOSH_CLR_CC_PALE_PIN(void)
- #line 128
- {
- #line 128
- * (volatile uint8_t *)(0x12 + 0x20) &= ~(1 << 4);
- }
- #line 126
- static __inline void TOSH_CLR_CC_PDATA_PIN(void)
- #line 126
- {
- #line 126
- * (volatile uint8_t *)(0x12 + 0x20) &= ~(1 << 7);
- }
- #line 127
- static __inline void TOSH_CLR_CC_PCLK_PIN(void)
- #line 127
- {
- #line 127
- * (volatile uint8_t *)(0x12 + 0x20) &= ~(1 << 6);
- }
- #line 126
- static __inline void TOSH_MAKE_CC_PDATA_INPUT(void)
- #line 126
- {
- #line 126
- * (volatile uint8_t *)(0x11 + 0x20) &= ~(1 << 7);
- }
- #line 126
- static __inline int TOSH_READ_CC_PDATA_PIN(void)
- #line 126
- {
- #line 126
- return (* (volatile uint8_t *)(0x10 + 0x20) & (1 << 7)) != 0;
- }
- # 63 "/home/testuser/tinyos-1.x/tos/interfaces/Random.nc"
- inline static uint16_t MultiHopTtestM$Random$rand(void){
- #line 63
- unsigned int result;
- #line 63
- #line 63
- result = RandomLFSR$Random$rand();
- #line 63
- #line 63
- return result;
- #line 63
- }
- #line 63
- # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
- inline static result_t MultiHopTtestM$RouteTimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10){
- #line 59
- unsigned char result;
- #line 59
- #line 59
- result = TimerM$Timer$start(0, arg_0x8561bb8, arg_0x8561d10);
- #line 59
- #line 59
- return result;
- #line 59
- }
- #line 59
- static inline
- # 494 "../../tos/platform/mica2/CC1000ControlM.nc"
- result_t CC1000ControlM$CC1000Control$SetRFPower(uint8_t power)
- #line 494
- {
- CC1000ControlM$gCurrentParameters[0xb] = power;
- return SUCCESS;
- }
- # 150 "../../tos/platform/mica2/CC1000Control.nc"
- inline static result_t MultiHopTtestM$RFset$SetRFPower(uint8_t arg_0x856ce78){
- #line 150
- unsigned char result;
- #line 150
- #line 150
- result = CC1000ControlM$CC1000Control$SetRFPower(arg_0x856ce78);
- #line 150
- #line 150
- return result;
- #line 150
- }
- #line 150
- # 106 "/home/testuser/tinyos-1.x/tos/interfaces/Send.nc"
- inline static void *MultiHopTtestM$Send$getBuffer(TOS_MsgPtr arg_0x8563448, uint16_t *arg_0x85635b0){
- #line 106
- void *result;
- #line 106
- #line 106
- result = MultiHopEngineM$Send$getBuffer(AM_MULTIHOP, arg_0x8563448, arg_0x85635b0);
- #line 106
- #line 106
- return result;
- #line 106
- }
- #line 106
- static inline
- # 68 "MultiHopTtestM.nc"
- result_t MultiHopTtestM$StdControl$start(void)
- #line 68
- {
- uint16_t len;
- multiHopMsg *multiHopMsgData = (multiHopMsg *)MultiHopTtestM$Send$getBuffer(&MultiHopTtestM$DataPkt, &len);
- #line 71
- multiHopMsgData->sendID = TOS_LOCAL_ADDRESS;
- MultiHopTtestM$RFset$SetRFPower(255);
- MultiHopTtestM$RouteTimer$start(TIMER_ONE_SHOT, MultiHopTtestM$Random$rand() % ROUTE_TIME);
- return SUCCESS;
- }
- static inline
- # 87 "/home/testuser/tinyos-1.x/tos/system/TimerM.nc"
- result_t TimerM$StdControl$start(void)
- #line 87
- {
- return SUCCESS;
- }
- static inline
- # 146 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- result_t AMPromiscuous$CommControl$setPromiscuous(bool value)
- #line 146
- {
- AMPromiscuous$promiscuous_mode = value;
- return SUCCESS;
- }
- # 65 "/home/testuser/tinyos-1.x/tos/interfaces/CommControl.nc"
- inline static result_t MultiHopEngineM$CommControl$setPromiscuous(bool arg_0x85a8158){
- #line 65
- unsigned char result;
- #line 65
- #line 65
- result = AMPromiscuous$CommControl$setPromiscuous(arg_0x85a8158);
- #line 65
- #line 65
- return result;
- #line 65
- }
- #line 65
- # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
- inline static result_t MultiHopWMEWMA$Timer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10){
- #line 59
- unsigned char result;
- #line 59
- #line 59
- result = TimerM$Timer$start(8, arg_0x8561bb8, arg_0x8561d10);
- #line 59
- #line 59
- return result;
- #line 59
- }
- #line 59
- static inline
- # 612 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- result_t MultiHopWMEWMA$StdControl$start(void)
- #line 612
- {
- if (TOS_LOCAL_ADDRESS == MultiHopWMEWMA$BASE_STATION_ADDRESS) {
- MultiHopWMEWMA$gpCurrentParent = &MultiHopWMEWMA$BaseStation;
- MultiHopWMEWMA$gbCurrentHopCount = 0;
- MultiHopWMEWMA$gbCurrentCost = 0;
- }
- if (MultiHopWMEWMA$gSelfTimer) {
- TOS_post(MultiHopWMEWMA$TimerTask);
- MultiHopWMEWMA$Timer$start(TIMER_REPEAT, MultiHopWMEWMA$gUpdateInterval);
- }
- return SUCCESS;
- }
- static inline
- # 106 "/home/testuser/tinyos-1.x/tos/lib/Queue/QueuedSendM.nc"
- result_t QueuedSendM$StdControl$start(void)
- #line 106
- {
- return SUCCESS;
- }
- # 70 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t MultiHopEngineM$SubControl$start(void){
- #line 70
- unsigned char result;
- #line 70
- #line 70
- result = QueuedSendM$StdControl$start();
- #line 70
- result = rcombine(result, MultiHopWMEWMA$StdControl$start());
- #line 70
- #line 70
- return result;
- #line 70
- }
- #line 70
- static inline
- # 133 "/home/testuser/tinyos-1.x/tos/system/tos.h"
- result_t rcombine4(result_t r1, result_t r2, result_t r3,
- result_t r4)
- {
- return rcombine(r1, rcombine(r2, rcombine(r3, r4)));
- }
- # 41 "/home/testuser/tinyos-1.x/tos/interfaces/PowerManagement.nc"
- inline static uint8_t AMPromiscuous$PowerManagement$adjustPower(void){
- #line 41
- unsigned char result;
- #line 41
- #line 41
- result = HPLPowerManagementM$PowerManagement$adjustPower();
- #line 41
- #line 41
- return result;
- #line 41
- }
- #line 41
- # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
- inline static result_t AMPromiscuous$ActivityTimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10){
- #line 59
- unsigned char result;
- #line 59
- #line 59
- result = TimerM$Timer$start(3, arg_0x8561bb8, arg_0x8561d10);
- #line 59
- #line 59
- return result;
- #line 59
- }
- #line 59
- # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
- inline static result_t CC1000RadioIntM$WakeupTimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10){
- #line 59
- unsigned char result;
- #line 59
- #line 59
- result = TimerM$Timer$start(5, arg_0x8561bb8, arg_0x8561d10);
- #line 59
- #line 59
- return result;
- #line 59
- }
- #line 59
- # 41 "/home/testuser/tinyos-1.x/tos/interfaces/PowerManagement.nc"
- inline static uint8_t HPLSpiM$PowerManagement$adjustPower(void){
- #line 41
- unsigned char result;
- #line 41
- #line 41
- result = HPLPowerManagementM$PowerManagement$adjustPower();
- #line 41
- #line 41
- return result;
- #line 41
- }
- #line 41
- static inline
- # 74 "../../tos/platform/mica2/HPLSpiM.nc"
- result_t HPLSpiM$SpiByteFifo$enableIntr(void)
- #line 74
- {
- * (volatile uint8_t *)(0x0D + 0x20) = 0xC0;
- * (volatile uint8_t *)(0x17 + 0x20) &= ~(1 << 0);
- HPLSpiM$PowerManagement$adjustPower();
- return SUCCESS;
- }
- # 36 "../../tos/platform/mica2/SpiByteFifo.nc"
- inline static result_t CC1000RadioIntM$SpiByteFifo$enableIntr(void){
- #line 36
- unsigned char result;
- #line 36
- #line 36
- result = HPLSpiM$SpiByteFifo$enableIntr();
- #line 36
- #line 36
- return result;
- #line 36
- }
- #line 36
- # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
- inline static result_t CC1000RadioIntM$SquelchTimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10){
- #line 59
- unsigned char result;
- #line 59
- #line 59
- result = TimerM$Timer$start(4, arg_0x8561bb8, arg_0x8561d10);
- #line 59
- #line 59
- return result;
- #line 59
- }
- #line 59
- # 116 "../../tos/platform/mica2/CC1000Control.nc"
- inline static result_t CC1000RadioIntM$CC1000Control$RxMode(void){
- #line 116
- unsigned char result;
- #line 116
- #line 116
- result = CC1000ControlM$CC1000Control$RxMode();
- #line 116
- #line 116
- return result;
- #line 116
- }
- #line 116
- static inline
- # 109 "../../tos/platform/mica2/HPLSpiM.nc"
- result_t HPLSpiM$SpiByteFifo$rxMode(void)
- #line 109
- {
- TOSH_MAKE_MISO_INPUT();
- TOSH_MAKE_MOSI_INPUT();
- return SUCCESS;
- }
- # 40 "../../tos/platform/mica2/SpiByteFifo.nc"
- inline static result_t CC1000RadioIntM$SpiByteFifo$rxMode(void){
- #line 40
- unsigned char result;
- #line 40
- #line 40
- result = HPLSpiM$SpiByteFifo$rxMode();
- #line 40
- #line 40
- return result;
- #line 40
- }
- #line 40
- static inline
- # 457 "../../tos/platform/mica2/CC1000ControlM.nc"
- result_t CC1000ControlM$CC1000Control$BIASOn(void)
- #line 457
- {
- CC1000ControlM$HPLChipcon$write(0x00, (((
- 1 << 5) | (1 << 4)) | (
- 1 << 3)) | (
- 1 << 0));
- TOSH_uwait(200);
- return SUCCESS;
- }
- # 137 "../../tos/platform/mica2/CC1000Control.nc"
- inline static result_t CC1000RadioIntM$CC1000Control$BIASOn(void){
- #line 137
- unsigned char result;
- #line 137
- #line 137
- result = CC1000ControlM$CC1000Control$BIASOn();
- #line 137
- #line 137
- return result;
- #line 137
- }
- #line 137
- static inline
- # 480 "../../tos/platform/mica2/CC1000ControlM.nc"
- result_t CC1000ControlM$StdControl$start(void)
- #line 480
- {
- CC1000ControlM$HPLChipcon$write(0x00, ((((
- 1 << 5) | (1 << 4)) | (
- 1 << 3)) | (1 << 1)) | (
- 1 << 0));
- return SUCCESS;
- }
- # 70 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t CC1000RadioIntM$CC1000StdControl$start(void){
- #line 70
- unsigned char result;
- #line 70
- #line 70
- result = CC1000ControlM$StdControl$start();
- #line 70
- #line 70
- return result;
- #line 70
- }
- #line 70
- static inline
- # 66 "../../tos/platform/mica2/HPLSClock.nc"
- result_t HPLSClock$SClock$SetRate(uint16_t interval, char scale)
- #line 66
- {
- scale &= 0x7;
- scale |= 0x8;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 69
- {
- * (volatile uint8_t *)0x7D &= ~(1 << 4);
- * (volatile uint8_t *)0x8A = scale;
- * (volatile uint16_t *)0x88 = 0x0000;
- * (volatile uint16_t *)0x86 = interval;
- * (volatile uint8_t *)0x8B = 0x00;
- * (volatile uint8_t *)0x8B |= 1 << 6;
- * (volatile uint8_t *)(0x02 + 0x20) |= 1 << 3;
- * (volatile uint8_t *)0x8C = 0x00;
- * (volatile uint8_t *)0x7D |= 1 << 4;
- }
- #line 79
- __nesc_atomic_end(__nesc_atomic); }
- HPLSClock$needupdate = 0;
- return SUCCESS;
- }
- # 45 "../../tos/interfaces/SClock.nc"
- inline static result_t CC1000RadioIntM$SClock$SetRate(uint16_t arg_0x862a9b0, char arg_0x862aaf0){
- #line 45
- unsigned char result;
- #line 45
- #line 45
- result = HPLSClock$SClock$SetRate(arg_0x862a9b0, arg_0x862aaf0);
- #line 45
- #line 45
- return result;
- #line 45
- }
- #line 45
- static inline
- # 1056 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- result_t CC1000RadioIntM$StdControl$start(void)
- #line 1056
- {
- uint8_t currentRadioState;
- #line 1058
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 1058
- currentRadioState = CC1000RadioIntM$RadioState;
- #line 1058
- __nesc_atomic_end(__nesc_atomic); }
- CC1000RadioIntM$SClock$SetRate(CC1000RadioIntM$MAX_VAL, CLK_DIV_64);
- if (currentRadioState == CC1000RadioIntM$DISABLED_STATE) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 1062
- {
- CC1000RadioIntM$rxbufptr->length = 0;
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- CC1000RadioIntM$bTxPending = CC1000RadioIntM$bTxBusy = FALSE;
- CC1000RadioIntM$sMacDelay = -1;
- if (0 > 0) {
- CC1000RadioIntM$sleeptime = 0;
- CC1000RadioIntM$preamblelen = 0;
- }
- else
- #line 1070
- {
- CC1000RadioIntM$lplpower = CC1000RadioIntM$lplpowertx = 0;
- CC1000RadioIntM$sleeptime = (({
- #line 1072
- uint16_t __addr16 = (uint16_t )(uint16_t )&CC1K_LPL_SleepTime[CC1000RadioIntM$lplpower * 2];
- #line 1072
- uint8_t __result;
- #line 1072
- __asm ("lpm %0, Z""nt" : "=r"(__result) : "z"(__addr16));__result;
- }
- )
- #line 1072
- << 8) |
- ({
- #line 1073
- uint16_t __addr16 = (uint16_t )(uint16_t )&CC1K_LPL_SleepTime[CC1000RadioIntM$lplpower * 2 + 1];
- #line 1073
- uint8_t __result;
- #line 1073
- __asm ("lpm %0, Z""nt" : "=r"(__result) : "z"(__addr16));__result;
- }
- );
- #line 1074
- CC1000RadioIntM$preamblelen = (({
- #line 1074
- uint16_t __addr16 = (uint16_t )(uint16_t )&CC1K_LPL_PreambleLength[CC1000RadioIntM$lplpowertx * 2];
- #line 1074
- uint8_t __result;
- #line 1074
- __asm ("lpm %0, Z""nt" : "=r"(__result) : "z"(__addr16));__result;
- }
- )
- #line 1074
- << 8) |
- ({
- #line 1075
- uint16_t __addr16 = (uint16_t )(uint16_t )&CC1K_LPL_PreambleLength[CC1000RadioIntM$lplpowertx * 2 + 1];
- #line 1075
- uint8_t __result;
- #line 1075
- __asm ("lpm %0, Z""nt" : "=r"(__result) : "z"(__addr16));__result;
- }
- );
- }
- }
- #line 1079
- __nesc_atomic_end(__nesc_atomic); }
- CC1000RadioIntM$rxbufptr->length = 0;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 1084
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- #line 1084
- __nesc_atomic_end(__nesc_atomic); }
- CC1000RadioIntM$CC1000StdControl$start();
- CC1000RadioIntM$CC1000Control$BIASOn();
- CC1000RadioIntM$SpiByteFifo$rxMode();
- CC1000RadioIntM$CC1000Control$RxMode();
- if (CC1000RadioIntM$iSquelchCount > 30) {
- CC1000RadioIntM$SquelchTimer$start(TIMER_REPEAT, 2560);
- }
- else {
- #line 1092
- CC1000RadioIntM$SquelchTimer$start(TIMER_REPEAT, 128);
- }
- #line 1093
- CC1000RadioIntM$SpiByteFifo$enableIntr();
- if (CC1000RadioIntM$lplpower > 0) {
- CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, 2560);
- }
- }
- return SUCCESS;
- }
- # 70 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t AMPromiscuous$RadioControl$start(void){
- #line 70
- unsigned char result;
- #line 70
- #line 70
- result = CC1000RadioIntM$StdControl$start();
- #line 70
- #line 70
- return result;
- #line 70
- }
- #line 70
- static inline
- # 60 "../../tos/platform/mica2/HPLUART0M.nc"
- result_t HPLUART0M$UART$init(void)
- #line 60
- {
- * (volatile uint8_t *)0x90 = 0;
- * (volatile uint8_t *)(0x09 + 0x20) = 15;
- * (volatile uint8_t *)(0x0B + 0x20) = 1 << 1;
- * (volatile uint8_t *)0x95 = (1 << 2) | (1 << 1);
- * (volatile uint8_t *)(0x0A + 0x20) = (((1 << 7) | (1 << 6)) | (1 << 4)) | (1 << 3);
- return SUCCESS;
- }
- # 62 "/home/testuser/tinyos-1.x/tos/interfaces/HPLUART.nc"
- inline static result_t UARTM$HPLUART$init(void){
- #line 62
- unsigned char result;
- #line 62
- #line 62
- result = HPLUART0M$UART$init();
- #line 62
- #line 62
- return result;
- #line 62
- }
- #line 62
- static inline
- # 68 "/home/testuser/tinyos-1.x/tos/system/UARTM.nc"
- result_t UARTM$Control$start(void)
- #line 68
- {
- return UARTM$HPLUART$init();
- }
- # 70 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t FramerM$ByteControl$start(void){
- #line 70
- unsigned char result;
- #line 70
- #line 70
- result = UARTM$Control$start();
- #line 70
- #line 70
- return result;
- #line 70
- }
- #line 70
- static inline
- # 296 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
- result_t FramerM$StdControl$start(void)
- #line 296
- {
- FramerM$HDLCInitialize();
- return FramerM$ByteControl$start();
- }
- # 70 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t AMPromiscuous$UARTControl$start(void){
- #line 70
- unsigned char result;
- #line 70
- #line 70
- result = FramerM$StdControl$start();
- #line 70
- #line 70
- return result;
- #line 70
- }
- #line 70
- inline static result_t AMPromiscuous$TimerControl$start(void){
- #line 70
- unsigned char result;
- #line 70
- #line 70
- result = TimerM$StdControl$start();
- #line 70
- #line 70
- return result;
- #line 70
- }
- #line 70
- static inline
- # 109 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- result_t AMPromiscuous$Control$start(void)
- #line 109
- {
- result_t ok0;
- #line 110
- result_t ok1;
- #line 110
- result_t ok2;
- #line 110
- result_t ok3;
- ok0 = AMPromiscuous$TimerControl$start();
- ok1 = AMPromiscuous$UARTControl$start();
- ok2 = AMPromiscuous$RadioControl$start();
- ok3 = AMPromiscuous$ActivityTimer$start(TIMER_REPEAT, 1000);
- AMPromiscuous$PowerManagement$adjustPower();
- AMPromiscuous$state = FALSE;
- return rcombine4(ok0, ok1, ok2, ok3);
- }
- # 70 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t MultiHopEngineM$CommStdControl$start(void){
- #line 70
- unsigned char result;
- #line 70
- #line 70
- result = AMPromiscuous$Control$start();
- #line 70
- #line 70
- return result;
- #line 70
- }
- #line 70
- static inline
- # 107 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
- result_t MultiHopEngineM$StdControl$start(void)
- #line 107
- {
- MultiHopEngineM$CommStdControl$start();
- MultiHopEngineM$SubControl$start();
- return MultiHopEngineM$CommControl$setPromiscuous(TRUE);
- }
- # 70 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t RealMain$StdControl$start(void){
- #line 70
- unsigned char result;
- #line 70
- #line 70
- result = TimerM$StdControl$start();
- #line 70
- result = rcombine(result, MultiHopEngineM$StdControl$start());
- #line 70
- result = rcombine(result, TimerM$StdControl$start());
- #line 70
- result = rcombine(result, MultiHopTtestM$StdControl$start());
- #line 70
- #line 70
- return result;
- #line 70
- }
- #line 70
- static inline
- # 64 "../../tos/platform/mica2/HPLPowerManagementM.nc"
- uint8_t HPLPowerManagementM$getPowerLevel(void)
- #line 64
- {
- uint8_t diff;
- #line 66
- if (* (volatile uint8_t *)(0x37 + 0x20) & ~((1 << 1) | (1 << 0))) {
- return HPLPowerManagementM$IDLE;
- }
- else {
- #line 69
- if (* (volatile uint8_t *)(uint16_t )& * (volatile uint8_t *)(0x0D + 0x20) & (1 << 7)) {
- return HPLPowerManagementM$IDLE;
- }
- else {
- if (* (volatile uint8_t *)(uint16_t )& * (volatile uint8_t *)(0x06 + 0x20) & (1 << 7)) {
- return HPLPowerManagementM$ADC_NR;
- }
- else {
- #line 75
- if (* (volatile uint8_t *)(0x37 + 0x20) & ((1 << 1) | (1 << 0))) {
- diff = * (volatile uint8_t *)(0x31 + 0x20) - * (volatile uint8_t *)(0x32 + 0x20);
- if (diff < 16) {
- return HPLPowerManagementM$EXT_STANDBY;
- }
- #line 79
- return HPLPowerManagementM$POWER_SAVE;
- }
- else
- #line 80
- {
- return HPLPowerManagementM$POWER_DOWN;
- }
- }
- }
- }
- }
- static inline
- #line 85
- void HPLPowerManagementM$doAdjustment(void)
- #line 85
- {
- uint8_t foo;
- #line 86
- uint8_t mcu;
- #line 87
- HPLPowerManagementM$powerLevel = foo = HPLPowerManagementM$getPowerLevel();
- mcu = * (volatile uint8_t *)(0x35 + 0x20);
- mcu &= 0xe3;
- if (foo == HPLPowerManagementM$EXT_STANDBY || foo == HPLPowerManagementM$POWER_SAVE) {
- mcu |= HPLPowerManagementM$IDLE;
- while ((* (volatile uint8_t *)(0x30 + 0x20) & 0x7) != 0) {
- __asm volatile ("nop");}
- mcu &= 0xe3;
- }
- mcu |= foo;
- * (volatile uint8_t *)(0x35 + 0x20) = mcu;
- * (volatile uint8_t *)(0x35 + 0x20) |= 1 << 5;
- }
- static inline
- # 63 "/home/testuser/tinyos-1.x/tos/system/NoLeds.nc"
- result_t NoLeds$Leds$redToggle(void)
- #line 63
- {
- return SUCCESS;
- }
- # 81 "/home/testuser/tinyos-1.x/tos/interfaces/Leds.nc"
- inline static result_t MultiHopWMEWMA$Leds$redToggle(void){
- #line 81
- unsigned char result;
- #line 81
- #line 81
- result = NoLeds$Leds$redToggle();
- #line 81
- #line 81
- return result;
- #line 81
- }
- #line 81
- static inline
- # 268 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- void MultiHopWMEWMA$updateEst(MultiHopWMEWMA$TableEntry *Nbr)
- #line 268
- {
- uint16_t usExpTotal;
- #line 269
- uint16_t usActTotal;
- #line 269
- uint16_t newAve;
- if (Nbr->flags & MultiHopWMEWMA$NBRFLAG_NEW) {
- return;
- }
- usExpTotal = MultiHopWMEWMA$ESTIMATE_TO_ROUTE_RATIO;
- {
- }
- #line 278
- ;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 281
- {
- usActTotal = Nbr->received + Nbr->missed;
- if (usActTotal < usExpTotal) {
- usActTotal = usExpTotal;
- }
- newAve = (uint16_t )255 * (uint16_t )Nbr->received / (uint16_t )usActTotal;
- Nbr->missed = 0;
- Nbr->received = 0;
- if (Nbr->liveliness == 0) {
- Nbr->sendEst >>= 1;
- }
- else
- #line 296
- {
- Nbr->liveliness--;
- }
- }
- #line 299
- __nesc_atomic_end(__nesc_atomic); }
- if (Nbr->flags & MultiHopWMEWMA$NBRFLAG_EST_INIT) {
- uint16_t tmp;
- #line 305
- tmp = (2 * (uint16_t )Nbr->receiveEst + (uint16_t )newAve * 6) / 8;
- Nbr->receiveEst = (uint8_t )tmp;
- }
- else {
- Nbr->receiveEst = (uint8_t )newAve;
- Nbr->flags ^= MultiHopWMEWMA$NBRFLAG_EST_INIT;
- }
- if (Nbr->childLiveliness > 0) {
- #line 313
- Nbr->childLiveliness--;
- }
- }
- static inline
- #line 316
- void MultiHopWMEWMA$updateTable(void)
- #line 316
- {
- MultiHopWMEWMA$TableEntry *pNbr;
- uint8_t i = 0;
- MultiHopWMEWMA$gwEstTicks++;
- MultiHopWMEWMA$gwEstTicks %= MultiHopWMEWMA$ESTIMATE_TO_ROUTE_RATIO;
- for (i = 0; i < MultiHopWMEWMA$ROUTE_TABLE_SIZE; i++) {
- pNbr = &MultiHopWMEWMA$NeighborTbl[i];
- if (pNbr->flags & MultiHopWMEWMA$NBRFLAG_VALID) {
- if (MultiHopWMEWMA$gwEstTicks == 0) {
- MultiHopWMEWMA$updateEst(pNbr);
- }
- }
- }
- }
- static inline
- # 75 "/home/testuser/tinyos-1.x/tos/system/NoLeds.nc"
- result_t NoLeds$Leds$greenToggle(void)
- #line 75
- {
- return SUCCESS;
- }
- # 106 "/home/testuser/tinyos-1.x/tos/interfaces/Leds.nc"
- inline static result_t MultiHopWMEWMA$Leds$greenToggle(void){
- #line 106
- unsigned char result;
- #line 106
- #line 106
- result = NoLeds$Leds$greenToggle();
- #line 106
- #line 106
- return result;
- #line 106
- }
- #line 106
- static inline
- # 369 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- void MultiHopWMEWMA$chooseParent(void)
- #line 369
- {
- MultiHopWMEWMA$TableEntry *pNbr;
- uint32_t ulNbrLinkCost = (uint32_t )-1;
- uint32_t ulNbrTotalCost = (uint32_t )-1;
- uint32_t oldParentCost = (uint32_t )-1;
- uint32_t oldParentLinkCost = (uint32_t )-1;
- uint32_t ulMinTotalCost = (uint32_t )-1;
- MultiHopWMEWMA$TableEntry *pNewParent = (void *)0;
- MultiHopWMEWMA$TableEntry *pOldParent = (void *)0;
- uint8_t i;
- if (TOS_LOCAL_ADDRESS == MultiHopWMEWMA$BASE_STATION_ADDRESS) {
- #line 380
- return;
- }
- for (i = 0; i < MultiHopWMEWMA$ROUTE_TABLE_SIZE; i++) {
- pNbr = &MultiHopWMEWMA$NeighborTbl[i];
- if (!(pNbr->flags & MultiHopWMEWMA$NBRFLAG_VALID)) {
- #line 389
- continue;
- }
- #line 390
- if (pNbr->parent == TOS_LOCAL_ADDRESS) {
- #line 390
- continue;
- }
- #line 391
- if (pNbr->parent == MultiHopWMEWMA$ROUTE_INVALID) {
- #line 391
- continue;
- }
- #line 392
- if (pNbr->hop == MultiHopWMEWMA$ROUTE_INVALID) {
- #line 392
- continue;
- }
- #line 393
- if (pNbr->cost == (uint16_t )MultiHopWMEWMA$ROUTE_INVALID) {
- #line 393
- continue;
- }
- #line 394
- if (pNbr->sendEst < 25 || pNbr->receiveEst < 25) {
- #line 394
- continue;
- }
- #line 395
- if (pNbr->childLiveliness > 0) {
- #line 395
- continue;
- }
- ulNbrLinkCost = MultiHopWMEWMA$evaluateCost(0, pNbr->sendEst, pNbr->receiveEst);
- ulNbrTotalCost = MultiHopWMEWMA$evaluateCost(pNbr->cost, pNbr->sendEst, pNbr->receiveEst);
- MultiHopWMEWMA$Leds$greenToggle();
- if (ulNbrLinkCost > MultiHopWMEWMA$MAX_ALLOWABLE_LINK_COST) {
- #line 401
- continue;
- }
- #line 402
- {
- }
- #line 402
- ;
- if (pNbr == MultiHopWMEWMA$gpCurrentParent) {
- pOldParent = pNbr;
- oldParentCost = ulNbrTotalCost;
- oldParentLinkCost = ulNbrLinkCost;
- continue;
- }
- if (ulMinTotalCost > ulNbrTotalCost) {
- ulMinTotalCost = ulNbrTotalCost;
- pNewParent = pNbr;
- }
- }
- if (pNewParent == (void *)0) {
- pNewParent = pOldParent;
- ulMinTotalCost = oldParentCost;
- }
- else {
- #line 422
- if (pOldParent != (void *)0 &&
- oldParentCost < MultiHopWMEWMA$SWITCH_THRESHOLD + ulMinTotalCost) {
- pNewParent = pOldParent;
- ulMinTotalCost = oldParentCost;
- }
- }
- if (pNewParent) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 430
- {
- MultiHopWMEWMA$gpCurrentParent = pNewParent;
- MultiHopWMEWMA$gbCurrentHopCount = pNewParent->hop + 1;
- MultiHopWMEWMA$gbCurrentCost = ulMinTotalCost >> 6;
- }
- #line 434
- __nesc_atomic_end(__nesc_atomic); }
- }
- else
- #line 435
- {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 436
- {
- MultiHopWMEWMA$gpCurrentParent = (void *)0;
- MultiHopWMEWMA$gbCurrentHopCount = MultiHopWMEWMA$ROUTE_INVALID;
- MultiHopWMEWMA$gbCurrentCost = MultiHopWMEWMA$ROUTE_INVALID;
- }
- #line 440
- __nesc_atomic_end(__nesc_atomic); }
- }
- }
- # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
- inline static result_t MultiHopWMEWMA$ATimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10){
- #line 59
- unsigned char result;
- #line 59
- #line 59
- result = TimerM$Timer$start(9, arg_0x8561bb8, arg_0x8561d10);
- #line 59
- #line 59
- return result;
- #line 59
- }
- #line 59
- static
- # 187 "/home/testuser/tinyos-1.x/tos/platform/avrmote/avrhardware.h"
- __inline void __nesc_enable_interrupt(void)
- #line 187
- {
- __asm volatile ("sei");}
- #line 172
- __inline void __nesc_atomic_end(__nesc_atomic_t oldSreg)
- {
- * (volatile uint8_t *)(0x3F + 0x20) = oldSreg;
- }
- static inline
- #line 150
- void TOSH_wait(void)
- {
- __asm volatile ("nop");
- __asm volatile ("nop");}
- static
- #line 179
- __inline void __nesc_atomic_sleep(void)
- {
- __asm volatile ("sei");
- __asm volatile ("sleep");
- TOSH_wait();
- }
- #line 165
- __inline __nesc_atomic_t __nesc_atomic_start(void )
- {
- __nesc_atomic_t result = * (volatile uint8_t *)(0x3F + 0x20);
- #line 168
- __asm volatile ("cli");
- return result;
- }
- static inline
- # 136 "/home/testuser/tinyos-1.x/tos/system/sched.c"
- bool TOSH_run_next_task(void)
- {
- __nesc_atomic_t fInterruptFlags;
- uint8_t old_full;
- void (*func)(void );
- fInterruptFlags = __nesc_atomic_start();
- old_full = TOSH_sched_full;
- func = TOSH_queue[old_full].tp;
- if (func == (void *)0)
- {
- __nesc_atomic_sleep();
- return 0;
- }
- TOSH_queue[old_full].tp = (void *)0;
- TOSH_sched_full = (old_full + 1) & TOSH_TASK_BITMASK;
- __nesc_atomic_end(fInterruptFlags);
- func();
- return 1;
- }
- static inline void TOSH_run_task(void)
- #line 159
- {
- for (; ; )
- TOSH_run_next_task();
- }
- static inline
- # 87 "/home/testuser/tinyos-1.x/tos/system/NoLeds.nc"
- result_t NoLeds$Leds$yellowToggle(void)
- #line 87
- {
- return SUCCESS;
- }
- # 131 "/home/testuser/tinyos-1.x/tos/interfaces/Leds.nc"
- inline static result_t MultiHopWMEWMA$Leds$yellowToggle(void){
- #line 131
- unsigned char result;
- #line 131
- #line 131
- result = NoLeds$Leds$yellowToggle();
- #line 131
- #line 131
- return result;
- #line 131
- }
- #line 131
- static inline
- # 797 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- TOS_MsgPtr MultiHopWMEWMA$ReceiveMsg$receive(TOS_MsgPtr Msg)
- #line 797
- {
- TOS_MHopMsg *pMHMsg = (TOS_MHopMsg *)&Msg->data[0];
- MultiHopWMEWMA$RoutePacket *pRP = (MultiHopWMEWMA$RoutePacket *)&pMHMsg->data[0];
- uint16_t saddr;
- uint8_t i;
- #line 801
- uint8_t iNbr;
- MultiHopWMEWMA$Leds$yellowToggle();
- saddr = pMHMsg->sourceaddr;
- MultiHopWMEWMA$updateNbrCounters(saddr, pMHMsg->seqno, &iNbr);
- MultiHopWMEWMA$NeighborTbl[iNbr].parent = pRP->parent;
- MultiHopWMEWMA$NeighborTbl[iNbr].hop = pMHMsg->hopcount;
- MultiHopWMEWMA$NeighborTbl[iNbr].cost = pRP->cost;
- if (MultiHopWMEWMA$NeighborTbl[iNbr].childLiveliness > 0 && pRP->parent != TOS_LOCAL_ADDRESS) {
- MultiHopWMEWMA$NeighborTbl[iNbr].childLiveliness = 0;
- }
- for (i = 0; i < pRP->estEntries; i++) {
- if (pRP->estList[i].id == TOS_LOCAL_ADDRESS) {
- MultiHopWMEWMA$NeighborTbl[iNbr].sendEst = pRP->estList[i].receiveEst;
- MultiHopWMEWMA$NeighborTbl[iNbr].liveliness = MultiHopWMEWMA$LIVELINESS;
- }
- }
- return Msg;
- }
- static inline
- # 271 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- TOS_MsgPtr AMPromiscuous$ReceiveMsg$default$receive(uint8_t id, TOS_MsgPtr msg)
- #line 271
- {
- return msg;
- }
- # 75 "/home/testuser/tinyos-1.x/tos/interfaces/ReceiveMsg.nc"
- inline static TOS_MsgPtr AMPromiscuous$ReceiveMsg$receive(uint8_t arg_0x85aae88, TOS_MsgPtr arg_0x85b1db0){
- #line 75
- struct TOS_Msg *result;
- #line 75
- #line 75
- switch (arg_0x85aae88) {
- #line 75
- case 3:
- #line 75
- result = MultiHopEngineM$ReceiveMsg$receive(3, arg_0x85b1db0);
- #line 75
- break;
- #line 75
- case AM_MULTIHOP:
- #line 75
- result = MultiHopEngineM$ReceiveMsg$receive(AM_MULTIHOP, arg_0x85b1db0);
- #line 75
- break;
- #line 75
- case AM_MULTIHOPMSG:
- #line 75
- result = MultiHopWMEWMA$ReceiveMsg$receive(arg_0x85b1db0);
- #line 75
- break;
- #line 75
- default:
- #line 75
- result = AMPromiscuous$ReceiveMsg$default$receive(arg_0x85aae88, arg_0x85b1db0);
- #line 75
- }
- #line 75
- #line 75
- return result;
- #line 75
- }
- #line 75
- static inline
- # 174 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- uint8_t MultiHopWMEWMA$findEntryToBeReplaced(void)
- #line 174
- {
- uint8_t i = 0;
- uint8_t minSendEst = -1;
- uint8_t minSendEstIndex = MultiHopWMEWMA$ROUTE_INVALID;
- #line 178
- for (i = 0; i < MultiHopWMEWMA$ROUTE_TABLE_SIZE; i++) {
- if ((MultiHopWMEWMA$NeighborTbl[i].flags & MultiHopWMEWMA$NBRFLAG_VALID) == 0) {
- return i;
- }
- if (minSendEst >= MultiHopWMEWMA$NeighborTbl[i].sendEst) {
- minSendEst = MultiHopWMEWMA$NeighborTbl[i].sendEst;
- minSendEstIndex = i;
- }
- }
- return minSendEstIndex;
- }
- static inline
- #line 226
- uint8_t MultiHopWMEWMA$findPreparedIndex(uint16_t id)
- #line 226
- {
- uint8_t indes = MultiHopWMEWMA$findEntry(id);
- #line 228
- if (indes == (uint8_t )MultiHopWMEWMA$ROUTE_INVALID) {
- indes = MultiHopWMEWMA$findEntryToBeReplaced();
- MultiHopWMEWMA$newEntry(indes, id);
- }
- return indes;
- }
- static inline
- # 98 "MultiHopTtestM.nc"
- result_t MultiHopTtestM$Intercept$intercept(TOS_MsgPtr m, void *payload, uint16_t payloadLen)
- #line 98
- {
- multiHopMsg *hData = (multiHopMsg *)payload;
- #line 100
- if (hData->sendID < 50) {
- MultiHopTtestM$eachCount[hData->sendID]++;
- MultiHopTtestM$Rcount++;
- }
- return SUCCESS;
- }
- static inline
- # 250 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
- result_t MultiHopEngineM$Intercept$default$intercept(uint8_t id, TOS_MsgPtr pMsg, void *payload,
- uint16_t payloadLen)
- #line 251
- {
- return SUCCESS;
- }
- # 86 "/home/testuser/tinyos-1.x/tos/interfaces/Intercept.nc"
- inline static result_t MultiHopEngineM$Intercept$intercept(uint8_t arg_0x8913f48, TOS_MsgPtr arg_0x854f548, void *arg_0x854f6a0, uint16_t arg_0x854f7f8){
- #line 86
- unsigned char result;
- #line 86
- #line 86
- switch (arg_0x8913f48) {
- #line 86
- case AM_MULTIHOP:
- #line 86
- result = MultiHopTtestM$Intercept$intercept(arg_0x854f548, arg_0x854f6a0, arg_0x854f7f8);
- #line 86
- break;
- #line 86
- default:
- #line 86
- result = MultiHopEngineM$Intercept$default$intercept(arg_0x8913f48, arg_0x854f548, arg_0x854f6a0, arg_0x854f7f8);
- #line 86
- }
- #line 86
- #line 86
- return result;
- #line 86
- }
- #line 86
- # 48 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
- inline static result_t MultiHopEngineM$SendMsg$send(uint8_t arg_0x89175b0, uint16_t arg_0x85a9e28, uint8_t arg_0x85b0010, TOS_MsgPtr arg_0x85b0160){
- #line 48
- unsigned char result;
- #line 48
- #line 48
- result = QueuedSendM$QueueSendMsg$send(arg_0x89175b0, arg_0x85a9e28, arg_0x85b0010, arg_0x85b0160);
- #line 48
- #line 48
- return result;
- #line 48
- }
- #line 48
- # 71 "/home/testuser/tinyos-1.x/tos/interfaces/RouteSelect.nc"
- inline static result_t MultiHopEngineM$RouteSelect$selectRoute(TOS_MsgPtr arg_0x89392f8, uint8_t arg_0x8939440){
- #line 71
- unsigned char result;
- #line 71
- #line 71
- result = MultiHopWMEWMA$RouteSelect$selectRoute(arg_0x89392f8, arg_0x8939440);
- #line 71
- #line 71
- return result;
- #line 71
- }
- #line 71
- # 161 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
- static TOS_MsgPtr MultiHopEngineM$mForward(TOS_MsgPtr pMsg, uint8_t id)
- #line 161
- {
- TOS_MsgPtr pNewBuf = pMsg;
- if ((MultiHopEngineM$iFwdBufHead + 1) % MultiHopEngineM$FWD_QUEUE_SIZE == MultiHopEngineM$iFwdBufTail) {
- return pNewBuf;
- }
- if (MultiHopEngineM$RouteSelect$selectRoute(pMsg, id) != SUCCESS) {
- return pNewBuf;
- }
- if (MultiHopEngineM$SendMsg$send(id, pMsg->addr, pMsg->length, pMsg) == SUCCESS) {
- pNewBuf = MultiHopEngineM$FwdBufList[MultiHopEngineM$iFwdBufHead];
- MultiHopEngineM$FwdBufList[MultiHopEngineM$iFwdBufHead] = pMsg;
- MultiHopEngineM$iFwdBufHead++;
- #line 175
- MultiHopEngineM$iFwdBufHead %= MultiHopEngineM$FWD_QUEUE_SIZE;
- }
- return pNewBuf;
- }
- static inline
- # 657 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- void MultiHopWMEWMA$updateDescendant(uint16_t id)
- #line 657
- {
- uint8_t indes = MultiHopWMEWMA$findEntry(id);
- #line 659
- if (indes == (uint8_t )MultiHopWMEWMA$ROUTE_INVALID) {
- #line 659
- return;
- }
- else
- #line 660
- {
- MultiHopWMEWMA$NeighborTbl[indes].childLiveliness = MultiHopWMEWMA$MAX_DESCENDANT_LIVE;
- }
- }
- # 106 "/home/testuser/tinyos-1.x/tos/interfaces/Leds.nc"
- inline static result_t QueuedSendM$Leds$greenToggle(void){
- #line 106
- unsigned char result;
- #line 106
- #line 106
- result = NoLeds$Leds$greenToggle();
- #line 106
- #line 106
- return result;
- #line 106
- }
- #line 106
- static inline
- # 159 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- void AMPromiscuous$dbgPacket(TOS_MsgPtr data)
- #line 159
- {
- uint8_t i;
- for (i = 0; i < sizeof(TOS_Msg ); i++)
- {
- {
- }
- #line 164
- ;
- }
- {
- }
- #line 166
- ;
- }
- # 58 "/home/testuser/tinyos-1.x/tos/interfaces/BareSendMsg.nc"
- inline static result_t AMPromiscuous$RadioSend$send(TOS_MsgPtr arg_0x85bab68){
- #line 58
- unsigned char result;
- #line 58
- #line 58
- result = CC1000RadioIntM$Send$send(arg_0x85bab68);
- #line 58
- #line 58
- return result;
- #line 58
- }
- #line 58
- static inline
- # 306 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
- result_t FramerM$BareSendMsg$send(TOS_MsgPtr pMsg)
- #line 306
- {
- result_t Result = SUCCESS;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 309
- {
- if (!(FramerM$gFlags & FramerM$FLAGS_DATAPEND)) {
- FramerM$gFlags |= FramerM$FLAGS_DATAPEND;
- FramerM$gpTxMsg = pMsg;
- }
- else
- {
- Result = FAIL;
- }
- }
- #line 319
- __nesc_atomic_end(__nesc_atomic); }
- if (Result == SUCCESS) {
- Result = FramerM$StartTx();
- }
- return Result;
- }
- # 58 "/home/testuser/tinyos-1.x/tos/interfaces/BareSendMsg.nc"
- inline static result_t AMPromiscuous$UARTSend$send(TOS_MsgPtr arg_0x85bab68){
- #line 58
- unsigned char result;
- #line 58
- #line 58
- result = FramerM$BareSendMsg$send(arg_0x85bab68);
- #line 58
- #line 58
- return result;
- #line 58
- }
- #line 58
- static inline
- # 193 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- void AMPromiscuous$sendTask(void)
- #line 193
- {
- result_t ok;
- if (AMPromiscuous$buffer->addr == TOS_UART_ADDR) {
- ok = AMPromiscuous$UARTSend$send(AMPromiscuous$buffer);
- }
- else {
- #line 199
- ok = AMPromiscuous$RadioSend$send(AMPromiscuous$buffer);
- }
- if (ok == FAIL) {
- AMPromiscuous$reportSendDone(AMPromiscuous$buffer, FAIL);
- }
- }
- # 106 "/home/testuser/tinyos-1.x/tos/interfaces/Leds.nc"
- inline static result_t AMPromiscuous$Leds$greenToggle(void){
- #line 106
- unsigned char result;
- #line 106
- #line 106
- result = NoLeds$Leds$greenToggle();
- #line 106
- #line 106
- return result;
- #line 106
- }
- #line 106
- static inline
- # 206 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- result_t AMPromiscuous$SendMsg$send(uint8_t id, uint16_t addr, uint8_t length, TOS_MsgPtr data)
- #line 206
- {
- if (!AMPromiscuous$state) {
- AMPromiscuous$state = TRUE;
- AMPromiscuous$Leds$greenToggle();
- if (length > DATA_LENGTH) {
- {
- }
- #line 212
- ;
- AMPromiscuous$state = FALSE;
- return FAIL;
- }
- if (!TOS_post(AMPromiscuous$sendTask)) {
- {
- }
- #line 217
- ;
- AMPromiscuous$state = FALSE;
- return FAIL;
- }
- else {
- AMPromiscuous$buffer = data;
- data->length = length;
- data->addr = addr;
- data->type = id;
- AMPromiscuous$buffer->group = TOS_AM_GROUP;
- AMPromiscuous$dbgPacket(data);
- {
- }
- #line 228
- ;
- }
- return SUCCESS;
- }
- return FAIL;
- }
- # 48 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
- inline static result_t QueuedSendM$SerialSendMsg$send(uint8_t arg_0x89a2998, uint16_t arg_0x85a9e28, uint8_t arg_0x85b0010, TOS_MsgPtr arg_0x85b0160){
- #line 48
- unsigned char result;
- #line 48
- #line 48
- result = AMPromiscuous$SendMsg$send(arg_0x89a2998, arg_0x85a9e28, arg_0x85b0010, arg_0x85b0160);
- #line 48
- #line 48
- return result;
- #line 48
- }
- #line 48
- static inline
- # 105 "../../tos/platform/mica2/HPLUART0M.nc"
- result_t HPLUART0M$UART$put(uint8_t data)
- #line 105
- {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 106
- {
- * (volatile uint8_t *)(0x0C + 0x20) = data;
- * (volatile uint8_t *)(0x0B + 0x20) |= 1 << 6;
- }
- #line 109
- __nesc_atomic_end(__nesc_atomic); }
- return SUCCESS;
- }
- # 80 "/home/testuser/tinyos-1.x/tos/interfaces/HPLUART.nc"
- inline static result_t UARTM$HPLUART$put(uint8_t arg_0x88d4ac8){
- #line 80
- unsigned char result;
- #line 80
- #line 80
- result = HPLUART0M$UART$put(arg_0x88d4ac8);
- #line 80
- #line 80
- return result;
- #line 80
- }
- #line 80
- static inline
- # 236 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- result_t AMPromiscuous$UARTSend$sendDone(TOS_MsgPtr msg, result_t success)
- #line 236
- {
- return AMPromiscuous$reportSendDone(msg, success);
- }
- # 67 "/home/testuser/tinyos-1.x/tos/interfaces/BareSendMsg.nc"
- inline static result_t FramerM$BareSendMsg$sendDone(TOS_MsgPtr arg_0x85bb080, result_t arg_0x85bb1d0){
- #line 67
- unsigned char result;
- #line 67
- #line 67
- result = AMPromiscuous$UARTSend$sendDone(arg_0x85bb080, arg_0x85bb1d0);
- #line 67
- #line 67
- return result;
- #line 67
- }
- #line 67
- static inline
- # 845 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- result_t MultiHopWMEWMA$SendMsg$sendDone(TOS_MsgPtr pMsg, result_t success)
- #line 845
- {
- MultiHopWMEWMA$gfSendRouteBusy = FALSE;
- return SUCCESS;
- }
- # 49 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
- inline static result_t QueuedSendM$QueueSendMsg$sendDone(uint8_t arg_0x89a2010, TOS_MsgPtr arg_0x85b0580, result_t arg_0x85b06d0){
- #line 49
- unsigned char result;
- #line 49
- #line 49
- result = MultiHopEngineM$SendMsg$sendDone(arg_0x89a2010, arg_0x85b0580, arg_0x85b06d0);
- #line 49
- switch (arg_0x89a2010) {
- #line 49
- case AM_MULTIHOPMSG:
- #line 49
- result = rcombine(result, MultiHopWMEWMA$SendMsg$sendDone(arg_0x85b0580, arg_0x85b06d0));
- #line 49
- break;
- #line 49
- }
- #line 49
- #line 49
- return result;
- #line 49
- }
- #line 49
- # 81 "/home/testuser/tinyos-1.x/tos/interfaces/Leds.nc"
- inline static result_t QueuedSendM$Leds$redToggle(void){
- #line 81
- unsigned char result;
- #line 81
- #line 81
- result = NoLeds$Leds$redToggle();
- #line 81
- #line 81
- return result;
- #line 81
- }
- #line 81
- static inline
- # 188 "/home/testuser/tinyos-1.x/tos/lib/Queue/QueuedSendM.nc"
- result_t QueuedSendM$SerialSendMsg$sendDone(uint8_t id, TOS_MsgPtr msg, result_t success)
- #line 188
- {
- if (msg != QueuedSendM$msgqueue[QueuedSendM$dequeue_next].pMsg) {
- return FAIL;
- }
- if ((!QueuedSendM$retransmit || msg->ack != 0) || QueuedSendM$msgqueue[QueuedSendM$dequeue_next].address == TOS_UART_ADDR) {
- QueuedSendM$QueueSendMsg$sendDone(id, msg, success);
- QueuedSendM$msgqueue[QueuedSendM$dequeue_next].pMsg = (void *)0;
- {
- }
- #line 198
- ;
- QueuedSendM$dequeue_next++;
- #line 199
- QueuedSendM$dequeue_next %= QueuedSendM$MESSAGE_QUEUE_SIZE;
- }
- else
- {
- QueuedSendM$Leds$redToggle();
- if (++ QueuedSendM$msgqueue[QueuedSendM$dequeue_next].xmit_count > QueuedSendM$MAX_RETRANSMIT_COUNT) {
- QueuedSendM$QueueSendMsg$sendDone(id, msg, FAIL);
- QueuedSendM$msgqueue[QueuedSendM$dequeue_next].pMsg = (void *)0;
- QueuedSendM$dequeue_next++;
- #line 216
- QueuedSendM$dequeue_next %= QueuedSendM$MESSAGE_QUEUE_SIZE;
- }
- }
- TOS_post(QueuedSendM$QueueServiceTask);
- return SUCCESS;
- }
- # 49 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
- inline static result_t AMPromiscuous$SendMsg$sendDone(uint8_t arg_0x85aa8d0, TOS_MsgPtr arg_0x85b0580, result_t arg_0x85b06d0){
- #line 49
- unsigned char result;
- #line 49
- #line 49
- result = QueuedSendM$SerialSendMsg$sendDone(arg_0x85aa8d0, arg_0x85b0580, arg_0x85b06d0);
- #line 49
- #line 49
- return result;
- #line 49
- }
- #line 49
- static inline
- # 850 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- result_t MultiHopWMEWMA$DebugSendMsg$sendDone(TOS_MsgPtr pMsg, result_t success)
- #line 850
- {
- return SUCCESS;
- }
- static inline
- # 87 "MultiHopTtestM.nc"
- result_t MultiHopTtestM$Send$sendDone(TOS_MsgPtr msg, result_t success)
- #line 87
- {
- if (success == SUCCESS) {
- MultiHopTtestM$Scount++;
- }
- MultiHopTtestM$txBusy = FALSE;
- return SUCCESS;
- }
- static inline
- # 246 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
- result_t MultiHopEngineM$Send$default$sendDone(uint8_t id, TOS_MsgPtr pMsg, result_t success)
- #line 246
- {
- return SUCCESS;
- }
- # 119 "/home/testuser/tinyos-1.x/tos/interfaces/Send.nc"
- inline static result_t MultiHopEngineM$Send$sendDone(uint8_t arg_0x89138e0, TOS_MsgPtr arg_0x8563dd8, result_t arg_0x8563f28){
- #line 119
- unsigned char result;
- #line 119
- #line 119
- switch (arg_0x89138e0) {
- #line 119
- case 3:
- #line 119
- result = MultiHopWMEWMA$DebugSendMsg$sendDone(arg_0x8563dd8, arg_0x8563f28);
- #line 119
- break;
- #line 119
- case AM_MULTIHOP:
- #line 119
- result = MultiHopTtestM$Send$sendDone(arg_0x8563dd8, arg_0x8563f28);
- #line 119
- break;
- #line 119
- default:
- #line 119
- result = MultiHopEngineM$Send$default$sendDone(arg_0x89138e0, arg_0x8563dd8, arg_0x8563f28);
- #line 119
- }
- #line 119
- #line 119
- return result;
- #line 119
- }
- #line 119
- static inline
- # 188 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- result_t AMPromiscuous$default$sendDone(void)
- #line 188
- {
- return SUCCESS;
- }
- #line 67
- inline static result_t AMPromiscuous$sendDone(void){
- #line 67
- unsigned char result;
- #line 67
- #line 67
- result = AMPromiscuous$default$sendDone();
- #line 67
- #line 67
- return result;
- #line 67
- }
- #line 67
- # 63 "/home/testuser/tinyos-1.x/tos/interfaces/Random.nc"
- inline static uint16_t CC1000RadioIntM$Random$rand(void){
- #line 63
- unsigned int result;
- #line 63
- #line 63
- result = RandomLFSR$Random$rand();
- #line 63
- #line 63
- return result;
- #line 63
- }
- #line 63
- static inline
- # 1796 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- int16_t CC1000RadioIntM$MacBackoff$default$initialBackoff(TOS_MsgPtr m)
- #line 1796
- {
- return (CC1000RadioIntM$Random$rand() & 0x1F) + 1;
- }
- # 39 "../../tos/platform/mica2/MacBackoff.nc"
- inline static int16_t CC1000RadioIntM$MacBackoff$initialBackoff(TOS_MsgPtr arg_0x85f7e60){
- #line 39
- int result;
- #line 39
- #line 39
- result = CC1000RadioIntM$MacBackoff$default$initialBackoff(arg_0x85f7e60);
- #line 39
- #line 39
- return result;
- #line 39
- }
- #line 39
- static inline
- # 245 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- uint16_t CC1000RadioIntM$getOwnerBackoff(void)
- #line 245
- {
- return (CC1000RadioIntM$Random$rand() & (8 - 1)) + 1;
- }
- static inline uint16_t CC1000RadioIntM$getNonOwnerBackoff(void)
- #line 249
- {
- return (CC1000RadioIntM$Random$rand() & (32 - 1)) + 8 + 1;
- }
- # 68 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
- inline static result_t CC1000RadioIntM$WakeupTimer$stop(void){
- #line 68
- unsigned char result;
- #line 68
- #line 68
- result = TimerM$Timer$stop(5);
- #line 68
- #line 68
- return result;
- #line 68
- }
- #line 68
- static inline
- # 832 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- result_t MultiHopWMEWMA$Snoop$intercept(uint8_t id, TOS_MsgPtr Msg, void *Payload, uint16_t Len)
- #line 832
- {
- TOS_MHopMsg *pMHMsg = (TOS_MHopMsg *)&Msg->data[0];
- uint8_t iNbr;
- MultiHopWMEWMA$updateNbrCounters(pMHMsg->sourceaddr, pMHMsg->seqno, &iNbr);
- return SUCCESS;
- }
- # 86 "/home/testuser/tinyos-1.x/tos/interfaces/Intercept.nc"
- inline static result_t MultiHopEngineM$Snoop$intercept(uint8_t arg_0x8916490, TOS_MsgPtr arg_0x854f548, void *arg_0x854f6a0, uint16_t arg_0x854f7f8){
- #line 86
- unsigned char result;
- #line 86
- #line 86
- result = MultiHopWMEWMA$Snoop$intercept(arg_0x8916490, arg_0x854f548, arg_0x854f6a0, arg_0x854f7f8);
- #line 86
- #line 86
- return result;
- #line 86
- }
- #line 86
- # 37 "../../tos/platform/mica2/SpiByteFifo.nc"
- inline static result_t CC1000RadioIntM$SpiByteFifo$disableIntr(void){
- #line 37
- unsigned char result;
- #line 37
- #line 37
- result = HPLSpiM$SpiByteFifo$disableIntr();
- #line 37
- #line 37
- return result;
- #line 37
- }
- #line 37
- static inline
- # 1606 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- void CC1000RadioIntM$SleepTimerTask(void)
- #line 1606
- {
- CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, CC1000RadioIntM$sleeptime);
- }
- static inline
- # 469 "../../tos/platform/mica2/CC1000ControlM.nc"
- result_t CC1000ControlM$StdControl$stop(void)
- #line 469
- {
- CC1000ControlM$HPLChipcon$write(0x00, (((((
- 1 << 5) | (1 << 4)) | (
- 1 << 3)) | (1 << 2)) | (1 << 1)) | (
- 1 << 0));
- CC1000ControlM$HPLChipcon$write(0x0B, 0x00);
- return SUCCESS;
- }
- # 78 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
- inline static result_t CC1000RadioIntM$CC1000StdControl$stop(void){
- #line 78
- unsigned char result;
- #line 78
- #line 78
- result = CC1000ControlM$StdControl$stop();
- #line 78
- #line 78
- return result;
- #line 78
- }
- #line 78
- static inline
- # 222 "../../tos/platform/mica2/ADCREFM.nc"
- result_t ADCREFM$ADC$getData(uint8_t port)
- #line 222
- {
- result_t Result;
- #line 224
- if (port > TOSH_ADC_PORTMAPSIZE) {
- return FAIL;
- }
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 228
- {
- Result = ADCREFM$startGet(port);
- }
- #line 230
- __nesc_atomic_end(__nesc_atomic); }
- return Result;
- }
- # 52 "/home/testuser/tinyos-1.x/tos/interfaces/ADC.nc"
- inline static result_t CC1000RadioIntM$RSSIADC$getData(void){
- #line 52
- unsigned char result;
- #line 52
- #line 52
- result = ADCREFM$ADC$getData(TOS_ADC_CC_RSSI_PORT);
- #line 52
- #line 52
- return result;
- #line 52
- }
- #line 52
- static inline
- # 1724 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- uint16_t CC1000RadioIntM$GetSquelch(void)
- #line 1724
- {
- return CC1000RadioIntM$usSquelchVal;
- }
- static inline
- #line 1800
- int16_t CC1000RadioIntM$MacBackoff$default$congestionBackoff(TOS_MsgPtr m)
- #line 1800
- {
- CC1000RadioIntM$congBackOffs++;
- return (CC1000RadioIntM$Random$rand() & 0xF) + 1;
- }
- # 40 "../../tos/platform/mica2/MacBackoff.nc"
- inline static int16_t CC1000RadioIntM$MacBackoff$congestionBackoff(TOS_MsgPtr arg_0x85fe310){
- #line 40
- int result;
- #line 40
- #line 40
- result = CC1000RadioIntM$MacBackoff$default$congestionBackoff(arg_0x85fe310);
- #line 40
- #line 40
- return result;
- #line 40
- }
- #line 40
- # 143 "../../tos/platform/mica2/hardware.h"
- static __inline void TOSH_MAKE_MOSI_OUTPUT(void)
- #line 143
- {
- #line 143
- * (volatile uint8_t *)(0x17 + 0x20) |= 1 << 2;
- }
- #line 144
- static __inline void TOSH_MAKE_MISO_OUTPUT(void)
- #line 144
- {
- #line 144
- * (volatile uint8_t *)(0x17 + 0x20) |= 1 << 3;
- }
- static inline
- # 103 "../../tos/platform/mica2/HPLSpiM.nc"
- result_t HPLSpiM$SpiByteFifo$txMode(void)
- #line 103
- {
- TOSH_MAKE_MISO_OUTPUT();
- TOSH_MAKE_MOSI_OUTPUT();
- return SUCCESS;
- }
- # 39 "../../tos/platform/mica2/SpiByteFifo.nc"
- inline static result_t CC1000RadioIntM$SpiByteFifo$txMode(void){
- #line 39
- unsigned char result;
- #line 39
- #line 39
- result = HPLSpiM$SpiByteFifo$txMode();
- #line 39
- #line 39
- return result;
- #line 39
- }
- #line 39
- # 108 "../../tos/platform/mica2/CC1000Control.nc"
- inline static result_t CC1000RadioIntM$CC1000Control$TxMode(void){
- #line 108
- unsigned char result;
- #line 108
- #line 108
- result = CC1000ControlM$CC1000Control$TxMode();
- #line 108
- #line 108
- return result;
- #line 108
- }
- #line 108
- static inline
- # 59 "../../tos/platform/mica2/HPLSpiM.nc"
- result_t HPLSpiM$SpiByteFifo$writeByte(uint8_t data)
- #line 59
- {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 62
- HPLSpiM$OutgoingByte = data;
- #line 62
- __nesc_atomic_end(__nesc_atomic); }
- return SUCCESS;
- }
- # 33 "../../tos/platform/mica2/SpiByteFifo.nc"
- inline static result_t CC1000RadioIntM$SpiByteFifo$writeByte(uint8_t arg_0x8634010){
- #line 33
- unsigned char result;
- #line 33
- #line 33
- result = HPLSpiM$SpiByteFifo$writeByte(arg_0x8634010);
- #line 33
- #line 33
- return result;
- #line 33
- }
- #line 33
- static inline
- # 1610 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- result_t CC1000RadioIntM$RSSIADC$dataReady(uint16_t data)
- #line 1610
- {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 1611
- {
- uint8_t currentRadioState;
- currentRadioState = CC1000RadioIntM$RadioState;
- switch (currentRadioState) {
- case CC1000RadioIntM$IDLE_STATE:
- if (CC1000RadioIntM$RSSIInitState == CC1000RadioIntM$IDLE_STATE) {
- CC1000RadioIntM$usTempSquelch = data;
- TOS_post(CC1000RadioIntM$adjustSquelch);
- }
- CC1000RadioIntM$RSSIInitState = CC1000RadioIntM$NULL_STATE;
- break;
- case CC1000RadioIntM$RX_STATE:
- if (CC1000RadioIntM$RSSIInitState == CC1000RadioIntM$RX_STATE) {
- CC1000RadioIntM$usRSSIVal = data;
- }
- CC1000RadioIntM$RSSIInitState = CC1000RadioIntM$NULL_STATE;
- break;
- case CC1000RadioIntM$PRETX_STATE:
- CC1000RadioIntM$iRSSIcount++;
- if ((
- #line 1636
- data > CC1000RadioIntM$usSquelchVal + 16 ||
- !CC1000RadioIntM$bCCAEnable) && CC1000RadioIntM$RSSIInitState == CC1000RadioIntM$PRETX_STATE) {
- CC1000RadioIntM$SpiByteFifo$writeByte(0xaa);
- CC1000RadioIntM$CC1000Control$TxMode();
- CC1000RadioIntM$SpiByteFifo$txMode();
- CC1000RadioIntM$usRSSIVal = data;
- CC1000RadioIntM$iRSSIcount = 5;
- CC1000RadioIntM$bRSSIValid = TRUE;
- CC1000RadioIntM$TxByteCnt = 0;
- CC1000RadioIntM$usRunningCRC = 0;
- CC1000RadioIntM$RadioState = CC1000RadioIntM$TX_STATE;
- CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_PREAMBLE;
- CC1000RadioIntM$NextTxByte = 0xaa;
- CC1000RadioIntM$RSSIInitState = CC1000RadioIntM$NULL_STATE;
- }
- else {
- CC1000RadioIntM$RSSIInitState = CC1000RadioIntM$NULL_STATE;
- if (CC1000RadioIntM$iRSSIcount == 5) {
- CC1000RadioIntM$sMacDelay = CC1000RadioIntM$MacBackoff$congestionBackoff(CC1000RadioIntM$txbufptr);
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- }
- else {
- CC1000RadioIntM$RSSIInitState = currentRadioState;
- CC1000RadioIntM$RSSIADC$getData();
- }
- }
- break;
- case CC1000RadioIntM$PULSE_CHECK_STATE:
- {
- uint8_t done = 0;
- uint16_t threshold = CC1000RadioIntM$GetSquelch();
- #line 1672
- threshold = threshold - (CC1000RadioIntM$GetSquelch() >> 2);
- if (data > threshold) {
- CC1000RadioIntM$usTempSquelch = data;
- TOS_post(CC1000RadioIntM$adjustSquelch);
- }
- else {
- #line 1678
- if (CC1000RadioIntM$pulse_check_count > 5) {
- CC1000RadioIntM$CC1000Control$RxMode();
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- CC1000RadioIntM$SpiByteFifo$rxMode();
- CC1000RadioIntM$SpiByteFifo$enableIntr();
- TOS_post(CC1000RadioIntM$IdleTimerTask);
- done = 1;
- }
- else {
- CC1000RadioIntM$CC1000Control$RxMode();
- if (CC1000RadioIntM$RSSIADC$getData()) {
- TOSH_uwait(80);
- CC1000RadioIntM$pulse_check_count++;
- done = 1;
- }
- CC1000RadioIntM$pulse_check_sum++;
- CC1000RadioIntM$CC1000StdControl$stop();
- }
- }
- if (CC1000RadioIntM$bTxPending) {
- CC1000RadioIntM$CC1000Control$RxMode();
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- CC1000RadioIntM$SpiByteFifo$rxMode();
- CC1000RadioIntM$SpiByteFifo$enableIntr();
- TOS_post(CC1000RadioIntM$IdleTimerTask);
- done = 1;
- }
- if (done == 0) {
- TOS_post(CC1000RadioIntM$SleepTimerTask);
- CC1000RadioIntM$RadioState = CC1000RadioIntM$POWER_DOWN_STATE;
- CC1000RadioIntM$SpiByteFifo$disableIntr();
- }
- }
- break;
- default: ;
- }
- }
- #line 1719
- __nesc_atomic_end(__nesc_atomic); }
- return SUCCESS;
- }
- static inline
- # 118 "../../tos/platform/mica2/ADCREFM.nc"
- result_t ADCREFM$ADC$default$dataReady(uint8_t port, uint16_t data)
- #line 118
- {
- return FAIL;
- }
- # 70 "/home/testuser/tinyos-1.x/tos/interfaces/ADC.nc"
- inline static result_t ADCREFM$ADC$dataReady(uint8_t arg_0x87e1880, uint16_t arg_0x8636a60){
- #line 70
- unsigned char result;
- #line 70
- #line 70
- switch (arg_0x87e1880) {
- #line 70
- case TOS_ADC_CC_RSSI_PORT:
- #line 70
- result = CC1000RadioIntM$RSSIADC$dataReady(arg_0x8636a60);
- #line 70
- break;
- #line 70
- default:
- #line 70
- result = ADCREFM$ADC$default$dataReady(arg_0x87e1880, arg_0x8636a60);
- #line 70
- }
- #line 70
- #line 70
- return result;
- #line 70
- }
- #line 70
- static inline
- # 122 "../../tos/platform/mica2/ADCREFM.nc"
- result_t ADCREFM$CalADC$default$dataReady(uint8_t port, uint16_t data)
- #line 122
- {
- return FAIL;
- }
- # 70 "/home/testuser/tinyos-1.x/tos/interfaces/ADC.nc"
- inline static result_t ADCREFM$CalADC$dataReady(uint8_t arg_0x87e1f08, uint16_t arg_0x8636a60){
- #line 70
- unsigned char result;
- #line 70
- #line 70
- result = ADCREFM$CalADC$default$dataReady(arg_0x87e1f08, arg_0x8636a60);
- #line 70
- #line 70
- return result;
- #line 70
- }
- #line 70
- # 77 "/home/testuser/tinyos-1.x/tos/interfaces/HPLADC.nc"
- inline static result_t ADCREFM$HPLADC$samplePort(uint8_t arg_0x87f8690){
- #line 77
- unsigned char result;
- #line 77
- #line 77
- result = HPLADCM$ADC$samplePort(arg_0x87f8690);
- #line 77
- #line 77
- return result;
- #line 77
- }
- #line 77
- static inline
- # 133 "../../tos/platform/mica2/ADCREFM.nc"
- result_t ADCREFM$HPLADC$dataReady(uint16_t data)
- #line 133
- {
- uint16_t doneValue = data;
- uint8_t donePort;
- uint8_t nextPort = 0xff;
- bool fCalResult = FALSE;
- result_t Result = SUCCESS;
- #line 139
- if (ADCREFM$ReqPort == TOS_ADC_BANDGAP_PORT) {
- ADCREFM$RefVal = data;
- }
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 143
- {
- donePort = ADCREFM$ReqPort;
- if (((1 << donePort) & ADCREFM$ContReqMask) == 0) {
- ADCREFM$ReqVector ^= 1 << donePort;
- }
- if ((1 << donePort) & ADCREFM$CalReqMask) {
- fCalResult = TRUE;
- if (((1 << donePort) & ADCREFM$ContReqMask) == 0) {
- ADCREFM$CalReqMask ^= 1 << donePort;
- }
- }
- if (ADCREFM$ReqVector) {
- do {
- ADCREFM$ReqPort++;
- ADCREFM$ReqPort = ADCREFM$ReqPort == TOSH_ADC_PORTMAPSIZE ? 0 : ADCREFM$ReqPort;
- }
- while (((
- #line 164
- 1 << ADCREFM$ReqPort) & ADCREFM$ReqVector) == 0);
- nextPort = ADCREFM$ReqPort;
- }
- }
- #line 167
- __nesc_atomic_end(__nesc_atomic); }
- if (nextPort != 0xff) {
- ADCREFM$HPLADC$samplePort(nextPort);
- }
- {
- }
- #line 174
- ;
- if (donePort != TOS_ADC_BANDGAP_PORT) {
- if (fCalResult) {
- uint32_t tmp = (uint32_t )data;
- #line 178
- tmp = tmp << 10;
- tmp = tmp / ADCREFM$RefVal;
- doneValue = (uint16_t )tmp;
- Result = ADCREFM$CalADC$dataReady(donePort, doneValue);
- }
- else {
- Result = ADCREFM$ADC$dataReady(donePort, doneValue);
- }
- }
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 188
- {
- if (ADCREFM$ContReqMask & (1 << donePort) && Result == FAIL) {
- ADCREFM$ContReqMask ^= 1 << donePort;
- }
- }
- #line 192
- __nesc_atomic_end(__nesc_atomic); }
- return SUCCESS;
- }
- # 99 "/home/testuser/tinyos-1.x/tos/interfaces/HPLADC.nc"
- inline static result_t HPLADCM$ADC$dataReady(uint16_t arg_0x87f91b8){
- #line 99
- unsigned char result;
- #line 99
- #line 99
- result = ADCREFM$HPLADC$dataReady(arg_0x87f91b8);
- #line 99
- #line 99
- return result;
- #line 99
- }
- #line 99
- static inline
- # 97 "/home/testuser/tinyos-1.x/tos/platform/mica/HPLClock.nc"
- uint8_t HPLClock$Clock$getInterval(void)
- #line 97
- {
- return * (volatile uint8_t *)(0x31 + 0x20);
- }
- # 121 "/home/testuser/tinyos-1.x/tos/interfaces/Clock.nc"
- inline static uint8_t TimerM$Clock$getInterval(void){
- #line 121
- unsigned char result;
- #line 121
- #line 121
- result = HPLClock$Clock$getInterval();
- #line 121
- #line 121
- return result;
- #line 121
- }
- #line 121
- # 41 "/home/testuser/tinyos-1.x/tos/interfaces/PowerManagement.nc"
- inline static uint8_t TimerM$PowerManagement$adjustPower(void){
- #line 41
- unsigned char result;
- #line 41
- #line 41
- result = HPLPowerManagementM$PowerManagement$adjustPower();
- #line 41
- #line 41
- return result;
- #line 41
- }
- #line 41
- static inline
- # 87 "/home/testuser/tinyos-1.x/tos/platform/mica/HPLClock.nc"
- void HPLClock$Clock$setInterval(uint8_t value)
- #line 87
- {
- * (volatile uint8_t *)(0x31 + 0x20) = value;
- }
- # 105 "/home/testuser/tinyos-1.x/tos/interfaces/Clock.nc"
- inline static void TimerM$Clock$setInterval(uint8_t arg_0x882d378){
- #line 105
- HPLClock$Clock$setInterval(arg_0x882d378);
- #line 105
- }
- #line 105
- static inline
- # 134 "/home/testuser/tinyos-1.x/tos/platform/mica/HPLClock.nc"
- uint8_t HPLClock$Clock$readCounter(void)
- #line 134
- {
- return * (volatile uint8_t *)(0x32 + 0x20);
- }
- # 153 "/home/testuser/tinyos-1.x/tos/interfaces/Clock.nc"
- inline static uint8_t TimerM$Clock$readCounter(void){
- #line 153
- unsigned char result;
- #line 153
- #line 153
- result = HPLClock$Clock$readCounter();
- #line 153
- #line 153
- return result;
- #line 153
- }
- #line 153
- # 129 "/home/testuser/tinyos-1.x/tos/system/TimerM.nc"
- static void TimerM$adjustInterval(void)
- #line 129
- {
- uint8_t i;
- #line 130
- uint8_t val = TimerM$maxTimerInterval;
- #line 131
- if (TimerM$mState) {
- for (i = 0; i < NUM_TIMERS; i++) {
- if (TimerM$mState & (0x1L << i) && TimerM$mTimerList[i].ticksLeft < val) {
- val = TimerM$mTimerList[i].ticksLeft;
- }
- }
- #line 148
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 148
- {
- i = TimerM$Clock$readCounter() + 3;
- if (val < i) {
- val = i;
- }
- TimerM$mInterval = val;
- TimerM$Clock$setInterval(TimerM$mInterval);
- TimerM$setIntervalFlag = 0;
- }
- #line 156
- __nesc_atomic_end(__nesc_atomic); }
- }
- else {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 159
- {
- TimerM$mInterval = TimerM$maxTimerInterval;
- TimerM$Clock$setInterval(TimerM$mInterval);
- TimerM$setIntervalFlag = 0;
- }
- #line 163
- __nesc_atomic_end(__nesc_atomic); }
- }
- TimerM$PowerManagement$adjustPower();
- }
- static inline
- #line 186
- void TimerM$enqueue(uint8_t value)
- #line 186
- {
- if (TimerM$queue_tail == NUM_TIMERS - 1) {
- TimerM$queue_tail = -1;
- }
- #line 189
- TimerM$queue_tail++;
- TimerM$queue_size++;
- TimerM$queue[(uint8_t )TimerM$queue_tail] = value;
- }
- static inline
- # 722 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- result_t MultiHopWMEWMA$RouteSelect$initializeFields(TOS_MsgPtr Msg, uint8_t id)
- #line 722
- {
- TOS_MHopMsg *pMHMsg = (TOS_MHopMsg *)&Msg->data[0];
- pMHMsg->sourceaddr = pMHMsg->originaddr = TOS_LOCAL_ADDRESS;
- pMHMsg->hopcount = MultiHopWMEWMA$ROUTE_INVALID;
- return SUCCESS;
- }
- # 86 "/home/testuser/tinyos-1.x/tos/interfaces/RouteSelect.nc"
- inline static result_t MultiHopEngineM$RouteSelect$initializeFields(TOS_MsgPtr arg_0x89399b8, uint8_t arg_0x8939b00){
- #line 86
- unsigned char result;
- #line 86
- #line 86
- result = MultiHopWMEWMA$RouteSelect$initializeFields(arg_0x89399b8, arg_0x8939b00);
- #line 86
- #line 86
- return result;
- #line 86
- }
- #line 86
- static inline
- # 124 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
- result_t MultiHopEngineM$Send$send(uint8_t id, TOS_MsgPtr pMsg, uint16_t PayloadLen)
- #line 124
- {
- uint16_t usMHLength = (size_t )& ((TOS_MHopMsg *)0)->data + PayloadLen;
- if (usMHLength > 70) {
- return FAIL;
- }
- MultiHopEngineM$RouteSelect$initializeFields(pMsg, id);
- if (MultiHopEngineM$RouteSelect$selectRoute(pMsg, id) != SUCCESS) {
- return FAIL;
- }
- if (MultiHopEngineM$SendMsg$send(id, pMsg->addr, usMHLength, pMsg) != SUCCESS) {
- return FAIL;
- }
- return SUCCESS;
- }
- # 83 "/home/testuser/tinyos-1.x/tos/interfaces/Send.nc"
- inline static result_t MultiHopTtestM$Send$send(TOS_MsgPtr arg_0x8562cc0, uint16_t arg_0x8562e10){
- #line 83
- unsigned char result;
- #line 83
- #line 83
- result = MultiHopEngineM$Send$send(AM_MULTIHOP, arg_0x8562cc0, arg_0x8562e10);
- #line 83
- #line 83
- return result;
- #line 83
- }
- #line 83
- static inline
- # 107 "MultiHopTtestM.nc"
- result_t MultiHopTtestM$SendTimer$fired(void)
- #line 107
- {
- if (!MultiHopTtestM$txBusy && MultiHopTtestM$gotFrames) {
- if (MultiHopTtestM$Send$send(&MultiHopTtestM$DataPkt, sizeof(multiHopMsg )) == SUCCESS) {
- MultiHopTtestM$txBusy = TRUE;
- }
- else
- #line 114
- {
- }
- }
- return SUCCESS;
- }
- # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
- inline static result_t MultiHopTtestM$StatTimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10){
- #line 59
- unsigned char result;
- #line 59
- #line 59
- result = TimerM$Timer$start(1, arg_0x8561bb8, arg_0x8561d10);
- #line 59
- #line 59
- return result;
- #line 59
- }
- #line 59
- # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
- inline static result_t MultiHopTtestM$SendTimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10){
- #line 59
- unsigned char result;
- #line 59
- #line 59
- result = TimerM$Timer$start(2, arg_0x8561bb8, arg_0x8561d10);
- #line 59
- #line 59
- return result;
- #line 59
- }
- #line 59
- static inline
- # 1744 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- uint16_t CC1000RadioIntM$GetPower_sp(void)
- #line 1744
- {
- return CC1000RadioIntM$sp_sum;
- }
- # 29 "MultiHopTtestM.nc"
- inline static uint16_t MultiHopTtestM$GetPower_sp(void){
- #line 29
- unsigned int result;
- #line 29
- #line 29
- result = CC1000RadioIntM$GetPower_sp();
- #line 29
- #line 29
- return result;
- #line 29
- }
- #line 29
- static inline
- # 1741 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- uint16_t CC1000RadioIntM$GetPower_rx(void)
- #line 1741
- {
- return CC1000RadioIntM$rx_sum;
- }
- # 30 "MultiHopTtestM.nc"
- inline static uint16_t MultiHopTtestM$GetPower_rx(void){
- #line 30
- unsigned int result;
- #line 30
- #line 30
- result = CC1000RadioIntM$GetPower_rx();
- #line 30
- #line 30
- return result;
- #line 30
- }
- #line 30
- static inline
- # 1738 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- uint16_t CC1000RadioIntM$GetPower_tx(void)
- #line 1738
- {
- return CC1000RadioIntM$tx_sum;
- }
- # 27 "MultiHopTtestM.nc"
- inline static uint16_t MultiHopTtestM$GetPower_tx(void){
- #line 27
- unsigned int result;
- #line 27
- #line 27
- result = CC1000RadioIntM$GetPower_tx();
- #line 27
- #line 27
- return result;
- #line 27
- }
- #line 27
- static inline
- # 1731 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- uint16_t CC1000RadioIntM$GetDataSent(void)
- #line 1731
- {
- return CC1000RadioIntM$dataSent;
- }
- # 28 "MultiHopTtestM.nc"
- inline static uint16_t MultiHopTtestM$GetDataSent(void){
- #line 28
- unsigned int result;
- #line 28
- #line 28
- result = CC1000RadioIntM$GetDataSent();
- #line 28
- #line 28
- return result;
- #line 28
- }
- #line 28
- static inline
- #line 123
- result_t MultiHopTtestM$StatTimer$fired(void)
- #line 123
- {
- if (!MultiHopTtestM$drandFirstTime && MultiHopTtestM$gotFrames) {
- uint8_t i;
- #line 126
- MultiHopTtestM$time++;
- for (i = 0; i < 50; i++) {
- if (MultiHopTtestM$eachCount[i] != 0)
- {
- #line 129
- char bStatus;
- #line 129
- if (DBG_USR2 != 0) {
- #line 129
- bStatus = * (volatile uint8_t *)(uint16_t )& * (volatile uint8_t *)(0x3F + 0x20) & (1 << 7);
- #line 129
- __asm volatile ("cli");MultiHopTtestM$sprintf(MultiHopTtestM$debugbuf, " %u : %un", (uint8_t )i, (uint16_t )MultiHopTtestM$eachCount[i]);
- #line 129
- MultiHopTtestM$writedebug();
- #line 129
- if (bStatus) {
- #line 129
- __asm volatile ("sei");
- }
- }
- }
- #line 129
- ;
- }
- {
- #line 131
- char bStatus;
- #line 131
- if (DBG_USR2 != 0) {
- #line 131
- bStatus = * (volatile uint8_t *)(uint16_t )& * (volatile uint8_t *)(0x3F + 0x20) & (1 << 7);
- #line 131
- __asm volatile ("cli");MultiHopTtestM$sprintf(MultiHopTtestM$debugbuf, "Rcount %u Scount %u EnergyTX %u EnergyRX %u EnergySP %un", MultiHopTtestM$Rcount, MultiHopTtestM$GetDataSent(), MultiHopTtestM$GetPower_tx(), MultiHopTtestM$GetPower_rx(), MultiHopTtestM$GetPower_sp());
- #line 131
- MultiHopTtestM$writedebug();
- #line 131
- if (bStatus) {
- #line 131
- __asm volatile ("sei");
- }
- }
- }
- #line 131
- ;
- MultiHopTtestM$Rcount = 0;
- MultiHopTtestM$Scount = 0;
- MultiHopTtestM$ResetPower();
- MultiHopTtestM$ResetDataSent();
- for (i = 0; i < 50; i++)
- MultiHopTtestM$eachCount[i] = 0;
- }
- else {
- #line 139
- if (MultiHopTtestM$drandFirstTime && MultiHopTtestM$gotFrames) {
- if (TOS_LOCAL_ADDRESS != 0) {
- MultiHopTtestM$SendTimer$start(TIMER_REPEAT, 1000);
- }
- MultiHopTtestM$StatTimer$start(TIMER_REPEAT, STAT_TIME);
- MultiHopTtestM$drandFirstTime = FALSE;
- }
- }
- #line 146
- return SUCCESS;
- }
- static inline
- # 735 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- uint16_t MultiHopWMEWMA$RouteControl$getParent(void)
- #line 735
- {
- uint16_t addr;
- addr = MultiHopWMEWMA$gpCurrentParent != (void *)0 ? MultiHopWMEWMA$gpCurrentParent->id : 0xffff;
- return addr;
- }
- # 49 "/home/testuser/tinyos-1.x/tos/interfaces/RouteControl.nc"
- inline static uint16_t MultiHopEngineM$RouteSelectCntl$getParent(void){
- #line 49
- unsigned int result;
- #line 49
- #line 49
- result = MultiHopWMEWMA$RouteControl$getParent();
- #line 49
- #line 49
- return result;
- #line 49
- }
- #line 49
- static inline
- # 215 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
- uint16_t MultiHopEngineM$RouteControl$getParent(void)
- #line 215
- {
- return MultiHopEngineM$RouteSelectCntl$getParent();
- }
- # 49 "/home/testuser/tinyos-1.x/tos/interfaces/RouteControl.nc"
- inline static uint16_t MultiHopTtestM$RouteControl$getParent(void){
- #line 49
- unsigned int result;
- #line 49
- #line 49
- result = MultiHopEngineM$RouteControl$getParent();
- #line 49
- #line 49
- return result;
- #line 49
- }
- #line 49
- # 4 "../../tos/interfaces/SetDrand.nc"
- inline static result_t MultiHopTtestM$SetDrand$Set(nodeInfo *arg_0x85796b8, uint8_t arg_0x8579800, nodeInfo *arg_0x8579968, uint16_t arg_0x8579ab8){
- #line 4
- unsigned char result;
- #line 4
- #line 4
- result = CC1000RadioIntM$SetDrand$Set(arg_0x85796b8, arg_0x8579800, arg_0x8579968, arg_0x8579ab8);
- #line 4
- #line 4
- return result;
- #line 4
- }
- #line 4
- static inline
- # 149 "MultiHopTtestM.nc"
- result_t MultiHopTtestM$RouteTimer$fired(void)
- #line 149
- {
- MultiHopTtestM$drandFirstTime = FALSE;
- if (TOS_LOCAL_ADDRESS == 0) {
- MultiHopTtestM$SetDrand$Set((void *)0, 0, (void *)0, 50);
- }
- else
- #line 158
- {
- MultiHopTtestM$SendTimer$start(TIMER_REPEAT, 1000);
- MultiHopTtestM$SetDrand$Set((void *)0, MultiHopTtestM$RouteControl$getParent(), (void *)0, 50);
- }
- MultiHopTtestM$StatTimer$start(TIMER_REPEAT, STAT_TIME);
- return SUCCESS;
- }
- static inline
- # 179 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- result_t AMPromiscuous$ActivityTimer$fired(void)
- #line 179
- {
- AMPromiscuous$lastCount = AMPromiscuous$counter;
- AMPromiscuous$counter = 0;
- return SUCCESS;
- }
- # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
- inline static result_t CC1000RadioIntM$TDMATimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10){
- #line 59
- unsigned char result;
- #line 59
- #line 59
- result = TimerM$Timer$start(6, arg_0x8561bb8, arg_0x8561d10);
- #line 59
- #line 59
- return result;
- #line 59
- }
- #line 59
- static inline
- # 980 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- result_t CC1000RadioIntM$TDMATimer$fired(void)
- #line 980
- {
- CC1000RadioIntM$TDMATimer$start(TIMER_ONE_SHOT, CC1000RadioIntM$slotMultiplier);
- CC1000RadioIntM$slotNum++;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 983
- CC1000RadioIntM$currentMAC = CC1000RadioIntM$ZMAC;
- #line 983
- __nesc_atomic_end(__nesc_atomic); }
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 984
- {
- CC1000RadioIntM$currentSlot = CC1000RadioIntM$slotNum & (CC1000RadioIntM$localFrameLength - 1);
- CC1000RadioIntM$globalSlot = CC1000RadioIntM$slotNum & (CC1000RadioIntM$globalFrameLength - 1);
- if (CC1000RadioIntM$HCLselect) {
- CC1000RadioIntM$slots_since_ecnsend++;
- CC1000RadioIntM$slots_since_ecnrecv++;
- CC1000RadioIntM$slots_since_ecncheck++;
- if (CC1000RadioIntM$packetsSent > 10 && CC1000RadioIntM$slots_since_ecncheck >= 16) {
- double currentLoss = (double )CC1000RadioIntM$congBackOffs / CC1000RadioIntM$packetsSent;
- #line 996
- CC1000RadioIntM$avgLoss = 0.25 * currentLoss + (1 - 0.25) * CC1000RadioIntM$avgLoss;
- CC1000RadioIntM$slots_since_ecncheck = 0;
- CC1000RadioIntM$congBackOffs = 0;
- CC1000RadioIntM$packetsSent = 0;
- if (CC1000RadioIntM$avgLoss > 3.0 && CC1000RadioIntM$slots_since_ecnsend >= 96) {
- ecnMsgType *ecnMsgPtr = (ecnMsgType *)CC1000RadioIntM$ecnMsgHdr.data;
- CC1000RadioIntM$enableHCL = TRUE;
- CC1000RadioIntM$slots_since_ecnrecv = 0;
- ecnMsgPtr->nextHop = CC1000RadioIntM$nextHop;
- if (!CC1000RadioIntM$pureHCL) {
- CC1000RadioIntM$ecnPending = TRUE;
- }
- }
- }
- #line 1018
- if (CC1000RadioIntM$enableHCL && CC1000RadioIntM$slots_since_ecnrecv >= 192) {
- if (!CC1000RadioIntM$pureHCL) {
- CC1000RadioIntM$enableHCL = FALSE;
- }
- }
- }
- #line 1036
- if (CC1000RadioIntM$bTxPending) {
- CC1000RadioIntM$sMacDelay = CC1000RadioIntM$getZMACBackoff(CC1000RadioIntM$sMacDelay);
- }
- }
- #line 1039
- __nesc_atomic_end(__nesc_atomic); }
- return SUCCESS;
- }
- # 68 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
- inline static result_t CC1000RadioIntM$SquelchTimer$stop(void){
- #line 68
- unsigned char result;
- #line 68
- #line 68
- result = TimerM$Timer$stop(4);
- #line 68
- #line 68
- return result;
- #line 68
- }
- #line 68
- static inline
- # 927 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- result_t CC1000RadioIntM$WakeupTimer$fired(void)
- #line 927
- {
- uint8_t currentRadioState;
- if (CC1000RadioIntM$lplpower == 0) {
- return SUCCESS;
- }
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 933
- currentRadioState = CC1000RadioIntM$RadioState;
- #line 933
- __nesc_atomic_end(__nesc_atomic); }
- switch (currentRadioState) {
- case CC1000RadioIntM$IDLE_STATE:
- if (!CC1000RadioIntM$bTxPending) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 938
- {
- CC1000RadioIntM$RadioState = CC1000RadioIntM$POWER_DOWN_STATE;
- CC1000RadioIntM$SpiByteFifo$disableIntr();
- }
- #line 941
- __nesc_atomic_end(__nesc_atomic); }
- CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, CC1000RadioIntM$sleeptime);
- CC1000RadioIntM$SquelchTimer$stop();
- CC1000RadioIntM$CC1000StdControl$stop();
- }
- else
- #line 945
- {
- CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, CC1000RadioIntM$sleeptime);
- }
- break;
- case CC1000RadioIntM$POWER_DOWN_STATE:
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 951
- CC1000RadioIntM$RadioState = CC1000RadioIntM$PULSE_CHECK_STATE;
- #line 951
- __nesc_atomic_end(__nesc_atomic); }
- CC1000RadioIntM$pulse_check_count = 0;
- CC1000RadioIntM$CC1000StdControl$start();
- CC1000RadioIntM$CC1000Control$BIASOn();
- CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, 1);
- return SUCCESS;
- break;
- case CC1000RadioIntM$PULSE_CHECK_STATE:
- CC1000RadioIntM$CC1000Control$RxMode();
- if (!CC1000RadioIntM$RSSIADC$getData()) {
- CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, CC1000RadioIntM$TIME_BETWEEN_CHECKS);
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 963
- CC1000RadioIntM$RadioState = CC1000RadioIntM$POWER_DOWN_STATE;
- #line 963
- __nesc_atomic_end(__nesc_atomic); }
- }
- else {
- TOSH_uwait(80);
- }
- CC1000RadioIntM$CC1000StdControl$stop();
- CC1000RadioIntM$pulse_check_sum++;
- break;
- default:
- CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, 5);
- }
- return SUCCESS;
- }
- static inline
- #line 916
- result_t CC1000RadioIntM$SquelchTimer$fired(void)
- #line 916
- {
- char currentRadioState;
- #line 918
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 918
- currentRadioState = CC1000RadioIntM$RadioState;
- #line 918
- __nesc_atomic_end(__nesc_atomic); }
- if (currentRadioState == CC1000RadioIntM$IDLE_STATE) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 921
- CC1000RadioIntM$RSSIInitState = currentRadioState;
- #line 921
- __nesc_atomic_end(__nesc_atomic); }
- CC1000RadioIntM$RSSIADC$getData();
- }
- return SUCCESS;
- }
- static inline
- # 284 "../../tos/platform/mica2/ADCREFM.nc"
- result_t ADCREFM$ADCControl$manualCalibrate(void)
- #line 284
- {
- result_t Result;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 287
- {
- Result = ADCREFM$startGet(TOS_ADC_BANDGAP_PORT);
- }
- #line 289
- __nesc_atomic_end(__nesc_atomic); }
- return Result;
- }
- static inline
- #line 92
- void ADCREFM$CalTask(void)
- #line 92
- {
- ADCREFM$ADCControl$manualCalibrate();
- return;
- }
- static inline
- #line 126
- result_t ADCREFM$Timer$fired(void)
- #line 126
- {
- TOS_post(ADCREFM$CalTask);
- return SUCCESS;
- }
- # 48 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
- inline static result_t MultiHopWMEWMA$SendMsg$send(uint16_t arg_0x85a9e28, uint8_t arg_0x85b0010, TOS_MsgPtr arg_0x85b0160){
- #line 48
- unsigned char result;
- #line 48
- #line 48
- result = QueuedSendM$QueueSendMsg$send(AM_MULTIHOPMSG, arg_0x85a9e28, arg_0x85b0010, arg_0x85b0160);
- #line 48
- #line 48
- return result;
- #line 48
- }
- #line 48
- static inline
- # 447 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- void MultiHopWMEWMA$SendRouteTask(void)
- #line 447
- {
- TOS_MHopMsg *pMHMsg = (TOS_MHopMsg *)&MultiHopWMEWMA$routeMsg.data[0];
- MultiHopWMEWMA$RoutePacket *pRP = (MultiHopWMEWMA$RoutePacket *)&pMHMsg->data[0];
- uint8_t length = (size_t )& ((TOS_MHopMsg *)0)->data + (size_t )& ((MultiHopWMEWMA$RoutePacket *)0)->estList;
- uint8_t maxEstEntries;
- uint8_t i;
- #line 452
- uint8_t j;
- uint8_t last_index_added = 0;
- if (MultiHopWMEWMA$gfSendRouteBusy) {
- return;
- }
- {
- }
- #line 459
- ;
- {
- }
- #line 460
- ;
- maxEstEntries = 70 - length;
- maxEstEntries = maxEstEntries / sizeof(MultiHopWMEWMA$RPEstEntry );
- pRP->parent = MultiHopWMEWMA$gpCurrentParent ? MultiHopWMEWMA$gpCurrentParent->id : MultiHopWMEWMA$ROUTE_INVALID;
- pRP->cost = MultiHopWMEWMA$gbCurrentCost;
- for (i = 0, j = 0; i < MultiHopWMEWMA$ROUTE_TABLE_SIZE && j < maxEstEntries; i++) {
- uint8_t table_index = i + MultiHopWMEWMA$last_entry_sent + 1;
- #line 471
- if (table_index >= MultiHopWMEWMA$ROUTE_TABLE_SIZE) {
- #line 471
- table_index -= MultiHopWMEWMA$ROUTE_TABLE_SIZE;
- }
- #line 472
- if (MultiHopWMEWMA$NeighborTbl[table_index].flags & MultiHopWMEWMA$NBRFLAG_VALID && MultiHopWMEWMA$NeighborTbl[table_index].receiveEst > 100) {
- pRP->estList[j].id = MultiHopWMEWMA$NeighborTbl[table_index].id;
- pRP->estList[j].receiveEst = MultiHopWMEWMA$NeighborTbl[table_index].receiveEst;
- j++;
- length += sizeof(MultiHopWMEWMA$RPEstEntry );
- last_index_added = table_index;
- {
- }
- #line 478
- ;
- }
- }
- MultiHopWMEWMA$last_entry_sent = last_index_added;
- {
- }
- #line 482
- ;
- pRP->estEntries = j;
- pMHMsg->sourceaddr = pMHMsg->originaddr = TOS_LOCAL_ADDRESS;
- pMHMsg->hopcount = MultiHopWMEWMA$gbCurrentHopCount;
- pMHMsg->seqno = MultiHopWMEWMA$gCurrentSeqNo++;
- if (MultiHopWMEWMA$SendMsg$send(TOS_BCAST_ADDR, length, &MultiHopWMEWMA$routeMsg) == SUCCESS) {
- MultiHopWMEWMA$gfSendRouteBusy = TRUE;
- }
- }
- static inline
- #line 589
- result_t MultiHopWMEWMA$ATimer$fired(void)
- #line 589
- {
- TOS_post(MultiHopWMEWMA$SendRouteTask);
- return SUCCESS;
- }
- static inline
- #line 792
- result_t MultiHopWMEWMA$Timer$fired(void)
- #line 792
- {
- TOS_post(MultiHopWMEWMA$TimerTask);
- return SUCCESS;
- }
- static inline
- # 182 "/home/testuser/tinyos-1.x/tos/system/TimerM.nc"
- result_t TimerM$Timer$default$fired(uint8_t id)
- #line 182
- {
- return SUCCESS;
- }
- # 73 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
- inline static result_t TimerM$Timer$fired(uint8_t arg_0x85e4d90){
- #line 73
- unsigned char result;
- #line 73
- #line 73
- switch (arg_0x85e4d90) {
- #line 73
- case 0:
- #line 73
- result = MultiHopTtestM$RouteTimer$fired();
- #line 73
- break;
- #line 73
- case 1:
- #line 73
- result = MultiHopTtestM$StatTimer$fired();
- #line 73
- break;
- #line 73
- case 2:
- #line 73
- result = MultiHopTtestM$SendTimer$fired();
- #line 73
- break;
- #line 73
- case 3:
- #line 73
- result = AMPromiscuous$ActivityTimer$fired();
- #line 73
- break;
- #line 73
- case 4:
- #line 73
- result = CC1000RadioIntM$SquelchTimer$fired();
- #line 73
- break;
- #line 73
- case 5:
- #line 73
- result = CC1000RadioIntM$WakeupTimer$fired();
- #line 73
- break;
- #line 73
- case 6:
- #line 73
- result = CC1000RadioIntM$TDMATimer$fired();
- #line 73
- break;
- #line 73
- case 7:
- #line 73
- result = ADCREFM$Timer$fired();
- #line 73
- break;
- #line 73
- case 8:
- #line 73
- result = MultiHopWMEWMA$Timer$fired();
- #line 73
- break;
- #line 73
- case 9:
- #line 73
- result = MultiHopWMEWMA$ATimer$fired();
- #line 73
- break;
- #line 73
- default:
- #line 73
- result = TimerM$Timer$default$fired(arg_0x85e4d90);
- #line 73
- }
- #line 73
- #line 73
- return result;
- #line 73
- }
- #line 73
- static inline
- # 194 "/home/testuser/tinyos-1.x/tos/system/TimerM.nc"
- uint8_t TimerM$dequeue(void)
- #line 194
- {
- if (TimerM$queue_size == 0) {
- return NUM_TIMERS;
- }
- #line 197
- if (TimerM$queue_head == NUM_TIMERS - 1) {
- TimerM$queue_head = -1;
- }
- #line 199
- TimerM$queue_head++;
- TimerM$queue_size--;
- return TimerM$queue[(uint8_t )TimerM$queue_head];
- }
- static inline void TimerM$signalOneTimer(void)
- #line 204
- {
- uint8_t itimer = TimerM$dequeue();
- #line 206
- if (itimer < NUM_TIMERS) {
- TimerM$Timer$fired(itimer);
- }
- }
- static inline
- #line 210
- void TimerM$HandleFire(void)
- #line 210
- {
- uint8_t i;
- uint16_t int_out;
- #line 213
- TimerM$setIntervalFlag = 1;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 216
- {
- int_out = TimerM$interval_outstanding;
- TimerM$interval_outstanding = 0;
- }
- #line 219
- __nesc_atomic_end(__nesc_atomic); }
- if (TimerM$mState) {
- for (i = 0; i < NUM_TIMERS; i++) {
- if (TimerM$mState & (0x1L << i)) {
- TimerM$mTimerList[i].ticksLeft -= int_out;
- if (TimerM$mTimerList[i].ticksLeft <= 2) {
- if (TOS_post(TimerM$signalOneTimer)) {
- if (TimerM$mTimerList[i].type == TIMER_REPEAT) {
- TimerM$mTimerList[i].ticksLeft += TimerM$mTimerList[i].ticks;
- }
- else
- #line 230
- {
- TimerM$mState &= ~(0x1L << i);
- }
- TimerM$enqueue(i);
- }
- else {
- {
- }
- #line 236
- ;
- TimerM$mTimerList[i].ticksLeft = TimerM$mInterval;
- }
- }
- }
- }
- }
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 247
- int_out = TimerM$interval_outstanding;
- #line 247
- __nesc_atomic_end(__nesc_atomic); }
- if (int_out == 0) {
- TimerM$adjustInterval();
- }
- }
- static inline result_t TimerM$Clock$fire(void)
- #line 253
- {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 254
- {
- if (TimerM$interval_outstanding == 0) {
- TOS_post(TimerM$HandleFire);
- }
- else {
- }
- #line 261
- ;
- TimerM$interval_outstanding += TimerM$Clock$getInterval() + 1;
- }
- #line 264
- __nesc_atomic_end(__nesc_atomic); }
- return SUCCESS;
- }
- # 180 "/home/testuser/tinyos-1.x/tos/interfaces/Clock.nc"
- inline static result_t HPLClock$Clock$fire(void){
- #line 180
- unsigned char result;
- #line 180
- #line 180
- result = TimerM$Clock$fire();
- #line 180
- #line 180
- return result;
- #line 180
- }
- #line 180
- static inline
- # 1823 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- result_t CC1000RadioIntM$SClock$fire(uint16_t mticks)
- #line 1823
- {
- #line 1823
- return SUCCESS;
- }
- # 88 "../../tos/interfaces/SClock.nc"
- inline static result_t HPLSClock$SClock$fire(uint16_t arg_0x8624768){
- #line 88
- unsigned char result;
- #line 88
- #line 88
- result = CC1000RadioIntM$SClock$fire(arg_0x8624768);
- #line 88
- #line 88
- return result;
- #line 88
- }
- #line 88
- # 42 "../../tos/platform/mica2/SpiByteFifo.nc"
- inline static result_t HPLSpiM$SpiByteFifo$dataReady(uint8_t arg_0x86357c8){
- #line 42
- unsigned char result;
- #line 42
- #line 42
- result = CC1000RadioIntM$SpiByteFifo$dataReady(arg_0x86357c8);
- #line 42
- #line 42
- return result;
- #line 42
- }
- #line 42
- # 53 "../../tos/platform/mica2/HPLSpiM.nc"
- void __attribute((signal)) __vector_17(void)
- #line 53
- {
- register uint8_t temp = * (volatile uint8_t *)(0x0F + 0x20);
- #line 55