app.c
上传用户:joranyuan
上传日期:2022-06-23
资源大小:3306k
文件大小:323k
- * (volatile uint8_t *)(0x0F + 0x20) = HPLSpiM$OutgoingByte;
- HPLSpiM$SpiByteFifo$dataReady(temp);
- }
- static inline
- # 1789 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- void CC1000RadioIntM$RadioSendCoordinator$default$blockTimer(void)
- #line 1789
- {
- }
- # 43 "../../tos/platform/mica2/RadioCoordinator.nc"
- inline static void CC1000RadioIntM$RadioSendCoordinator$blockTimer(void){
- #line 43
- CC1000RadioIntM$RadioSendCoordinator$default$blockTimer();
- #line 43
- }
- #line 43
- static inline
- # 1794 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- void CC1000RadioIntM$RadioReceiveCoordinator$default$blockTimer(void)
- #line 1794
- {
- }
- # 43 "../../tos/platform/mica2/RadioCoordinator.nc"
- inline static void CC1000RadioIntM$RadioReceiveCoordinator$blockTimer(void){
- #line 43
- CC1000RadioIntM$RadioReceiveCoordinator$default$blockTimer();
- #line 43
- }
- #line 43
- static inline
- # 1786 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- void CC1000RadioIntM$RadioSendCoordinator$default$startSymbol(uint8_t bitsPerBlock, uint8_t offset,
- TOS_MsgPtr msgBuff)
- #line 1787
- {
- }
- # 31 "../../tos/platform/mica2/RadioCoordinator.nc"
- inline static void CC1000RadioIntM$RadioSendCoordinator$startSymbol(uint8_t arg_0x85eba50, uint8_t arg_0x85ebb98, TOS_MsgPtr arg_0x85ebce8){
- #line 31
- CC1000RadioIntM$RadioSendCoordinator$default$startSymbol(arg_0x85eba50, arg_0x85ebb98, arg_0x85ebce8);
- #line 31
- }
- #line 31
- static inline
- # 264 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- void CC1000RadioIntM$AddTime(GTime *C, GTime *A, GTime *B)
- #line 264
- {
- if (CC1000RadioIntM$MAX_VAL - B->sticks < A->sticks) {
- C->sticks = A->sticks - (CC1000RadioIntM$MAX_VAL - B->sticks);
- C->mticks = A->mticks + B->mticks + 1;
- }
- else {
- C->sticks = A->sticks + B->sticks;
- C->mticks = A->mticks + B->mticks;
- }
- }
- static inline
- #line 1788
- void CC1000RadioIntM$RadioSendCoordinator$default$byte(TOS_MsgPtr msg, uint8_t byteCount)
- #line 1788
- {
- }
- # 36 "../../tos/platform/mica2/RadioCoordinator.nc"
- inline static void CC1000RadioIntM$RadioSendCoordinator$byte(TOS_MsgPtr arg_0x85f8180, uint8_t arg_0x85f82d0){
- #line 36
- CC1000RadioIntM$RadioSendCoordinator$default$byte(arg_0x85f8180, arg_0x85f82d0);
- #line 36
- }
- #line 36
- static inline
- # 239 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- result_t AMPromiscuous$RadioSend$sendDone(TOS_MsgPtr msg, result_t success)
- #line 239
- {
- return AMPromiscuous$reportSendDone(msg, success);
- }
- # 67 "/home/testuser/tinyos-1.x/tos/interfaces/BareSendMsg.nc"
- inline static result_t CC1000RadioIntM$Send$sendDone(TOS_MsgPtr arg_0x85bb080, result_t arg_0x85bb1d0){
- #line 67
- unsigned char result;
- #line 67
- #line 67
- result = AMPromiscuous$RadioSend$sendDone(arg_0x85bb080, arg_0x85bb1d0);
- #line 67
- #line 67
- return result;
- #line 67
- }
- #line 67
- static inline
- # 506 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- void CC1000RadioIntM$PacketSent(void)
- #line 506
- {
- TOS_MsgPtr pBuf;
- #line 508
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 508
- {
- CC1000RadioIntM$txbufptr->time = 0;
- pBuf = CC1000RadioIntM$txbufptr;
- }
- #line 511
- __nesc_atomic_end(__nesc_atomic); }
- if (CC1000RadioIntM$txbufptr->type != 222 && CC1000RadioIntM$txbufptr->type != 223) {
- CC1000RadioIntM$Send$sendDone((TOS_MsgPtr )pBuf, SUCCESS);
- }
- else {
- #line 517
- if (CC1000RadioIntM$txbufptr->type == 223) {
- }
- else {
- if (CC1000RadioIntM$txbufptr->type == 222) {
- }
- }
- }
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 527
- CC1000RadioIntM$bTxBusy = FALSE;
- #line 527
- __nesc_atomic_end(__nesc_atomic); }
- if (CC1000RadioIntM$pktsLastSync > 100) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 529
- {
- CC1000RadioIntM$ackOrig = CC1000RadioIntM$bAckEnable;
- CC1000RadioIntM$bAckEnable = FALSE;
- }
- #line 532
- __nesc_atomic_end(__nesc_atomic); }
- CC1000RadioIntM$Send$send(&CC1000RadioIntM$syncMsgHdr);
- CC1000RadioIntM$pktsLastSync = 0;
- }
- else {
- #line 535
- if (CC1000RadioIntM$currentMAC == CC1000RadioIntM$ZMAC && CC1000RadioIntM$ecnforward == TRUE) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 536
- {
- CC1000RadioIntM$ackOrig = CC1000RadioIntM$bAckEnable;
- CC1000RadioIntM$bAckEnable = FALSE;
- }
- #line 539
- __nesc_atomic_end(__nesc_atomic); }
- CC1000RadioIntM$Send$send(&CC1000RadioIntM$ecnForwardMsgHdr);
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 541
- CC1000RadioIntM$ecnforward = FALSE;
- #line 541
- __nesc_atomic_end(__nesc_atomic); }
- }
- else {
- if (CC1000RadioIntM$currentMAC == CC1000RadioIntM$ZMAC && CC1000RadioIntM$ecnPending == TRUE) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 546
- {
- CC1000RadioIntM$ackOrig = CC1000RadioIntM$bAckEnable;
- CC1000RadioIntM$bAckEnable = FALSE;
- }
- #line 549
- __nesc_atomic_end(__nesc_atomic); }
- CC1000RadioIntM$Send$send(&CC1000RadioIntM$ecnMsgHdr);
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 551
- CC1000RadioIntM$ecnPending = FALSE;
- #line 551
- __nesc_atomic_end(__nesc_atomic); }
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 552
- CC1000RadioIntM$slots_since_ecnsend = 0;
- #line 552
- __nesc_atomic_end(__nesc_atomic); }
- }
- }
- }
- }
- static inline
- #line 329
- bool CC1000RadioIntM$IsHCL(uint32_t gSlot)
- #line 329
- {
- uint32_t tempHCL = 0x1;
- bool flag;
- #line 332
- tempHCL = tempHCL << gSlot;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 333
- {
- if (tempHCL & CC1000RadioIntM$curHCLlist) {
- flag = TRUE;
- }
- else {
- #line 337
- flag = FALSE;
- }
- }
- #line 339
- __nesc_atomic_end(__nesc_atomic); }
- #line 339
- return flag;
- }
- # 81 "/home/testuser/tinyos-1.x/tos/interfaces/Leds.nc"
- inline static result_t CC1000RadioIntM$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
- # 1791 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- void CC1000RadioIntM$RadioReceiveCoordinator$default$startSymbol(uint8_t bitsPerBlock, uint8_t offset,
- TOS_MsgPtr msgBuff)
- #line 1792
- {
- }
- # 31 "../../tos/platform/mica2/RadioCoordinator.nc"
- inline static void CC1000RadioIntM$RadioReceiveCoordinator$startSymbol(uint8_t arg_0x85eba50, uint8_t arg_0x85ebb98, TOS_MsgPtr arg_0x85ebce8){
- #line 31
- CC1000RadioIntM$RadioReceiveCoordinator$default$startSymbol(arg_0x85eba50, arg_0x85ebb98, arg_0x85ebce8);
- #line 31
- }
- #line 31
- static inline
- # 1793 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- void CC1000RadioIntM$RadioReceiveCoordinator$default$byte(TOS_MsgPtr msg, uint8_t byteCount)
- #line 1793
- {
- }
- # 36 "../../tos/platform/mica2/RadioCoordinator.nc"
- inline static void CC1000RadioIntM$RadioReceiveCoordinator$byte(TOS_MsgPtr arg_0x85f8180, uint8_t arg_0x85f82d0){
- #line 36
- CC1000RadioIntM$RadioReceiveCoordinator$default$byte(arg_0x85f8180, arg_0x85f82d0);
- #line 36
- }
- #line 36
- static inline
- # 253 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- void CC1000RadioIntM$DivTime2(GTime *B, GTime *A)
- #line 253
- {
- if (A->mticks % 2 == 1) {
- B->mticks = A->mticks >> 1;
- B->sticks = (A->sticks >> 1) + (CC1000RadioIntM$MAX_VAL >> 1);
- }
- else {
- B->mticks = A->mticks >> 1;
- B->sticks = A->sticks >> 1;
- }
- }
- static inline
- #line 306
- uint8_t CC1000RadioIntM$ModSubTime(GTime *C, GTime *A, GTime *B)
- #line 306
- {
- uint8_t retval;
- #line 308
- if (A->mticks > B->mticks) {
- retval = CC1000RadioIntM$POSITIVE;
- }
- else {
- #line 310
- if (A->mticks < B->mticks) {
- retval = CC1000RadioIntM$NEGATIVE;
- }
- else
- #line 312
- {
- if (A->sticks > B->sticks) {
- retval = CC1000RadioIntM$POSITIVE;
- }
- else {
- #line 315
- if (A->sticks < B->sticks) {
- retval = CC1000RadioIntM$NEGATIVE;
- }
- else {
- #line 318
- retval = CC1000RadioIntM$ZERO;
- }
- }
- }
- }
- #line 320
- if (retval == CC1000RadioIntM$POSITIVE) {
- #line 320
- CC1000RadioIntM$SubTime(C, A, B);
- }
- else {
- #line 321
- if (retval == CC1000RadioIntM$NEGATIVE) {
- #line 321
- CC1000RadioIntM$SubTime(C, B, A);
- }
- else
- #line 322
- {
- C->sticks = 0;
- C->mticks = 0;
- }
- }
- #line 326
- return retval;
- }
- # 63 "../../tos/interfaces/SClock.nc"
- inline static void CC1000RadioIntM$SClock$getTime(GTime *arg_0x862b720){
- #line 63
- HPLSClock$SClock$getTime(arg_0x862b720);
- #line 63
- }
- #line 63
- static inline
- # 387 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- void CC1000RadioIntM$getTimeDiff(void)
- #line 387
- {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 388
- {
- uint16_t i;
- #line 389
- uint16_t trust;
- GTime loctime;
- #line 390
- GTime timeStamp;
- syncMsgType *syncMsgPtr = (syncMsgType *)CC1000RadioIntM$rxbufptr->data;
- #line 392
- timeStamp.mticks = syncMsgPtr->mticks;
- timeStamp.sticks = syncMsgPtr->sticks;
- trust = syncMsgPtr->trust;
- CC1000RadioIntM$currentSender = syncMsgPtr->sender;
- CC1000RadioIntM$SClock$getTime(&loctime);
- CC1000RadioIntM$currentSign = CC1000RadioIntM$ModSubTime(&CC1000RadioIntM$currentDiff, &timeStamp, &loctime);
- if (trust < 1) {
- trust = 1;
- }
- #line 401
- if (trust < 8) {
- for (i = 0; i < trust; i++) {
- CC1000RadioIntM$DivTime2(&CC1000RadioIntM$currentDiff, &CC1000RadioIntM$currentDiff);
- }
- }
- }
- #line 406
- __nesc_atomic_end(__nesc_atomic); }
- }
- static inline
- # 107 "../../tos/platform/mica2/HPLSClock.nc"
- void HPLSClock$SClock$setTime(uint8_t PosOrNeg, GTime *t)
- #line 107
- {
- HPLSClock$sign = PosOrNeg;
- HPLSClock$Update.mticks = t->mticks;
- HPLSClock$Update.sticks = t->sticks;
- HPLSClock$needupdate = 1;
- }
- # 69 "../../tos/interfaces/SClock.nc"
- inline static void CC1000RadioIntM$SClock$setTime(uint8_t arg_0x862bb68, GTime *arg_0x862bcc8){
- #line 69
- HPLSClock$SClock$setTime(arg_0x862bb68, arg_0x862bcc8);
- #line 69
- }
- #line 69
- static inline
- # 424 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- void CC1000RadioIntM$adjustTime(void)
- #line 424
- {
- CC1000RadioIntM$needTimeSync = TRUE;
- CC1000RadioIntM$SClock$setTime(CC1000RadioIntM$currentSign, &CC1000RadioIntM$currentDiff);
- }
- static inline
- # 279 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- TOS_MsgPtr AMPromiscuous$RadioReceive$receive(TOS_MsgPtr packet)
- #line 279
- {
- return prom_received(packet);
- }
- # 75 "/home/testuser/tinyos-1.x/tos/interfaces/ReceiveMsg.nc"
- inline static TOS_MsgPtr CC1000RadioIntM$Receive$receive(TOS_MsgPtr arg_0x85b1db0){
- #line 75
- struct TOS_Msg *result;
- #line 75
- #line 75
- result = AMPromiscuous$RadioReceive$receive(arg_0x85b1db0);
- #line 75
- #line 75
- return result;
- #line 75
- }
- #line 75
- static inline
- # 1806 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- result_t CC1000RadioIntM$SClock$syncDone(void)
- #line 1806
- {
- if (CC1000RadioIntM$needTimeSync) {
- GTime loctime;
- uint32_t globalTimeStamp;
- #line 1809
- uint32_t slotOffset;
- #line 1810
- CC1000RadioIntM$SClock$getTime(&loctime);
- globalTimeStamp = (uint32_t )(loctime.mticks * 568.889 + loctime.sticks * 0.00868056);
- slotOffset = (uint32_t )(1.024 * (CC1000RadioIntM$slotSize - globalTimeStamp % CC1000RadioIntM$slotSize));
- CC1000RadioIntM$slotNum = (uint32_t )(globalTimeStamp / CC1000RadioIntM$slotSize);
- CC1000RadioIntM$currentSlot = CC1000RadioIntM$slotNum & (CC1000RadioIntM$localFrameLength - 1);
- CC1000RadioIntM$globalSlot = CC1000RadioIntM$slotNum & (CC1000RadioIntM$globalFrameLength - 1);
- if (CC1000RadioIntM$currentMAC == CC1000RadioIntM$ZMAC) {
- CC1000RadioIntM$TDMATimer$start(TIMER_ONE_SHOT, slotOffset);
- }
- #line 1819
- CC1000RadioIntM$needTimeSync = FALSE;
- }
- return SUCCESS;
- }
- # 94 "../../tos/interfaces/SClock.nc"
- inline static result_t HPLSClock$SClock$syncDone(void){
- #line 94
- unsigned char result;
- #line 94
- #line 94
- result = CC1000RadioIntM$SClock$syncDone();
- #line 94
- #line 94
- return result;
- #line 94
- }
- #line 94
- # 66 "/home/testuser/tinyos-1.x/tos/interfaces/ByteComm.nc"
- inline static result_t UARTM$ByteComm$rxByteReady(uint8_t arg_0x88b0c30, bool arg_0x88b0d78, uint16_t arg_0x88b0ed0){
- #line 66
- unsigned char result;
- #line 66
- #line 66
- result = FramerM$ByteComm$rxByteReady(arg_0x88b0c30, arg_0x88b0d78, arg_0x88b0ed0);
- #line 66
- #line 66
- return result;
- #line 66
- }
- #line 66
- static inline
- # 77 "/home/testuser/tinyos-1.x/tos/system/UARTM.nc"
- result_t UARTM$HPLUART$get(uint8_t data)
- #line 77
- {
- UARTM$ByteComm$rxByteReady(data, FALSE, 0);
- {
- }
- #line 83
- ;
- return SUCCESS;
- }
- # 88 "/home/testuser/tinyos-1.x/tos/interfaces/HPLUART.nc"
- inline static result_t HPLUART0M$UART$get(uint8_t arg_0x88d4fc8){
- #line 88
- unsigned char result;
- #line 88
- #line 88
- result = UARTM$HPLUART$get(arg_0x88d4fc8);
- #line 88
- #line 88
- return result;
- #line 88
- }
- #line 88
- # 90 "../../tos/platform/mica2/HPLUART0M.nc"
- void __attribute((signal)) __vector_18(void)
- #line 90
- {
- if (* (volatile uint8_t *)(0x0B + 0x20) & (1 << 7)) {
- HPLUART0M$UART$get(* (volatile uint8_t *)(0x0C + 0x20));
- }
- }
- static inline
- # 202 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
- void FramerM$PacketUnknown(void)
- #line 202
- {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 203
- {
- FramerM$gFlags |= FramerM$FLAGS_UNKNOWN;
- }
- #line 205
- __nesc_atomic_end(__nesc_atomic); }
- FramerM$StartTx();
- }
- static inline
- # 275 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- TOS_MsgPtr AMPromiscuous$UARTReceive$receive(TOS_MsgPtr packet)
- #line 275
- {
- packet->group = TOS_AM_GROUP;
- return prom_received(packet);
- }
- # 75 "/home/testuser/tinyos-1.x/tos/interfaces/ReceiveMsg.nc"
- inline static TOS_MsgPtr FramerAckM$ReceiveCombined$receive(TOS_MsgPtr arg_0x85b1db0){
- #line 75
- struct TOS_Msg *result;
- #line 75
- #line 75
- result = AMPromiscuous$UARTReceive$receive(arg_0x85b1db0);
- #line 75
- #line 75
- return result;
- #line 75
- }
- #line 75
- static inline
- # 91 "/home/testuser/tinyos-1.x/tos/system/FramerAckM.nc"
- TOS_MsgPtr FramerAckM$ReceiveMsg$receive(TOS_MsgPtr Msg)
- #line 91
- {
- TOS_MsgPtr pBuf;
- pBuf = FramerAckM$ReceiveCombined$receive(Msg);
- return pBuf;
- }
- # 75 "/home/testuser/tinyos-1.x/tos/interfaces/ReceiveMsg.nc"
- inline static TOS_MsgPtr FramerM$ReceiveMsg$receive(TOS_MsgPtr arg_0x85b1db0){
- #line 75
- struct TOS_Msg *result;
- #line 75
- #line 75
- result = FramerAckM$ReceiveMsg$receive(arg_0x85b1db0);
- #line 75
- #line 75
- return result;
- #line 75
- }
- #line 75
- static inline
- # 328 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
- result_t FramerM$TokenReceiveMsg$ReflectToken(uint8_t Token)
- #line 328
- {
- result_t Result = SUCCESS;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 331
- {
- if (!(FramerM$gFlags & FramerM$FLAGS_TOKENPEND)) {
- FramerM$gFlags |= FramerM$FLAGS_TOKENPEND;
- FramerM$gTxTokenBuf = Token;
- }
- else {
- Result = FAIL;
- }
- }
- #line 339
- __nesc_atomic_end(__nesc_atomic); }
- if (Result == SUCCESS) {
- Result = FramerM$StartTx();
- }
- return Result;
- }
- # 88 "/home/testuser/tinyos-1.x/tos/interfaces/TokenReceiveMsg.nc"
- inline static result_t FramerAckM$TokenReceiveMsg$ReflectToken(uint8_t arg_0x88b2a98){
- #line 88
- unsigned char result;
- #line 88
- #line 88
- result = FramerM$TokenReceiveMsg$ReflectToken(arg_0x88b2a98);
- #line 88
- #line 88
- return result;
- #line 88
- }
- #line 88
- static inline
- # 74 "/home/testuser/tinyos-1.x/tos/system/FramerAckM.nc"
- void FramerAckM$SendAckTask(void)
- #line 74
- {
- FramerAckM$TokenReceiveMsg$ReflectToken(FramerAckM$gTokenBuf);
- }
- static inline TOS_MsgPtr FramerAckM$TokenReceiveMsg$receive(TOS_MsgPtr Msg, uint8_t token)
- #line 79
- {
- TOS_MsgPtr pBuf;
- FramerAckM$gTokenBuf = token;
- TOS_post(FramerAckM$SendAckTask);
- pBuf = FramerAckM$ReceiveCombined$receive(Msg);
- return pBuf;
- }
- # 75 "/home/testuser/tinyos-1.x/tos/interfaces/TokenReceiveMsg.nc"
- inline static TOS_MsgPtr FramerM$TokenReceiveMsg$receive(TOS_MsgPtr arg_0x88b2338, uint8_t arg_0x88b2480){
- #line 75
- struct TOS_Msg *result;
- #line 75
- #line 75
- result = FramerAckM$TokenReceiveMsg$receive(arg_0x88b2338, arg_0x88b2480);
- #line 75
- #line 75
- return result;
- #line 75
- }
- #line 75
- static inline
- # 210 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
- void FramerM$PacketRcvd(void)
- #line 210
- {
- FramerM$MsgRcvEntry_t *pRcv = &FramerM$gMsgRcvTbl[FramerM$gRxTailIndex];
- TOS_MsgPtr pBuf = pRcv->pMsg;
- if (pRcv->Length >= (size_t )& ((TOS_Msg *)0)->data) {
- switch (pRcv->Proto) {
- case FramerM$PROTO_ACK:
- break;
- case FramerM$PROTO_PACKET_ACK:
- pBuf->crc = 1;
- pBuf = FramerM$TokenReceiveMsg$receive(pBuf, pRcv->Token);
- break;
- case FramerM$PROTO_PACKET_NOACK:
- pBuf->crc = 1;
- pBuf = FramerM$ReceiveMsg$receive(pBuf);
- break;
- default:
- FramerM$gTxUnknownBuf = pRcv->Proto;
- TOS_post(FramerM$PacketUnknown);
- break;
- }
- }
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 235
- {
- if (pBuf) {
- pRcv->pMsg = pBuf;
- }
- pRcv->Length = 0;
- pRcv->Token = 0;
- FramerM$gRxTailIndex++;
- FramerM$gRxTailIndex %= FramerM$HDLC_QUEUESIZE;
- }
- #line 243
- __nesc_atomic_end(__nesc_atomic); }
- }
- # 96 "/home/testuser/tinyos-1.x/tos/interfaces/HPLUART.nc"
- inline static result_t HPLUART0M$UART$putDone(void){
- #line 96
- unsigned char result;
- #line 96
- #line 96
- result = UARTM$HPLUART$putDone();
- #line 96
- #line 96
- return result;
- #line 96
- }
- #line 96
- # 100 "../../tos/platform/mica2/HPLUART0M.nc"
- void __attribute((interrupt)) __vector_20(void)
- #line 100
- {
- HPLUART0M$UART$putDone();
- }
- static inline
- # 552 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
- result_t FramerM$ByteComm$txDone(void)
- #line 552
- {
- if (FramerM$gTxState == FramerM$TXSTATE_FINISH) {
- FramerM$gTxState = FramerM$TXSTATE_IDLE;
- TOS_post(FramerM$PacketSent);
- }
- return SUCCESS;
- }
- # 83 "/home/testuser/tinyos-1.x/tos/interfaces/ByteComm.nc"
- inline static result_t UARTM$ByteComm$txDone(void){
- #line 83
- unsigned char result;
- #line 83
- #line 83
- result = FramerM$ByteComm$txDone();
- #line 83
- #line 83
- return result;
- #line 83
- }
- #line 83
- #line 55
- inline static result_t FramerM$ByteComm$txByte(uint8_t arg_0x88b07a0){
- #line 55
- unsigned char result;
- #line 55
- #line 55
- result = UARTM$ByteComm$txByte(arg_0x88b07a0);
- #line 55
- #line 55
- return result;
- #line 55
- }
- #line 55
- static inline
- # 66 "/home/testuser/tinyos-1.x/tos/platform/avrmote/crc.h"
- uint16_t crcByte(uint16_t oldCrc, uint8_t byte)
- {
- uint16_t *table = crcTable;
- uint16_t newCrc;
- __asm ("eor %1,%B3n"
- "tlsl %1n"
- "tadc %B2, __zero_reg__n"
- "tadd %A2, %1n"
- "tadc %B2, __zero_reg__n"
- "tlpmn"
- "tmov %B0, %A3n"
- "tmov %A0, r0n"
- "tadiw r30,1n"
- "tlpmn"
- "teor %B0, r0" :
- "=r"(newCrc), "+r"(byte), "+z"(table) : "r"(oldCrc));
- return newCrc;
- }
- static inline
- # 482 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
- result_t FramerM$ByteComm$txByteReady(bool LastByteSuccess)
- #line 482
- {
- result_t TxResult = SUCCESS;
- uint8_t nextByte;
- if (LastByteSuccess != TRUE) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 487
- FramerM$gTxState = FramerM$TXSTATE_ERROR;
- #line 487
- __nesc_atomic_end(__nesc_atomic); }
- TOS_post(FramerM$PacketSent);
- return SUCCESS;
- }
- switch (FramerM$gTxState) {
- case FramerM$TXSTATE_PROTO:
- FramerM$gTxState = FramerM$TXSTATE_INFO;
- FramerM$gTxRunningCRC = crcByte(FramerM$gTxRunningCRC, (uint8_t )(FramerM$gTxProto & 0x0FF));
- TxResult = FramerM$ByteComm$txByte((uint8_t )(FramerM$gTxProto & 0x0FF));
- break;
- case FramerM$TXSTATE_INFO:
- nextByte = FramerM$gpTxBuf[FramerM$gTxByteCnt];
- FramerM$gTxRunningCRC = crcByte(FramerM$gTxRunningCRC, nextByte);
- FramerM$gTxByteCnt++;
- if (FramerM$gTxByteCnt >= FramerM$gTxLength) {
- FramerM$gTxState = FramerM$TXSTATE_FCS1;
- }
- TxResult = FramerM$TxArbitraryByte(nextByte);
- break;
- case FramerM$TXSTATE_ESC:
- TxResult = FramerM$ByteComm$txByte(FramerM$gTxEscByte ^ 0x20);
- FramerM$gTxState = FramerM$gPrevTxState;
- break;
- case FramerM$TXSTATE_FCS1:
- nextByte = (uint8_t )(FramerM$gTxRunningCRC & 0xff);
- FramerM$gTxState = FramerM$TXSTATE_FCS2;
- TxResult = FramerM$TxArbitraryByte(nextByte);
- break;
- case FramerM$TXSTATE_FCS2:
- nextByte = (uint8_t )((FramerM$gTxRunningCRC >> 8) & 0xff);
- FramerM$gTxState = FramerM$TXSTATE_ENDFLAG;
- TxResult = FramerM$TxArbitraryByte(nextByte);
- break;
- case FramerM$TXSTATE_ENDFLAG:
- FramerM$gTxState = FramerM$TXSTATE_FINISH;
- TxResult = FramerM$ByteComm$txByte(FramerM$HDLC_FLAG_BYTE);
- break;
- case FramerM$TXSTATE_FINISH:
- case FramerM$TXSTATE_ERROR:
- default:
- break;
- }
- if (TxResult != SUCCESS) {
- FramerM$gTxState = FramerM$TXSTATE_ERROR;
- TOS_post(FramerM$PacketSent);
- }
- return SUCCESS;
- }
- # 75 "/home/testuser/tinyos-1.x/tos/interfaces/ByteComm.nc"
- inline static result_t UARTM$ByteComm$txByteReady(bool arg_0x88b1400){
- #line 75
- unsigned char result;
- #line 75
- #line 75
- result = FramerM$ByteComm$txByteReady(arg_0x88b1400);
- #line 75
- #line 75
- return result;
- #line 75
- }
- #line 75
- # 102 "/home/testuser/tinyos-1.x/tos/system/sched.c"
- bool TOS_post(void (*tp)(void))
- #line 102
- {
- __nesc_atomic_t fInterruptFlags;
- uint8_t tmp;
- fInterruptFlags = __nesc_atomic_start();
- tmp = TOSH_sched_free;
- if (TOSH_queue[tmp].tp == (void *)0) {
- TOSH_sched_free = (tmp + 1) & TOSH_TASK_BITMASK;
- TOSH_queue[tmp].tp = tp;
- __nesc_atomic_end(fInterruptFlags);
- return TRUE;
- }
- else {
- __nesc_atomic_end(fInterruptFlags);
- return FALSE;
- }
- }
- # 54 "/home/testuser/tinyos-1.x/tos/system/RealMain.nc"
- int main(void)
- #line 54
- {
- RealMain$hardwareInit();
- RealMain$Pot$init(10);
- TOSH_sched_init();
- RealMain$StdControl$init();
- RealMain$StdControl$start();
- __nesc_enable_interrupt();
- while (1) {
- TOSH_run_task();
- }
- }
- static
- # 77 "/home/testuser/tinyos-1.x/tos/system/TimerM.nc"
- result_t TimerM$StdControl$init(void)
- #line 77
- {
- TimerM$mState = 0;
- TimerM$setIntervalFlag = 0;
- TimerM$queue_head = TimerM$queue_tail = -1;
- TimerM$queue_size = 0;
- TimerM$mScale = 3;
- TimerM$mInterval = TimerM$maxTimerInterval;
- return TimerM$Clock$setRate(TimerM$mInterval, TimerM$mScale);
- }
- static
- # 268 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
- void FramerM$HDLCInitialize(void)
- #line 268
- {
- int i;
- #line 270
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 270
- {
- for (i = 0; i < FramerM$HDLC_QUEUESIZE; i++) {
- FramerM$gMsgRcvTbl[i].pMsg = &FramerM$gMsgRcvBuf[i];
- FramerM$gMsgRcvTbl[i].Length = 0;
- FramerM$gMsgRcvTbl[i].Token = 0;
- }
- FramerM$gTxState = FramerM$TXSTATE_IDLE;
- FramerM$gTxByteCnt = 0;
- FramerM$gTxLength = 0;
- FramerM$gTxRunningCRC = 0;
- FramerM$gpTxMsg = (void *)0;
- FramerM$gRxState = FramerM$RXSTATE_NOSYNC;
- FramerM$gRxHeadIndex = 0;
- FramerM$gRxTailIndex = 0;
- FramerM$gRxByteCnt = 0;
- FramerM$gRxRunningCRC = 0;
- FramerM$gpRxBuf = (uint8_t *)FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].pMsg;
- }
- #line 288
- __nesc_atomic_end(__nesc_atomic); }
- }
- static
- # 75 "../../tos/platform/mica2/HPLCC1000M.nc"
- result_t HPLCC1000M$HPLCC1000$write(uint8_t addr, uint8_t data)
- #line 75
- {
- char cnt = 0;
- addr <<= 1;
- TOSH_CLR_CC_PALE_PIN();
- for (cnt = 0; cnt < 7; cnt++)
- {
- if (addr & 0x80) {
- TOSH_SET_CC_PDATA_PIN();
- }
- else {
- #line 86
- TOSH_CLR_CC_PDATA_PIN();
- }
- #line 87
- TOSH_CLR_CC_PCLK_PIN();
- TOSH_SET_CC_PCLK_PIN();
- addr <<= 1;
- }
- TOSH_SET_CC_PDATA_PIN();
- TOSH_CLR_CC_PCLK_PIN();
- TOSH_SET_CC_PCLK_PIN();
- TOSH_SET_CC_PALE_PIN();
- for (cnt = 0; cnt < 8; cnt++)
- {
- if (data & 0x80) {
- TOSH_SET_CC_PDATA_PIN();
- }
- else {
- #line 103
- TOSH_CLR_CC_PDATA_PIN();
- }
- #line 104
- TOSH_CLR_CC_PCLK_PIN();
- TOSH_SET_CC_PCLK_PIN();
- data <<= 1;
- }
- TOSH_SET_CC_PALE_PIN();
- TOSH_SET_CC_PDATA_PIN();
- TOSH_SET_CC_PCLK_PIN();
- return SUCCESS;
- }
- static
- #line 128
- uint8_t HPLCC1000M$HPLCC1000$read(uint8_t addr)
- #line 128
- {
- int cnt;
- uint8_t din;
- uint8_t data = 0;
- addr <<= 1;
- TOSH_CLR_CC_PALE_PIN();
- for (cnt = 0; cnt < 7; cnt++)
- {
- if (addr & 0x80) {
- TOSH_SET_CC_PDATA_PIN();
- }
- else {
- #line 141
- TOSH_CLR_CC_PDATA_PIN();
- }
- #line 142
- TOSH_CLR_CC_PCLK_PIN();
- TOSH_SET_CC_PCLK_PIN();
- addr <<= 1;
- }
- TOSH_CLR_CC_PDATA_PIN();
- TOSH_CLR_CC_PCLK_PIN();
- TOSH_SET_CC_PCLK_PIN();
- TOSH_MAKE_CC_PDATA_INPUT();
- TOSH_SET_CC_PALE_PIN();
- for (cnt = 7; cnt >= 0; cnt--)
- {
- TOSH_CLR_CC_PCLK_PIN();
- din = TOSH_READ_CC_PDATA_PIN();
- if (din) {
- data = (data << 1) | 0x01;
- }
- else {
- #line 161
- data = (data << 1) & 0xfe;
- }
- #line 162
- TOSH_SET_CC_PCLK_PIN();
- }
- TOSH_SET_CC_PALE_PIN();
- TOSH_MAKE_CC_PDATA_OUTPUT();
- TOSH_SET_CC_PDATA_PIN();
- return data;
- }
- static
- # 63 "../../tos/platform/mica2/HPLADCM.nc"
- void HPLADCM$init_portmap(void)
- #line 63
- {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 65
- {
- if (HPLADCM$init_portmap_done == FALSE) {
- int i;
- #line 68
- for (i = 0; i < TOSH_ADC_PORTMAPSIZE; i++)
- HPLADCM$TOSH_adc_portmap[i] = i;
- HPLADCM$TOSH_adc_portmap[TOS_ADC_BANDGAP_PORT] = TOSH_ACTUAL_BANDGAP_PORT;
- HPLADCM$TOSH_adc_portmap[TOS_ADC_GND_PORT] = TOSH_ACTUAL_GND_PORT;
- HPLADCM$init_portmap_done = TRUE;
- }
- }
- #line 76
- __nesc_atomic_end(__nesc_atomic); }
- }
- static
- # 59 "/home/testuser/tinyos-1.x/tos/system/RandomLFSR.nc"
- result_t RandomLFSR$Random$init(void)
- #line 59
- {
- {
- }
- #line 60
- ;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 61
- {
- RandomLFSR$shiftReg = 119 * 119 * (TOS_LOCAL_ADDRESS + 1);
- RandomLFSR$initSeed = RandomLFSR$shiftReg;
- RandomLFSR$mask = 137 * 29 * (TOS_LOCAL_ADDRESS + 1);
- }
- #line 65
- __nesc_atomic_end(__nesc_atomic); }
- return SUCCESS;
- }
- static
- # 1748 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- result_t CC1000RadioIntM$ResetPower(void)
- #line 1748
- {
- CC1000RadioIntM$power_sum = 0;
- CC1000RadioIntM$pulse_check_sum = 0;
- CC1000RadioIntM$send_sum = 0;
- CC1000RadioIntM$receive_sum = 0;
- CC1000RadioIntM$sp_sum = 0;
- CC1000RadioIntM$tx_sum = 0;
- CC1000RadioIntM$rx_sum = 0;
- return SUCCESS;
- }
- static
- # 435 "../../tos/platform/mica2/CC1000ControlM.nc"
- result_t CC1000ControlM$CC1000Control$RxMode(void)
- #line 435
- {
- CC1000ControlM$HPLChipcon$write(0x09, CC1000ControlM$gCurrentParameters[0x09]);
- CC1000ControlM$HPLChipcon$write(0x0B, 0x00);
- CC1000ControlM$HPLChipcon$write(0x00, (
- 1 << 4) | (1 << 0));
- TOSH_uwait(125);
- return SUCCESS;
- }
- static
- # 98 "/home/testuser/tinyos-1.x/tos/system/TimerM.nc"
- result_t TimerM$Timer$start(uint8_t id, char type,
- uint32_t interval)
- #line 99
- {
- uint8_t diff;
- #line 101
- if (id >= NUM_TIMERS) {
- #line 101
- return FAIL;
- }
- #line 102
- if (type > TIMER_ONE_SHOT) {
- #line 102
- return FAIL;
- }
- if (type == TIMER_REPEAT && interval <= 2) {
- #line 109
- return FAIL;
- }
- TimerM$mTimerList[id].ticks = interval;
- TimerM$mTimerList[id].type = type;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 114
- {
- diff = TimerM$Clock$readCounter();
- interval += diff;
- TimerM$mTimerList[id].ticksLeft = interval;
- TimerM$mState |= 0x1L << id;
- if (interval < TimerM$mInterval) {
- TimerM$mInterval = interval;
- TimerM$Clock$setInterval(TimerM$mInterval);
- TimerM$setIntervalFlag = 0;
- TimerM$PowerManagement$adjustPower();
- }
- }
- #line 125
- __nesc_atomic_end(__nesc_atomic); }
- return SUCCESS;
- }
- static
- # 102 "../../tos/platform/mica2/HPLPowerManagementM.nc"
- uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void)
- #line 102
- {
- uint8_t mcu;
- #line 104
- if (HPLPowerManagementM$disableCount <= 0) {
- TOS_post(HPLPowerManagementM$doAdjustment);
- }
- else
- #line 106
- {
- mcu = * (volatile uint8_t *)(0x35 + 0x20);
- mcu &= 0xe3;
- mcu |= HPLPowerManagementM$IDLE;
- * (volatile uint8_t *)(0x35 + 0x20) = mcu;
- * (volatile uint8_t *)(0x35 + 0x20) |= 1 << 5;
- }
- return 0;
- }
- static
- # 543 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- void MultiHopWMEWMA$TimerTask(void)
- #line 543
- {
- MultiHopWMEWMA$Leds$redToggle();
- {
- }
- #line 546
- ;
- MultiHopWMEWMA$updateTable();
- {
- int i;
- #line 552
- {
- }
- #line 552
- ;
- for (i = 0; i < MultiHopWMEWMA$ROUTE_TABLE_SIZE; i++) {
- if (MultiHopWMEWMA$NeighborTbl[i].flags) {
- {
- }
- #line 555
- ;
- }
- }
- if (MultiHopWMEWMA$gpCurrentParent) {
- {
- }
- #line 569
- ;
- }
- }
- MultiHopWMEWMA$chooseParent();
- MultiHopWMEWMA$ATimer$start(TIMER_ONE_SHOT, 32);
- }
- static
- #line 256
- uint32_t MultiHopWMEWMA$evaluateCost(uint16_t cost, uint8_t sendEst, uint8_t receiveEst)
- #line 256
- {
- uint32_t transEst = (uint32_t )sendEst * (uint32_t )receiveEst;
- uint32_t immed = (uint32_t )1 << 24;
- if (transEst == 0) {
- #line 260
- return (uint32_t )1 << (uint32_t )16;
- }
- immed = immed / transEst;
- immed += (uint32_t )cost << 6;
- return immed;
- }
- static
- # 150 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
- void *MultiHopEngineM$Send$getBuffer(uint8_t id, TOS_MsgPtr pMsg, uint16_t *length)
- #line 150
- {
- TOS_MHopMsg *pMHMsg = (TOS_MHopMsg *)pMsg->data;
- *length = 70 - (size_t )& ((TOS_MHopMsg *)0)->data;
- return &pMHMsg->data[0];
- }
- static
- # 70 "/home/testuser/tinyos-1.x/tos/system/RandomLFSR.nc"
- uint16_t RandomLFSR$Random$rand(void)
- #line 70
- {
- bool endbit;
- uint16_t tmpShiftReg;
- #line 73
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 73
- {
- tmpShiftReg = RandomLFSR$shiftReg;
- endbit = (tmpShiftReg & 0x8000) != 0;
- tmpShiftReg <<= 1;
- if (endbit) {
- tmpShiftReg ^= 0x100b;
- }
- #line 79
- tmpShiftReg++;
- RandomLFSR$shiftReg = tmpShiftReg;
- tmpShiftReg = tmpShiftReg ^ RandomLFSR$mask;
- }
- #line 82
- __nesc_atomic_end(__nesc_atomic); }
- return tmpShiftReg;
- }
- # 244 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- TOS_MsgPtr prom_received(TOS_MsgPtr packet)
- #line 244
- {
- AMPromiscuous$counter++;
- {
- }
- #line 246
- ;
- if (
- #line 248
- packet->group == TOS_AM_GROUP && ((
- AMPromiscuous$promiscuous_mode == TRUE ||
- packet->addr == TOS_BCAST_ADDR) ||
- packet->addr == TOS_LOCAL_ADDRESS) && (
- AMPromiscuous$crc_check == FALSE || packet->crc == 1))
- {
- uint8_t type = packet->type;
- TOS_MsgPtr tmp;
- {
- }
- #line 258
- ;
- AMPromiscuous$dbgPacket(packet);
- {
- }
- #line 260
- ;
- tmp = AMPromiscuous$ReceiveMsg$receive(type, packet);
- if (tmp) {
- packet = tmp;
- }
- }
- #line 267
- return packet;
- }
- static
- # 332 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- bool MultiHopWMEWMA$updateNbrCounters(uint16_t saddr, int16_t seqno, uint8_t *NbrIndex)
- #line 332
- {
- MultiHopWMEWMA$TableEntry *pNbr;
- int16_t sDelta;
- uint8_t iNbr;
- bool Result = FALSE;
- iNbr = MultiHopWMEWMA$findPreparedIndex(saddr);
- pNbr = &MultiHopWMEWMA$NeighborTbl[iNbr];
- sDelta = seqno - MultiHopWMEWMA$NeighborTbl[iNbr].lastSeqno - 1;
- if (pNbr->flags & MultiHopWMEWMA$NBRFLAG_NEW) {
- pNbr->received++;
- pNbr->lastSeqno = seqno;
- pNbr->flags ^= MultiHopWMEWMA$NBRFLAG_NEW;
- }
- else {
- #line 348
- if (sDelta >= 0) {
- pNbr->missed += sDelta;
- pNbr->received++;
- pNbr->lastSeqno = seqno;
- }
- else {
- #line 353
- if (sDelta < MultiHopWMEWMA$ACCEPTABLE_MISSED) {
- MultiHopWMEWMA$newEntry(iNbr, saddr);
- pNbr->received++;
- pNbr->lastSeqno = seqno;
- pNbr->flags ^= MultiHopWMEWMA$NBRFLAG_NEW;
- }
- else {
- Result = TRUE;
- }
- }
- }
- #line 364
- *NbrIndex = iNbr;
- return Result;
- }
- static
- #line 156
- uint8_t MultiHopWMEWMA$findEntry(uint16_t id)
- #line 156
- {
- uint8_t i = 0;
- #line 158
- for (i = 0; i < MultiHopWMEWMA$ROUTE_TABLE_SIZE; i++) {
- if (MultiHopWMEWMA$NeighborTbl[i].flags & MultiHopWMEWMA$NBRFLAG_VALID && MultiHopWMEWMA$NeighborTbl[i].id == id) {
- return i;
- }
- }
- return MultiHopWMEWMA$ROUTE_INVALID;
- }
- static
- #line 198
- void MultiHopWMEWMA$newEntry(uint8_t indes, uint16_t id)
- #line 198
- {
- MultiHopWMEWMA$NeighborTbl[indes].id = id;
- MultiHopWMEWMA$NeighborTbl[indes].flags = MultiHopWMEWMA$NBRFLAG_VALID | MultiHopWMEWMA$NBRFLAG_NEW;
- MultiHopWMEWMA$NeighborTbl[indes].liveliness = 0;
- MultiHopWMEWMA$NeighborTbl[indes].parent = MultiHopWMEWMA$ROUTE_INVALID;
- MultiHopWMEWMA$NeighborTbl[indes].cost = MultiHopWMEWMA$ROUTE_INVALID;
- MultiHopWMEWMA$NeighborTbl[indes].childLiveliness = 0;
- MultiHopWMEWMA$NeighborTbl[indes].hop = MultiHopWMEWMA$ROUTE_INVALID;
- MultiHopWMEWMA$NeighborTbl[indes].missed = 0;
- MultiHopWMEWMA$NeighborTbl[indes].received = 0;
- MultiHopWMEWMA$NeighborTbl[indes].receiveEst = 0;
- MultiHopWMEWMA$NeighborTbl[indes].sendEst = 0;
- }
- static
- # 182 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
- TOS_MsgPtr MultiHopEngineM$ReceiveMsg$receive(uint8_t id, TOS_MsgPtr pMsg)
- #line 182
- {
- TOS_MHopMsg *pMHMsg = (TOS_MHopMsg *)pMsg->data;
- uint16_t PayloadLen = pMsg->length - (size_t )& ((TOS_MHopMsg *)0)->data;
- if (pMsg->addr == TOS_LOCAL_ADDRESS) {
- if (MultiHopEngineM$Intercept$intercept(id, pMsg, &pMHMsg->data[0], PayloadLen) == SUCCESS) {
- pMsg = MultiHopEngineM$mForward(pMsg, id);
- }
- }
- else {
- MultiHopEngineM$Snoop$intercept(id, pMsg, &pMHMsg->data[0], PayloadLen);
- }
- return pMsg;
- }
- static
- # 665 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
- result_t MultiHopWMEWMA$RouteSelect$selectRoute(TOS_MsgPtr Msg, uint8_t id)
- #line 665
- {
- TOS_MHopMsg *pMHMsg = (TOS_MHopMsg *)&Msg->data[0];
- uint8_t iNbr;
- bool fIsDuplicate;
- result_t Result = SUCCESS;
- if (MultiHopWMEWMA$gpCurrentParent == (void *)0) {
- if (pMHMsg->sourceaddr == TOS_LOCAL_ADDRESS &&
- pMHMsg->originaddr == TOS_LOCAL_ADDRESS) {
- pMHMsg->sourceaddr = TOS_LOCAL_ADDRESS;
- pMHMsg->hopcount = MultiHopWMEWMA$gbCurrentHopCount;
- pMHMsg->seqno = MultiHopWMEWMA$gCurrentSeqNo++;
- Msg->addr = TOS_BCAST_ADDR;
- return SUCCESS;
- }
- else {
- return FAIL;
- }
- }
- if (MultiHopWMEWMA$gbCurrentHopCount >= pMHMsg->hopcount) {
- return FAIL;
- }
- if (pMHMsg->sourceaddr == TOS_LOCAL_ADDRESS &&
- pMHMsg->originaddr == TOS_LOCAL_ADDRESS) {
- fIsDuplicate = FALSE;
- }
- else {
- fIsDuplicate = MultiHopWMEWMA$updateNbrCounters(pMHMsg->sourceaddr, pMHMsg->seqno, &iNbr);
- }
- if (!fIsDuplicate) {
- pMHMsg->sourceaddr = TOS_LOCAL_ADDRESS;
- pMHMsg->hopcount = MultiHopWMEWMA$gbCurrentHopCount;
- if (MultiHopWMEWMA$gpCurrentParent->id != TOS_UART_ADDR) {
- pMHMsg->seqno = MultiHopWMEWMA$gCurrentSeqNo++;
- }
- Msg->addr = MultiHopWMEWMA$gpCurrentParent->id;
- if (pMHMsg->originaddr != TOS_LOCAL_ADDRESS) {
- MultiHopWMEWMA$updateDescendant(pMHMsg->originaddr);
- }
- }
- else {
- Result = FAIL;
- }
- {
- }
- #line 716
- ;
- return Result;
- }
- static
- # 143 "/home/testuser/tinyos-1.x/tos/lib/Queue/QueuedSendM.nc"
- result_t QueuedSendM$QueueSendMsg$send(uint8_t id, uint16_t address, uint8_t length, TOS_MsgPtr msg)
- #line 143
- {
- {
- }
- #line 144
- ;
- if ((QueuedSendM$enqueue_next + 1) % QueuedSendM$MESSAGE_QUEUE_SIZE == QueuedSendM$dequeue_next) {
- {
- }
- #line 148
- ;
- return FAIL;
- }
- if (length > 70) {
- {
- }
- #line 153
- ;
- return FAIL;
- }
- if (msg == (void *)0) {
- {
- }
- #line 158
- ;
- return FAIL;
- }
- QueuedSendM$msgqueue[QueuedSendM$enqueue_next].address = address;
- QueuedSendM$msgqueue[QueuedSendM$enqueue_next].length = length;
- QueuedSendM$msgqueue[QueuedSendM$enqueue_next].id = id;
- QueuedSendM$msgqueue[QueuedSendM$enqueue_next].pMsg = msg;
- QueuedSendM$msgqueue[QueuedSendM$enqueue_next].xmit_count = 0;
- QueuedSendM$msgqueue[QueuedSendM$enqueue_next].pMsg->ack = 0;
- QueuedSendM$enqueue_next++;
- #line 169
- QueuedSendM$enqueue_next %= QueuedSendM$MESSAGE_QUEUE_SIZE;
- {
- }
- #line 171
- ;
- if (QueuedSendM$fQueueIdle) {
- QueuedSendM$fQueueIdle = FALSE;
- TOS_post(QueuedSendM$QueueServiceTask);
- }
- return SUCCESS;
- }
- static
- #line 121
- void QueuedSendM$QueueServiceTask(void)
- #line 121
- {
- uint8_t id;
- if (QueuedSendM$msgqueue[QueuedSendM$dequeue_next].pMsg != (void *)0) {
- QueuedSendM$Leds$greenToggle();
- {
- }
- #line 126
- ;
- id = QueuedSendM$msgqueue[QueuedSendM$dequeue_next].id;
- if (!QueuedSendM$SerialSendMsg$send(id, QueuedSendM$msgqueue[QueuedSendM$dequeue_next].address,
- QueuedSendM$msgqueue[QueuedSendM$dequeue_next].length,
- QueuedSendM$msgqueue[QueuedSendM$dequeue_next].pMsg)) {
- TOS_post(QueuedSendM$QueueServiceTask);
- {
- }
- #line 135
- ;
- }
- }
- else {
- QueuedSendM$fQueueIdle = TRUE;
- }
- }
- static
- # 158 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
- result_t FramerM$StartTx(void)
- #line 158
- {
- result_t Result = SUCCESS;
- bool fInitiate = FALSE;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 162
- {
- if (FramerM$gTxState == FramerM$TXSTATE_IDLE) {
- if (FramerM$gFlags & FramerM$FLAGS_TOKENPEND) {
- FramerM$gpTxBuf = (uint8_t *)&FramerM$gTxTokenBuf;
- FramerM$gTxProto = FramerM$PROTO_ACK;
- FramerM$gTxLength = sizeof FramerM$gTxTokenBuf;
- fInitiate = TRUE;
- FramerM$gTxState = FramerM$TXSTATE_PROTO;
- }
- else {
- #line 171
- if (FramerM$gFlags & FramerM$FLAGS_DATAPEND) {
- FramerM$gpTxBuf = (uint8_t *)FramerM$gpTxMsg;
- FramerM$gTxProto = FramerM$PROTO_PACKET_NOACK;
- FramerM$gTxLength = FramerM$gpTxMsg->length + (MSG_DATA_SIZE - DATA_LENGTH - 2);
- fInitiate = TRUE;
- FramerM$gTxState = FramerM$TXSTATE_PROTO;
- }
- else {
- #line 178
- if (FramerM$gFlags & FramerM$FLAGS_UNKNOWN) {
- FramerM$gpTxBuf = (uint8_t *)&FramerM$gTxUnknownBuf;
- FramerM$gTxProto = FramerM$PROTO_UNKNOWN;
- FramerM$gTxLength = sizeof FramerM$gTxUnknownBuf;
- fInitiate = TRUE;
- FramerM$gTxState = FramerM$TXSTATE_PROTO;
- }
- }
- }
- }
- }
- #line 188
- __nesc_atomic_end(__nesc_atomic); }
- #line 188
- if (fInitiate) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 189
- {
- FramerM$gTxRunningCRC = 0;
- #line 190
- FramerM$gTxByteCnt = 0;
- }
- #line 191
- __nesc_atomic_end(__nesc_atomic); }
- Result = FramerM$ByteComm$txByte(FramerM$HDLC_FLAG_BYTE);
- if (Result != SUCCESS) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 194
- FramerM$gTxState = FramerM$TXSTATE_ERROR;
- #line 194
- __nesc_atomic_end(__nesc_atomic); }
- TOS_post(FramerM$PacketSent);
- }
- }
- return Result;
- }
- static
- # 110 "/home/testuser/tinyos-1.x/tos/system/UARTM.nc"
- result_t UARTM$ByteComm$txByte(uint8_t data)
- #line 110
- {
- bool oldState;
- {
- }
- #line 113
- ;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 115
- {
- oldState = UARTM$state;
- UARTM$state = TRUE;
- }
- #line 118
- __nesc_atomic_end(__nesc_atomic); }
- if (oldState) {
- return FAIL;
- }
- UARTM$HPLUART$put(data);
- return SUCCESS;
- }
- static
- # 246 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
- void FramerM$PacketSent(void)
- #line 246
- {
- result_t TxResult = SUCCESS;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 249
- {
- if (FramerM$gTxState == FramerM$TXSTATE_ERROR) {
- TxResult = FAIL;
- FramerM$gTxState = FramerM$TXSTATE_IDLE;
- }
- }
- #line 254
- __nesc_atomic_end(__nesc_atomic); }
- if (FramerM$gTxProto == FramerM$PROTO_ACK) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 256
- FramerM$gFlags ^= FramerM$FLAGS_TOKENPEND;
- #line 256
- __nesc_atomic_end(__nesc_atomic); }
- }
- else {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 259
- FramerM$gFlags ^= FramerM$FLAGS_DATAPEND;
- #line 259
- __nesc_atomic_end(__nesc_atomic); }
- FramerM$BareSendMsg$sendDone((TOS_MsgPtr )FramerM$gpTxMsg, TxResult);
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 261
- FramerM$gpTxMsg = (void *)0;
- #line 261
- __nesc_atomic_end(__nesc_atomic); }
- }
- FramerM$StartTx();
- }
- static
- # 170 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
- result_t AMPromiscuous$reportSendDone(TOS_MsgPtr msg, result_t success)
- #line 170
- {
- {
- }
- #line 171
- ;
- AMPromiscuous$state = FALSE;
- AMPromiscuous$SendMsg$sendDone(msg->type, msg, success);
- AMPromiscuous$sendDone();
- return SUCCESS;
- }
- static
- # 205 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
- result_t MultiHopEngineM$SendMsg$sendDone(uint8_t id, TOS_MsgPtr pMsg, result_t success)
- #line 205
- {
- if (pMsg == MultiHopEngineM$FwdBufList[MultiHopEngineM$iFwdBufTail]) {
- MultiHopEngineM$iFwdBufTail++;
- #line 208
- MultiHopEngineM$iFwdBufTail %= MultiHopEngineM$FWD_QUEUE_SIZE;
- }
- else
- #line 209
- {
- MultiHopEngineM$Send$sendDone(id, pMsg, success);
- }
- return SUCCESS;
- }
- static
- # 1102 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- result_t CC1000RadioIntM$Send$send(TOS_MsgPtr pMsg)
- #line 1102
- {
- result_t Result = SUCCESS;
- uint8_t currentRadioState = 0;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 1106
- {
- if (CC1000RadioIntM$bTxBusy) {
- Result = FAIL;
- }
- else
- {
- CC1000RadioIntM$bTxBusy = TRUE;
- CC1000RadioIntM$txbufptr = pMsg;
- CC1000RadioIntM$txlength = pMsg->length + (MSG_DATA_SIZE - DATA_LENGTH - 2);
- if (CC1000RadioIntM$bCCAEnable) {
- if (CC1000RadioIntM$currentMAC == CC1000RadioIntM$BMAC) {
- CC1000RadioIntM$sMacDelay = CC1000RadioIntM$MacBackoff$initialBackoff(pMsg);
- }
- else {
- #line 1121
- CC1000RadioIntM$sMacDelay = CC1000RadioIntM$getZMACBackoff(0);
- }
- }
- else {
- #line 1123
- CC1000RadioIntM$sMacDelay = 0;
- }
- CC1000RadioIntM$bTxPending = TRUE;
- }
- currentRadioState = CC1000RadioIntM$RadioState;
- }
- #line 1131
- __nesc_atomic_end(__nesc_atomic); }
- if (Result) {
- if (currentRadioState == CC1000RadioIntM$POWER_DOWN_STATE) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 1135
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- #line 1135
- __nesc_atomic_end(__nesc_atomic); }
- CC1000RadioIntM$WakeupTimer$stop();
- CC1000RadioIntM$CC1000StdControl$start();
- CC1000RadioIntM$CC1000Control$BIASOn();
- CC1000RadioIntM$CC1000Control$RxMode();
- CC1000RadioIntM$SpiByteFifo$rxMode();
- CC1000RadioIntM$SpiByteFifo$enableIntr();
- if (CC1000RadioIntM$iSquelchCount > 30) {
- CC1000RadioIntM$SquelchTimer$start(TIMER_REPEAT, 2560);
- }
- else {
- #line 1145
- CC1000RadioIntM$SquelchTimer$start(TIMER_REPEAT, 128);
- }
- #line 1146
- CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, 16 * 2);
- }
- }
- return Result;
- }
- static
- #line 286
- uint16_t CC1000RadioIntM$getZMACBackoff(uint16_t residualBackoff)
- #line 286
- {
- if (residualBackoff > 0) {
- CC1000RadioIntM$congBackOffs++;
- if (CC1000RadioIntM$currentSlot == CC1000RadioIntM$ownSlot && residualBackoff >= 8) {
- return CC1000RadioIntM$getOwnerBackoff();
- }
- else {
- #line 291
- if (CC1000RadioIntM$currentSlot != CC1000RadioIntM$ownSlot && residualBackoff < 8) {
- if (residualBackoff + 8 < 8 + 32) {
- return residualBackoff + 8;
- }
- else {
- #line 295
- return CC1000RadioIntM$getNonOwnerBackoff();
- }
- }
- else {
- #line 297
- return residualBackoff;
- }
- }
- }
- else
- #line 298
- {
- if (CC1000RadioIntM$currentSlot == CC1000RadioIntM$ownSlot) {
- return CC1000RadioIntM$getOwnerBackoff();
- }
- else {
- #line 302
- return CC1000RadioIntM$getNonOwnerBackoff();
- }
- }
- }
- static
- # 168 "/home/testuser/tinyos-1.x/tos/system/TimerM.nc"
- result_t TimerM$Timer$stop(uint8_t id)
- #line 168
- {
- if (id >= NUM_TIMERS) {
- #line 170
- return FAIL;
- }
- #line 171
- if (TimerM$mState & (0x1L << id)) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 172
- TimerM$mState &= ~(0x1L << id);
- #line 172
- __nesc_atomic_end(__nesc_atomic); }
- if (!TimerM$mState) {
- TimerM$setIntervalFlag = 1;
- }
- return SUCCESS;
- }
- return FAIL;
- }
- # 144 "../../tos/platform/mica2/HPLADCM.nc"
- void __attribute((signal)) __vector_21(void)
- #line 144
- {
- uint16_t data = * (volatile uint16_t *)& * (volatile uint8_t *)(0x04 + 0x20);
- #line 146
- data &= 0x3ff;
- * (volatile uint8_t *)(0x06 + 0x20) |= 1 << 4;
- * (volatile uint8_t *)(0x06 + 0x20) &= ~(1 << 7);
- __nesc_enable_interrupt();
- HPLADCM$ADC$dataReady(data);
- }
- static
- #line 122
- result_t HPLADCM$ADC$samplePort(uint8_t port)
- #line 122
- {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 123
- {
- * (volatile uint8_t *)(0x07 + 0x20) = HPLADCM$TOSH_adc_portmap[port] & 0x1F;
- }
- #line 125
- __nesc_atomic_end(__nesc_atomic); }
- * (volatile uint8_t *)(0x06 + 0x20) |= 1 << 7;
- * (volatile uint8_t *)(0x06 + 0x20) |= 1 << 6;
- return SUCCESS;
- }
- static
- # 342 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- void CC1000RadioIntM$adjustSquelch(void)
- #line 342
- {
- uint16_t tempArray[9];
- char i;
- #line 344
- char j;
- #line 344
- char min;
- uint16_t min_value;
- uint32_t tempsquelch;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 348
- {
- CC1000RadioIntM$usSquelchTable[CC1000RadioIntM$usSquelchIndex] = CC1000RadioIntM$usTempSquelch;
- CC1000RadioIntM$usSquelchIndex++;
- if (CC1000RadioIntM$usSquelchIndex >= 9) {
- CC1000RadioIntM$usSquelchIndex = 0;
- }
- #line 353
- if (CC1000RadioIntM$iSquelchCount <= 30) {
- CC1000RadioIntM$iSquelchCount++;
- }
- }
- #line 356
- __nesc_atomic_end(__nesc_atomic); }
- for (i = 0; i < 9; i++) {
- tempArray[(int )i] = CC1000RadioIntM$usSquelchTable[(int )i];
- }
- min = 0;
- for (j = 0; j < 3; j++) {
- for (i = 1; i < 9; i++) {
- if (tempArray[(int )i] != 0xFFFF && (
- tempArray[(int )i] > tempArray[(int )min] ||
- tempArray[(int )min] == 0xFFFF)) {
- min = i;
- }
- }
- min_value = tempArray[(int )min];
- tempArray[(int )min] = 0xFFFF;
- }
- tempsquelch = (uint32_t )(CC1000RadioIntM$usSquelchVal << 5) + (uint32_t )(min_value << 1);
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 376
- CC1000RadioIntM$usSquelchVal = (uint16_t )(tempsquelch / 34 & 0x0FFFF);
- #line 376
- __nesc_atomic_end(__nesc_atomic); }
- }
- static
- # 422 "../../tos/platform/mica2/CC1000ControlM.nc"
- result_t CC1000ControlM$CC1000Control$TxMode(void)
- #line 422
- {
- CC1000ControlM$HPLChipcon$write(0x00, (((
- 1 << 7) | (1 << 6)) | (1 << 5)) | (
- 1 << 0));
- CC1000ControlM$HPLChipcon$write(0x09, CC1000ControlM$gCurrentParameters[29]);
- TOSH_uwait(250);
- CC1000ControlM$HPLChipcon$write(0x0B, CC1000ControlM$gCurrentParameters[0xb]);
- TOSH_uwait(20);
- return SUCCESS;
- }
- static
- # 198 "../../tos/platform/mica2/ADCREFM.nc"
- result_t ADCREFM$startGet(uint8_t port)
- #line 198
- {
- uint16_t PortMask;
- #line 199
- uint16_t oldReqVector = 1;
- result_t Result = SUCCESS;
- PortMask = 1 << port;
- if ((PortMask & ADCREFM$ReqVector) != 0) {
- Result = FAIL;
- }
- else {
- oldReqVector = ADCREFM$ReqVector;
- ADCREFM$ReqVector |= PortMask;
- if (oldReqVector == 0) {
- if ((Result = ADCREFM$HPLADC$samplePort(port))) {
- ADCREFM$ReqPort = port;
- }
- }
- }
- return Result;
- }
- static
- # 1586 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- void CC1000RadioIntM$IdleTimerTask(void)
- #line 1586
- {
- if (CC1000RadioIntM$iSquelchCount > 30) {
- CC1000RadioIntM$SquelchTimer$start(TIMER_REPEAT, 2560);
- }
- else {
- #line 1590
- CC1000RadioIntM$SquelchTimer$start(TIMER_REPEAT, 128);
- }
- #line 1591
- CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, CC1000RadioIntM$TIME_AFTER_CHECK);
- }
- static
- # 82 "../../tos/platform/mica2/HPLSpiM.nc"
- result_t HPLSpiM$SpiByteFifo$disableIntr(void)
- #line 82
- {
- * (volatile uint8_t *)(0x0D + 0x20) &= ~(1 << 7);
- * (volatile uint8_t *)(0x17 + 0x20) |= 1 << 0;
- * (volatile uint8_t *)(0x18 + 0x20) &= ~(1 << 0);
- HPLSpiM$PowerManagement$adjustPower();
- return SUCCESS;
- }
- # 167 "/home/testuser/tinyos-1.x/tos/platform/mica/HPLClock.nc"
- void __attribute((interrupt)) __vector_15(void)
- #line 167
- {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 168
- {
- if (HPLClock$set_flag) {
- HPLClock$mscale = HPLClock$nextScale;
- HPLClock$nextScale |= 0x8;
- * (volatile uint8_t *)(0x33 + 0x20) = HPLClock$nextScale;
- * (volatile uint8_t *)(0x31 + 0x20) = HPLClock$minterval;
- HPLClock$set_flag = 0;
- }
- }
- #line 177
- __nesc_atomic_end(__nesc_atomic); }
- HPLClock$Clock$fire();
- }
- static
- # 563 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- result_t CC1000RadioIntM$SetDrand$Set(nodeInfo *mInfo, uint8_t nHop, nodeInfo *nInfo, uint16_t sSize)
- #line 563
- {
- uint32_t slotOffset = 0;
- #line 564
- uint32_t globalTimeStamp = 0;
- GTime loctime;
- uint8_t i = 0;
- CC1000RadioIntM$slotSize = sSize;
- CC1000RadioIntM$nextHop = nHop;
- for (i = 0; i < MAX_NBR; i++) {
- CC1000RadioIntM$nbrInfo[i].nodeID = 0xFF;
- CC1000RadioIntM$nbrInfo[i].slot = 0xFF;
- CC1000RadioIntM$nbrInfo[i].frame = 0xFF;
- CC1000RadioIntM$nbrInfo[i].bitMap = 0x0;
- }
- # 1 "../../tos/platform/mica2/nbrTable.h"
- if (TOS_LOCAL_ADDRESS == 2) {
- CC1000RadioIntM$ownSlot = 4;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 28;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 3;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 27;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 5;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 0;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 9;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 21;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 13;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- }
- else {
- #line 24
- if (TOS_LOCAL_ADDRESS == 3) {
- CC1000RadioIntM$ownSlot = 14;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 31;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 5;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 15;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 6;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 41;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 12;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 40;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 11;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- CC1000RadioIntM$nbrInfo[4].nodeID = 32;
- CC1000RadioIntM$nbrInfo[4].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[4].frame = 16;
- CC1000RadioIntM$nbrInfo[4].slot = 2;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[4].slot, CC1000RadioIntM$nbrInfo[4].frame);
- CC1000RadioIntM$nbrInfo[5].nodeID = 17;
- CC1000RadioIntM$nbrInfo[5].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[5].frame = 16;
- CC1000RadioIntM$nbrInfo[5].slot = 4;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[5].slot, CC1000RadioIntM$nbrInfo[5].frame);
- CC1000RadioIntM$nbrInfo[6].nodeID = 42;
- CC1000RadioIntM$nbrInfo[6].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[6].frame = 16;
- CC1000RadioIntM$nbrInfo[6].slot = 7;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[6].slot, CC1000RadioIntM$nbrInfo[6].frame);
- CC1000RadioIntM$nbrInfo[7].nodeID = 27;
- CC1000RadioIntM$nbrInfo[7].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[7].frame = 16;
- CC1000RadioIntM$nbrInfo[7].slot = 5;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[7].slot, CC1000RadioIntM$nbrInfo[7].frame);
- }
- else {
- #line 67
- if (TOS_LOCAL_ADDRESS == 9) {
- CC1000RadioIntM$ownSlot = 1;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 21;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 13;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 28;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 3;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 27;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 5;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 0;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 9;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- }
- else {
- #line 90
- if (TOS_LOCAL_ADDRESS == 39) {
- CC1000RadioIntM$ownSlot = 2;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 0;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 9;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- }
- else {
- #line 98
- if (TOS_LOCAL_ADDRESS == 10) {
- CC1000RadioIntM$ownSlot = 0;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 21;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 13;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 0;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 9;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 28;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 3;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 27;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 5;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- }
- else {
- #line 121
- if (TOS_LOCAL_ADDRESS == 24) {
- CC1000RadioIntM$ownSlot = 7;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 0;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 9;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- }
- else {
- #line 129
- if (TOS_LOCAL_ADDRESS == 1) {
- CC1000RadioIntM$ownSlot = 6;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 21;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 13;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 37;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 10;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 0;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 9;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- }
- else {
- #line 147
- if (TOS_LOCAL_ADDRESS == 21) {
- CC1000RadioIntM$ownSlot = 13;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 28;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 3;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 1;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 6;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 9;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 1;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 27;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 5;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- CC1000RadioIntM$nbrInfo[4].nodeID = 10;
- CC1000RadioIntM$nbrInfo[4].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[4].frame = 16;
- CC1000RadioIntM$nbrInfo[4].slot = 0;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[4].slot, CC1000RadioIntM$nbrInfo[4].frame);
- CC1000RadioIntM$nbrInfo[5].nodeID = 31;
- CC1000RadioIntM$nbrInfo[5].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[5].frame = 16;
- CC1000RadioIntM$nbrInfo[5].slot = 5;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[5].slot, CC1000RadioIntM$nbrInfo[5].frame);
- CC1000RadioIntM$nbrInfo[6].nodeID = 15;
- CC1000RadioIntM$nbrInfo[6].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[6].frame = 16;
- CC1000RadioIntM$nbrInfo[6].slot = 6;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[6].slot, CC1000RadioIntM$nbrInfo[6].frame);
- CC1000RadioIntM$nbrInfo[7].nodeID = 41;
- CC1000RadioIntM$nbrInfo[7].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[7].frame = 16;
- CC1000RadioIntM$nbrInfo[7].slot = 12;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[7].slot, CC1000RadioIntM$nbrInfo[7].frame);
- CC1000RadioIntM$nbrInfo[8].nodeID = 40;
- CC1000RadioIntM$nbrInfo[8].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[8].frame = 16;
- CC1000RadioIntM$nbrInfo[8].slot = 11;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[8].slot, CC1000RadioIntM$nbrInfo[8].frame);
- CC1000RadioIntM$nbrInfo[9].nodeID = 32;
- CC1000RadioIntM$nbrInfo[9].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[9].frame = 16;
- CC1000RadioIntM$nbrInfo[9].slot = 2;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[9].slot, CC1000RadioIntM$nbrInfo[9].frame);
- CC1000RadioIntM$nbrInfo[10].nodeID = 17;
- CC1000RadioIntM$nbrInfo[10].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[10].frame = 16;
- CC1000RadioIntM$nbrInfo[10].slot = 4;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[10].slot, CC1000RadioIntM$nbrInfo[10].frame);
- CC1000RadioIntM$nbrInfo[11].nodeID = 42;
- CC1000RadioIntM$nbrInfo[11].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[11].frame = 16;
- CC1000RadioIntM$nbrInfo[11].slot = 7;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[11].slot, CC1000RadioIntM$nbrInfo[11].frame);
- CC1000RadioIntM$nbrInfo[12].nodeID = 2;
- CC1000RadioIntM$nbrInfo[12].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[12].frame = 16;
- CC1000RadioIntM$nbrInfo[12].slot = 4;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[12].slot, CC1000RadioIntM$nbrInfo[12].frame);
- }
- else {
- #line 215
- if (TOS_LOCAL_ADDRESS == 37) {
- CC1000RadioIntM$ownSlot = 10;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 28;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 3;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 1;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 6;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 27;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 5;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 31;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 5;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- CC1000RadioIntM$nbrInfo[4].nodeID = 15;
- CC1000RadioIntM$nbrInfo[4].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[4].frame = 16;
- CC1000RadioIntM$nbrInfo[4].slot = 6;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[4].slot, CC1000RadioIntM$nbrInfo[4].frame);
- CC1000RadioIntM$nbrInfo[5].nodeID = 41;
- CC1000RadioIntM$nbrInfo[5].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[5].frame = 16;
- CC1000RadioIntM$nbrInfo[5].slot = 12;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[5].slot, CC1000RadioIntM$nbrInfo[5].frame);
- CC1000RadioIntM$nbrInfo[6].nodeID = 40;
- CC1000RadioIntM$nbrInfo[6].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[6].frame = 16;
- CC1000RadioIntM$nbrInfo[6].slot = 11;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[6].slot, CC1000RadioIntM$nbrInfo[6].frame);
- CC1000RadioIntM$nbrInfo[7].nodeID = 32;
- CC1000RadioIntM$nbrInfo[7].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[7].frame = 16;
- CC1000RadioIntM$nbrInfo[7].slot = 2;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[7].slot, CC1000RadioIntM$nbrInfo[7].frame);
- CC1000RadioIntM$nbrInfo[8].nodeID = 17;
- CC1000RadioIntM$nbrInfo[8].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[8].frame = 16;
- CC1000RadioIntM$nbrInfo[8].slot = 4;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[8].slot, CC1000RadioIntM$nbrInfo[8].frame);
- CC1000RadioIntM$nbrInfo[9].nodeID = 42;
- CC1000RadioIntM$nbrInfo[9].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[9].frame = 16;
- CC1000RadioIntM$nbrInfo[9].slot = 7;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[9].slot, CC1000RadioIntM$nbrInfo[9].frame);
- }
- else {
- #line 268
- if (TOS_LOCAL_ADDRESS == 27) {
- CC1000RadioIntM$ownSlot = 5;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 21;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 13;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 37;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 10;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 9;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 1;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 2;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 4;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- CC1000RadioIntM$nbrInfo[4].nodeID = 10;
- CC1000RadioIntM$nbrInfo[4].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[4].frame = 16;
- CC1000RadioIntM$nbrInfo[4].slot = 0;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[4].slot, CC1000RadioIntM$nbrInfo[4].frame);
- CC1000RadioIntM$nbrInfo[5].nodeID = 38;
- CC1000RadioIntM$nbrInfo[5].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[5].frame = 16;
- CC1000RadioIntM$nbrInfo[5].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[5].slot, CC1000RadioIntM$nbrInfo[5].frame);
- CC1000RadioIntM$nbrInfo[6].nodeID = 0;
- CC1000RadioIntM$nbrInfo[6].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[6].frame = 16;
- CC1000RadioIntM$nbrInfo[6].slot = 9;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[6].slot, CC1000RadioIntM$nbrInfo[6].frame);
- CC1000RadioIntM$nbrInfo[7].nodeID = 40;
- CC1000RadioIntM$nbrInfo[7].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[7].frame = 16;
- CC1000RadioIntM$nbrInfo[7].slot = 11;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[7].slot, CC1000RadioIntM$nbrInfo[7].frame);
- CC1000RadioIntM$nbrInfo[8].nodeID = 17;
- CC1000RadioIntM$nbrInfo[8].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[8].frame = 16;
- CC1000RadioIntM$nbrInfo[8].slot = 4;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[8].slot, CC1000RadioIntM$nbrInfo[8].frame);
- CC1000RadioIntM$nbrInfo[9].nodeID = 41;
- CC1000RadioIntM$nbrInfo[9].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[9].frame = 16;
- CC1000RadioIntM$nbrInfo[9].slot = 12;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[9].slot, CC1000RadioIntM$nbrInfo[9].frame);
- CC1000RadioIntM$nbrInfo[10].nodeID = 43;
- CC1000RadioIntM$nbrInfo[10].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[10].frame = 16;
- CC1000RadioIntM$nbrInfo[10].slot = 0;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[10].slot, CC1000RadioIntM$nbrInfo[10].frame);
- CC1000RadioIntM$nbrInfo[11].nodeID = 15;
- CC1000RadioIntM$nbrInfo[11].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[11].frame = 16;
- CC1000RadioIntM$nbrInfo[11].slot = 6;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[11].slot, CC1000RadioIntM$nbrInfo[11].frame);
- CC1000RadioIntM$nbrInfo[12].nodeID = 42;
- CC1000RadioIntM$nbrInfo[12].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[12].frame = 16;
- CC1000RadioIntM$nbrInfo[12].slot = 7;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[12].slot, CC1000RadioIntM$nbrInfo[12].frame);
- CC1000RadioIntM$nbrInfo[13].nodeID = 18;
- CC1000RadioIntM$nbrInfo[13].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[13].frame = 16;
- CC1000RadioIntM$nbrInfo[13].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[13].slot, CC1000RadioIntM$nbrInfo[13].frame);
- CC1000RadioIntM$nbrInfo[14].nodeID = 5;
- CC1000RadioIntM$nbrInfo[14].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[14].frame = 16;
- CC1000RadioIntM$nbrInfo[14].slot = 1;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[14].slot, CC1000RadioIntM$nbrInfo[14].frame);
- CC1000RadioIntM$nbrInfo[15].nodeID = 3;
- CC1000RadioIntM$nbrInfo[15].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[15].frame = 16;
- CC1000RadioIntM$nbrInfo[15].slot = 14;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[15].slot, CC1000RadioIntM$nbrInfo[15].frame);
- }
- else {
- #line 351
- if (TOS_LOCAL_ADDRESS == 38) {
- CC1000RadioIntM$ownSlot = 8;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 28;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 3;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 27;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 5;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 31;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 5;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 15;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 6;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- CC1000RadioIntM$nbrInfo[4].nodeID = 41;
- CC1000RadioIntM$nbrInfo[4].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[4].frame = 16;
- CC1000RadioIntM$nbrInfo[4].slot = 12;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[4].slot, CC1000RadioIntM$nbrInfo[4].frame);
- CC1000RadioIntM$nbrInfo[5].nodeID = 40;
- CC1000RadioIntM$nbrInfo[5].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[5].frame = 16;
- CC1000RadioIntM$nbrInfo[5].slot = 11;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[5].slot, CC1000RadioIntM$nbrInfo[5].frame);
- CC1000RadioIntM$nbrInfo[6].nodeID = 32;
- CC1000RadioIntM$nbrInfo[6].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[6].frame = 16;
- CC1000RadioIntM$nbrInfo[6].slot = 2;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[6].slot, CC1000RadioIntM$nbrInfo[6].frame);
- CC1000RadioIntM$nbrInfo[7].nodeID = 17;
- CC1000RadioIntM$nbrInfo[7].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[7].frame = 16;
- CC1000RadioIntM$nbrInfo[7].slot = 4;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[7].slot, CC1000RadioIntM$nbrInfo[7].frame);
- CC1000RadioIntM$nbrInfo[8].nodeID = 42;
- CC1000RadioIntM$nbrInfo[8].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[8].frame = 16;
- CC1000RadioIntM$nbrInfo[8].slot = 7;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[8].slot, CC1000RadioIntM$nbrInfo[8].frame);
- }
- else {
- #line 399
- if (TOS_LOCAL_ADDRESS == 0) {
- CC1000RadioIntM$ownSlot = 9;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 39;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 2;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 24;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 7;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 9;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 1;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 10;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 0;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- CC1000RadioIntM$nbrInfo[4].nodeID = 2;
- CC1000RadioIntM$nbrInfo[4].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[4].frame = 16;
- CC1000RadioIntM$nbrInfo[4].slot = 4;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[4].slot, CC1000RadioIntM$nbrInfo[4].frame);
- CC1000RadioIntM$nbrInfo[5].nodeID = 43;
- CC1000RadioIntM$nbrInfo[5].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[5].frame = 16;
- CC1000RadioIntM$nbrInfo[5].slot = 0;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[5].slot, CC1000RadioIntM$nbrInfo[5].frame);
- CC1000RadioIntM$nbrInfo[6].nodeID = 5;
- CC1000RadioIntM$nbrInfo[6].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[6].frame = 16;
- CC1000RadioIntM$nbrInfo[6].slot = 1;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[6].slot, CC1000RadioIntM$nbrInfo[6].frame);
- CC1000RadioIntM$nbrInfo[7].nodeID = 1;
- CC1000RadioIntM$nbrInfo[7].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[7].frame = 16;
- CC1000RadioIntM$nbrInfo[7].slot = 6;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[7].slot, CC1000RadioIntM$nbrInfo[7].frame);
- CC1000RadioIntM$nbrInfo[8].nodeID = 28;
- CC1000RadioIntM$nbrInfo[8].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[8].frame = 16;
- CC1000RadioIntM$nbrInfo[8].slot = 3;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[8].slot, CC1000RadioIntM$nbrInfo[8].frame);
- CC1000RadioIntM$nbrInfo[9].nodeID = 14;
- CC1000RadioIntM$nbrInfo[9].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[9].frame = 16;
- CC1000RadioIntM$nbrInfo[9].slot = 10;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[9].slot, CC1000RadioIntM$nbrInfo[9].frame);
- CC1000RadioIntM$nbrInfo[10].nodeID = 19;
- CC1000RadioIntM$nbrInfo[10].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[10].frame = 16;
- CC1000RadioIntM$nbrInfo[10].slot = 3;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[10].slot, CC1000RadioIntM$nbrInfo[10].frame);
- CC1000RadioIntM$nbrInfo[11].nodeID = 18;
- CC1000RadioIntM$nbrInfo[11].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[11].frame = 16;
- CC1000RadioIntM$nbrInfo[11].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[11].slot, CC1000RadioIntM$nbrInfo[11].frame);
- }
- else {
- #line 462
- if (TOS_LOCAL_ADDRESS == 31) {
- CC1000RadioIntM$ownSlot = 5;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 38;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 21;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 13;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 19;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 3;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 37;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 10;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- CC1000RadioIntM$nbrInfo[4].nodeID = 3;
- CC1000RadioIntM$nbrInfo[4].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[4].frame = 16;
- CC1000RadioIntM$nbrInfo[4].slot = 14;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[4].slot, CC1000RadioIntM$nbrInfo[4].frame);
- }
- else {
- #line 490
- if (TOS_LOCAL_ADDRESS == 41) {
- CC1000RadioIntM$ownSlot = 12;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 38;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 21;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 13;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 3;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 14;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- }
- else {
- #line 508
- if (TOS_LOCAL_ADDRESS == 40) {
- CC1000RadioIntM$ownSlot = 11;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 18;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 38;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 21;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 13;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 3;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 14;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- }
- else {
- #line 531
- if (TOS_LOCAL_ADDRESS == 28) {
- CC1000RadioIntM$ownSlot = 3;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 21;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 13;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 37;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 10;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 9;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 1;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 2;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 4;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- CC1000RadioIntM$nbrInfo[4].nodeID = 10;
- CC1000RadioIntM$nbrInfo[4].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[4].frame = 16;
- CC1000RadioIntM$nbrInfo[4].slot = 0;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[4].slot, CC1000RadioIntM$nbrInfo[4].frame);
- CC1000RadioIntM$nbrInfo[5].nodeID = 38;
- CC1000RadioIntM$nbrInfo[5].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[5].frame = 16;
- CC1000RadioIntM$nbrInfo[5].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[5].slot, CC1000RadioIntM$nbrInfo[5].frame);
- CC1000RadioIntM$nbrInfo[6].nodeID = 0;
- CC1000RadioIntM$nbrInfo[6].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[6].frame = 16;
- CC1000RadioIntM$nbrInfo[6].slot = 9;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[6].slot, CC1000RadioIntM$nbrInfo[6].frame);
- }
- else {
- #line 569
- if (TOS_LOCAL_ADDRESS == 15) {
- CC1000RadioIntM$ownSlot = 6;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 38;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 21;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 13;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 19;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 3;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 14;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 10;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- CC1000RadioIntM$nbrInfo[4].nodeID = 18;
- CC1000RadioIntM$nbrInfo[4].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[4].frame = 16;
- CC1000RadioIntM$nbrInfo[4].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[4].slot, CC1000RadioIntM$nbrInfo[4].frame);
- CC1000RadioIntM$nbrInfo[5].nodeID = 3;
- CC1000RadioIntM$nbrInfo[5].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[5].frame = 16;
- CC1000RadioIntM$nbrInfo[5].slot = 14;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[5].slot, CC1000RadioIntM$nbrInfo[5].frame);
- }
- else {
- #line 602
- if (TOS_LOCAL_ADDRESS == 17) {
- CC1000RadioIntM$ownSlot = 4;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 38;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 21;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 13;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 19;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 3;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 37;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 10;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- CC1000RadioIntM$nbrInfo[4].nodeID = 18;
- CC1000RadioIntM$nbrInfo[4].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[4].frame = 16;
- CC1000RadioIntM$nbrInfo[4].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[4].slot, CC1000RadioIntM$nbrInfo[4].frame);
- CC1000RadioIntM$nbrInfo[5].nodeID = 3;
- CC1000RadioIntM$nbrInfo[5].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[5].frame = 16;
- CC1000RadioIntM$nbrInfo[5].slot = 14;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[5].slot, CC1000RadioIntM$nbrInfo[5].frame);
- }
- else {
- #line 635
- if (TOS_LOCAL_ADDRESS == 32) {
- CC1000RadioIntM$ownSlot = 2;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 38;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 21;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 13;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 37;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 10;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 19;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 3;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- CC1000RadioIntM$nbrInfo[4].nodeID = 14;
- CC1000RadioIntM$nbrInfo[4].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[4].frame = 16;
- CC1000RadioIntM$nbrInfo[4].slot = 10;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[4].slot, CC1000RadioIntM$nbrInfo[4].frame);
- CC1000RadioIntM$nbrInfo[5].nodeID = 3;
- CC1000RadioIntM$nbrInfo[5].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[5].frame = 16;
- CC1000RadioIntM$nbrInfo[5].slot = 14;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[5].slot, CC1000RadioIntM$nbrInfo[5].frame);
- }
- else {
- #line 668
- if (TOS_LOCAL_ADDRESS == 18) {
- CC1000RadioIntM$ownSlot = 8;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 43;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 0;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 17;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 4;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 15;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 6;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 0;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 9;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- CC1000RadioIntM$nbrInfo[4].nodeID = 40;
- CC1000RadioIntM$nbrInfo[4].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[4].frame = 16;
- CC1000RadioIntM$nbrInfo[4].slot = 11;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[4].slot, CC1000RadioIntM$nbrInfo[4].frame);
- }
- else {
- #line 696
- if (TOS_LOCAL_ADDRESS == 42) {
- CC1000RadioIntM$ownSlot = 7;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 38;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 21;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 13;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 3;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 14;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- }
- else {
- #line 714
- if (TOS_LOCAL_ADDRESS == 43) {
- CC1000RadioIntM$ownSlot = 0;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 18;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 8;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 0;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 9;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- }
- else {
- #line 727
- if (TOS_LOCAL_ADDRESS == 5) {
- CC1000RadioIntM$ownSlot = 1;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 0;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 9;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- }
- else {
- #line 735
- if (TOS_LOCAL_ADDRESS == 19) {
- CC1000RadioIntM$ownSlot = 3;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 31;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 5;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 17;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 4;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 15;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 6;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- CC1000RadioIntM$nbrInfo[3].nodeID = 32;
- CC1000RadioIntM$nbrInfo[3].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[3].frame = 16;
- CC1000RadioIntM$nbrInfo[3].slot = 2;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[3].slot, CC1000RadioIntM$nbrInfo[3].frame);
- CC1000RadioIntM$nbrInfo[4].nodeID = 0;
- CC1000RadioIntM$nbrInfo[4].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[4].frame = 16;
- CC1000RadioIntM$nbrInfo[4].slot = 9;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[4].slot, CC1000RadioIntM$nbrInfo[4].frame);
- }
- else {
- #line 763
- if (TOS_LOCAL_ADDRESS == 14) {
- CC1000RadioIntM$ownSlot = 10;
- CC1000RadioIntM$localFrameLength = 16;
- CC1000RadioIntM$nbrInfo[0].nodeID = 15;
- CC1000RadioIntM$nbrInfo[0].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[0].frame = 16;
- CC1000RadioIntM$nbrInfo[0].slot = 6;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[0].slot, CC1000RadioIntM$nbrInfo[0].frame);
- CC1000RadioIntM$nbrInfo[1].nodeID = 32;
- CC1000RadioIntM$nbrInfo[1].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[1].frame = 16;
- CC1000RadioIntM$nbrInfo[1].slot = 2;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[1].slot, CC1000RadioIntM$nbrInfo[1].frame);
- CC1000RadioIntM$nbrInfo[2].nodeID = 0;
- CC1000RadioIntM$nbrInfo[2].bitMap = TWO_HOP;
- CC1000RadioIntM$nbrInfo[2].frame = 16;
- CC1000RadioIntM$nbrInfo[2].slot = 9;
- CC1000RadioIntM$Blacklist(CC1000RadioIntM$nbrInfo[2].slot, CC1000RadioIntM$nbrInfo[2].frame);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- # 630 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- CC1000RadioIntM$localFrameSize = CC1000RadioIntM$localFrameLength * CC1000RadioIntM$slotSize;
- CC1000RadioIntM$globalFrameSize = CC1000RadioIntM$globalFrameLength * CC1000RadioIntM$slotSize;
- CC1000RadioIntM$slotMultiplier = (uint16_t )(CC1000RadioIntM$slotSize * 1.024);
- CC1000RadioIntM$SClock$getTime(&loctime);
- globalTimeStamp = (uint32_t )(loctime.mticks * 568.889 + loctime.sticks * 0.00868056);
- slotOffset = (uint32_t )(1.024 * (CC1000RadioIntM$slotSize - globalTimeStamp % CC1000RadioIntM$slotSize));
- CC1000RadioIntM$slotNum = (uint32_t )(globalTimeStamp / CC1000RadioIntM$slotSize);
- CC1000RadioIntM$currentSlot = CC1000RadioIntM$slotNum & (CC1000RadioIntM$localFrameLength - 1);
- CC1000RadioIntM$globalSlot = CC1000RadioIntM$slotNum & (CC1000RadioIntM$globalFrameLength - 1);
- CC1000RadioIntM$TDMATimer$start(TIMER_ONE_SHOT, slotOffset);
- return SUCCESS;
- }
- static
- #line 409
- void CC1000RadioIntM$Blacklist(uint8_t slot, uint8_t fsize)
- #line 409
- {
- uint8_t black_slot;
- #line 411
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 411
- {
- if (fsize <= CC1000RadioIntM$globalFrameLength) {
- black_slot = slot;
- while (black_slot < CC1000RadioIntM$globalFrameLength) {
- uint32_t tempHCL2 = 0x1;
- #line 416
- tempHCL2 = tempHCL2 << black_slot;
- CC1000RadioIntM$curHCLlist = CC1000RadioIntM$curHCLlist | tempHCL2;
- black_slot = black_slot + fsize;
- }
- }
- }
- #line 421
- __nesc_atomic_end(__nesc_atomic); }
- }
- static
- # 95 "../../tos/platform/mica2/HPLSClock.nc"
- void HPLSClock$SClock$getTime(GTime *t)
- #line 95
- {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 96
- {
- t->sticks = * (volatile uint16_t *)0x88;
- if (* (volatile uint8_t *)(uint16_t )& * (volatile uint8_t *)0x7C & (1 << 4)) {
- HPLSClock$MTicks++;
- * (volatile uint8_t *)0x7C |= 1 << 4;
- HPLSClock$SClock$fire(HPLSClock$MTicks);
- }
- t->mticks = HPLSClock$MTicks;
- }
- #line 104
- __nesc_atomic_end(__nesc_atomic); }
- }
- static
- # 52 "../../tos/interfaces/SODebug.h"
- int MultiHopTtestM$sprintf(uint8_t *buf, const uint8_t *format, ...)
- {
- uint8_t scratch[64];
- uint8_t format_flag;
- uint16_t u_val = 0;
- #line 57
- uint16_t base;
- uint8_t *ptr;
- MultiHopTtestM$va_list ap;
- bool b_ChkForNegInt = FALSE;
- __builtin_va_start(ap, format);
- for (; ; ) {
- while ((format_flag = * format++) != '%') {
- if (!format_flag) {
- #line 65
- __builtin_va_end(ap);
- #line 65
- return 0;
- }
- #line 66
- *buf = format_flag;
- #line 66
- buf++;
- #line 66
- *buf = 0;
- }
- b_ChkForNegInt = FALSE;
- switch ((format_flag = * format++)) {
- case 'c':
- format_flag = (__builtin_va_arg(ap, int ));
- default:
- *buf = format_flag;
- #line 74
- buf++;
- #line 74
- *buf = 0;
- continue;
- case 'S':
- case 's':
- ptr = (__builtin_va_arg(ap, char *));
- strcat(buf, ptr);
- continue;
- case 'o':
- base = 8;
- *buf = '0';
- #line 83
- buf++;
- #line 83
- *buf = 0;
- goto CONVERSION_LOOP;
- case 'i':
- b_ChkForNegInt = TRUE;
- case 'u':
- base = 10;
- goto CONVERSION_LOOP;
- case 'x':
- base = 16;
- CONVERSION_LOOP:
- u_val = (__builtin_va_arg(ap, int ));
- if (b_ChkForNegInt) {
- if ((int )u_val < 0) {
- u_val = -u_val;
- *buf = '-';
- #line 103
- buf++;
- #line 103
- *buf = 0;
- }
- }
- ptr = scratch + 64;
- * --ptr = 0;
- do {
- char ch = u_val % base + '0';
- #line 111
- if (ch > '9') {
- ch += 'a' - '9' - 1;
- }
- #line 113
- * --ptr = ch;
- u_val /= base;
- }
- while (
- #line 115
- u_val);
- strcat(buf, ptr);
- buf += strlen(ptr);
- }
- }
- }
- static
- #line 42
- void MultiHopTtestM$writedebug(void)
- #line 42
- {
- int i = 0;
- #line 44
- MultiHopTtestM$UARTPutChar('n');
- while (MultiHopTtestM$debugbuf[i] != 'n')
- MultiHopTtestM$UARTPutChar(MultiHopTtestM$debugbuf[i++]);
- }
- static
- #line 35
- void MultiHopTtestM$UARTPutChar(char c)
- #line 35
- {
- if (c == 'n') {
- MultiHopTtestM$UARTPutChar('r');
- }
- #line 38
- do {
- }
- while (
- #line 38
- !(* (volatile uint8_t *)(uint16_t )& * (volatile uint8_t *)(0x0B + 0x20) & (1 << 5)));
- * (volatile uint8_t *)(0x0C + 0x20) = c;
- }
- static
- # 1166 "../../tos/platform/mica2/CC1000RadioIntM.nc"
- result_t CC1000RadioIntM$SpiByteFifo$dataReady(uint8_t data_in)
- #line 1166
- {
- GTime loctime;
- #line 1168
- CC1000RadioIntM$RadioSendCoordinator$blockTimer();
- CC1000RadioIntM$RadioReceiveCoordinator$blockTimer();
- if (CC1000RadioIntM$bInvertRxData) {
- data_in = ~data_in;
- }
- switch (CC1000RadioIntM$RadioState) {
- case CC1000RadioIntM$TX_STATE:
- {
- CC1000RadioIntM$SpiByteFifo$writeByte(CC1000RadioIntM$NextTxByte);
- CC1000RadioIntM$TxByteCnt++;
- switch (CC1000RadioIntM$RadioTxState) {
- case CC1000RadioIntM$TXSTATE_PREAMBLE:
- CC1000RadioIntM$send_sum++;
- if (!(CC1000RadioIntM$TxByteCnt < CC1000RadioIntM$preamblelen) || (
- CC1000RadioIntM$txbufptr->strength == 0xffff && CC1000RadioIntM$TxByteCnt >= CC1000RadioIntM$PREAMBLE_LENGTH_TO_BASE)) {
- CC1000RadioIntM$NextTxByte = CC1000RadioIntM$SYNC_BYTE;
- CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_SYNC;
- }
- break;
- case CC1000RadioIntM$TXSTATE_SYNC:
- CC1000RadioIntM$send_sum++;
- CC1000RadioIntM$NextTxByte = CC1000RadioIntM$NSYNC_BYTE;
- CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_DATA;
- CC1000RadioIntM$TxByteCnt = -1;
- if (CC1000RadioIntM$txbufptr->type == 223) {
- syncMsgType *syncMsgPtr = (syncMsgType *)CC1000RadioIntM$txbufptr->data;
- #line 1204
- CC1000RadioIntM$SClock$getTime(&loctime);
- syncMsgPtr->mticks = loctime.mticks;
- syncMsgPtr->sticks = loctime.sticks;
- syncMsgPtr->trust = 1;
- syncMsgPtr->sender = TOS_LOCAL_ADDRESS;
- }
- CC1000RadioIntM$RadioSendCoordinator$startSymbol(8, 0, CC1000RadioIntM$txbufptr);
- break;
- case CC1000RadioIntM$TXSTATE_DATA:
- CC1000RadioIntM$send_sum++;
- if ((uint8_t )CC1000RadioIntM$TxByteCnt < CC1000RadioIntM$txlength) {
- if (CC1000RadioIntM$txbufptr->type == 223 && CC1000RadioIntM$TxByteCnt == 5) {
- syncMsgType *syncMsgPtr = (syncMsgType *)CC1000RadioIntM$txbufptr->data;
- #line 1219
- CC1000RadioIntM$SClock$getTime(&loctime);
- CC1000RadioIntM$AddTime(&loctime, &loctime, &CC1000RadioIntM$constOffset);
- syncMsgPtr->mticks = loctime.mticks;
- syncMsgPtr->sticks = loctime.sticks;
- }
- CC1000RadioIntM$NextTxByte = ((uint8_t *)CC1000RadioIntM$txbufptr)[CC1000RadioIntM$TxByteCnt];
- CC1000RadioIntM$usRunningCRC = crcByte(CC1000RadioIntM$usRunningCRC, CC1000RadioIntM$NextTxByte);
- CC1000RadioIntM$RadioSendCoordinator$byte(CC1000RadioIntM$txbufptr, (uint8_t )CC1000RadioIntM$TxByteCnt);
- }
- else {
- CC1000RadioIntM$NextTxByte = (uint8_t )CC1000RadioIntM$usRunningCRC;
- CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_CRC;
- }
- break;
- case CC1000RadioIntM$TXSTATE_CRC:
- CC1000RadioIntM$send_sum++;
- CC1000RadioIntM$NextTxByte = (uint8_t )(CC1000RadioIntM$usRunningCRC >> 8);
- CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_FLUSH;
- CC1000RadioIntM$TxByteCnt = 0;
- break;
- case CC1000RadioIntM$TXSTATE_FLUSH:
- CC1000RadioIntM$send_sum++;
- if (CC1000RadioIntM$TxByteCnt > 3) {
- CC1000RadioIntM$TxByteCnt = 0;
- if (CC1000RadioIntM$bAckEnable) {
- CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_WAIT_FOR_ACK;
- }
- else
- #line 1250
- {
- CC1000RadioIntM$packetsSent++;
- CC1000RadioIntM$SpiByteFifo$rxMode();
- CC1000RadioIntM$CC1000Control$RxMode();
- CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_DONE;
- }
- }
- break;
- case CC1000RadioIntM$TXSTATE_WAIT_FOR_ACK:
- if (CC1000RadioIntM$TxByteCnt == 1) {
- CC1000RadioIntM$send_sum++;
- CC1000RadioIntM$SpiByteFifo$rxMode();
- CC1000RadioIntM$CC1000Control$RxMode();
- break;
- }
- CC1000RadioIntM$receive_sum++;
- if (CC1000RadioIntM$TxByteCnt > 3) {
- CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_READ_ACK;
- CC1000RadioIntM$TxByteCnt = 0;
- CC1000RadioIntM$search_word = 0;
- }
- break;
- case CC1000RadioIntM$TXSTATE_READ_ACK:
- {
- uint8_t i;
- #line 1280
- CC1000RadioIntM$receive_sum++;
- for (i = 0; i < 8; i++) {
- CC1000RadioIntM$search_word <<= 1;
- if (data_in & 0x80) {
- #line 1283
- CC1000RadioIntM$search_word |= 0x1;
- }
- #line 1284
- data_in <<= 1;
- if (CC1000RadioIntM$search_word == 0xba83) {
- CC1000RadioIntM$txbufptr->ack = 1;
- CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_DONE;
- return SUCCESS;
- }
- }
- }
- if (CC1000RadioIntM$TxByteCnt >= CC1000RadioIntM$MAX_ACK_WAIT) {
- CC1000RadioIntM$txbufptr->ack = 0;
- CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_DONE;
- }
- break;
- case CC1000RadioIntM$TXSTATE_DONE:
- default:
- CC1000RadioIntM$bTxPending = FALSE;
- if (CC1000RadioIntM$txbufptr->type == 222 || CC1000RadioIntM$txbufptr->type == 223) {
- CC1000RadioIntM$bAckEnable = CC1000RadioIntM$ackOrig;
- }
- if (TOS_post(CC1000RadioIntM$PacketSent)) {
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- CC1000RadioIntM$pktsLastSync++;
- CC1000RadioIntM$RSSIInitState = CC1000RadioIntM$RadioState;
- CC1000RadioIntM$RSSIADC$getData();
- }
- break;
- }
- }
- break;
- case CC1000RadioIntM$DISABLED_STATE:
- break;
- case CC1000RadioIntM$IDLE_STATE:
- {
- CC1000RadioIntM$receive_sum++;
- if (data_in == 0xaa || data_in == 0x55) {
- CC1000RadioIntM$PreambleCount++;
- if (CC1000RadioIntM$PreambleCount > 2) {
- CC1000RadioIntM$PreambleCount = CC1000RadioIntM$SOFCount = 0;
- CC1000RadioIntM$RxBitOffset = CC1000RadioIntM$RxByteCnt = 0;
- CC1000RadioIntM$usRunningCRC = 0;
- CC1000RadioIntM$rxlength = MSG_DATA_SIZE - 2;
- CC1000RadioIntM$RadioState = CC1000RadioIntM$SYNC_STATE;
- }
- }
- else
- #line 1350
- {
- if ((CC1000RadioIntM$currentMAC == CC1000RadioIntM$BMAC || CC1000RadioIntM$enableHCL == FALSE) || !CC1000RadioIntM$IsHCL(CC1000RadioIntM$currentSlot)) {
- if (CC1000RadioIntM$bTxPending && --CC1000RadioIntM$sMacDelay <= 0) {
- CC1000RadioIntM$RadioState = CC1000RadioIntM$PRETX_STATE;
- CC1000RadioIntM$RSSIInitState = CC1000RadioIntM$PRETX_STATE;
- CC1000RadioIntM$bRSSIValid = FALSE;
- CC1000RadioIntM$iRSSIcount = 0;
- CC1000RadioIntM$PreambleCount = 0;
- CC1000RadioIntM$RSSIADC$getData();
- }
- }
- else
- #line 1360
- {
- }
- }
- }
- break;
- case CC1000RadioIntM$PRETX_STATE:
- {
- CC1000RadioIntM$receive_sum++;
- if (data_in == 0xaa || data_in == 0x55) {
- CC1000RadioIntM$sMacDelay = CC1000RadioIntM$MacBackoff$congestionBackoff(CC1000RadioIntM$txbufptr);
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- }
- }
- break;
- case CC1000RadioIntM$SYNC_STATE:
- {
- uint8_t i;
- CC1000RadioIntM$receive_sum++;
- if (data_in == 0xaa || data_in == 0x55) {
- CC1000RadioIntM$RxShiftBuf.MSB = data_in;
- }
- else {
- uint16_t usTmp;
- #line 1405
- switch (CC1000RadioIntM$SOFCount) {
- case 0:
- CC1000RadioIntM$RxShiftBuf.LSB = data_in;
- break;
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- usTmp = CC1000RadioIntM$RxShiftBuf.W;
- CC1000RadioIntM$RxShiftBuf.W <<= 8;
- CC1000RadioIntM$RxShiftBuf.LSB = data_in;
- for (i = 0; i < 8; i++) {
- usTmp <<= 1;
- if (data_in & 0x80) {
- usTmp |= 0x1;
- }
- #line 1424
- data_in <<= 1;
- if (usTmp == CC1000RadioIntM$SYNC_WORD) {
- if (CC1000RadioIntM$rxbufptr->length != 0) {
- CC1000RadioIntM$Leds$redToggle();
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- }
- else {
- CC1000RadioIntM$RadioState = CC1000RadioIntM$RX_STATE;
- CC1000RadioIntM$RSSIInitState = CC1000RadioIntM$RX_STATE;
- CC1000RadioIntM$RSSIADC$getData();
- CC1000RadioIntM$RxBitOffset = 7 - i;
- CC1000RadioIntM$RadioReceiveCoordinator$startSymbol(8, CC1000RadioIntM$RxBitOffset, CC1000RadioIntM$rxbufptr);
- }
- break;
- }
- }
- break;
- default:
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- break;
- }
- CC1000RadioIntM$SOFCount++;
- }
- }
- break;
- case CC1000RadioIntM$RX_STATE:
- {
- char Byte;
- #line 1462
- CC1000RadioIntM$receive_sum++;
- CC1000RadioIntM$RxShiftBuf.W <<= 8;
- CC1000RadioIntM$RxShiftBuf.LSB = data_in;
- Byte = CC1000RadioIntM$RxShiftBuf.W >> CC1000RadioIntM$RxBitOffset;
- ((char *)CC1000RadioIntM$rxbufptr)[(int )CC1000RadioIntM$RxByteCnt] = Byte;
- CC1000RadioIntM$RxByteCnt++;
- CC1000RadioIntM$RadioReceiveCoordinator$byte(CC1000RadioIntM$rxbufptr, (uint8_t )CC1000RadioIntM$RxByteCnt);
- if (CC1000RadioIntM$RxByteCnt < CC1000RadioIntM$rxlength) {
- CC1000RadioIntM$usRunningCRC = crcByte(CC1000RadioIntM$usRunningCRC, Byte);
- if (CC1000RadioIntM$RxByteCnt == (size_t )& ((struct TOS_Msg *)0)->length +
- sizeof ((struct TOS_Msg *)0)->length) {
- CC1000RadioIntM$rxlength = CC1000RadioIntM$rxbufptr->length;
- if (CC1000RadioIntM$rxlength > 70) {
- CC1000RadioIntM$rxbufptr->length = 0;
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- return SUCCESS;
- }
- CC1000RadioIntM$rxlength += (size_t )& ((struct TOS_Msg *)0)->data;
- }
- }
- else {
- #line 1489
- if (CC1000RadioIntM$RxByteCnt == CC1000RadioIntM$rxlength) {
- if (CC1000RadioIntM$rxbufptr->type == 223) {
- CC1000RadioIntM$getTimeDiff();
- }
- #line 1492
- CC1000RadioIntM$usRunningCRC = crcByte(CC1000RadioIntM$usRunningCRC, Byte);
- CC1000RadioIntM$RxByteCnt = (size_t )& ((struct TOS_Msg *)0)->crc;
- }
- else {
- #line 1496
- if (CC1000RadioIntM$RxByteCnt >= MSG_DATA_SIZE) {
- if (CC1000RadioIntM$rxbufptr->crc == CC1000RadioIntM$usRunningCRC) {
- if (CC1000RadioIntM$rxbufptr->type == 223) {
- TOS_post(CC1000RadioIntM$adjustTime);
- }
- #line 1503
- CC1000RadioIntM$rxbufptr->crc = 1;
- if (CC1000RadioIntM$bAckEnable && CC1000RadioIntM$rxbufptr->addr == TOS_LOCAL_ADDRESS) {
- CC1000RadioIntM$RadioState = CC1000RadioIntM$SENDING_ACK;
- CC1000RadioIntM$CC1000Control$TxMode();
- CC1000RadioIntM$SpiByteFifo$txMode();
- CC1000RadioIntM$SpiByteFifo$writeByte(0xaa);
- CC1000RadioIntM$RxByteCnt = 0;
- return SUCCESS;
- }
- }
- else {
- CC1000RadioIntM$rxbufptr->crc = 0;
- }
- CC1000RadioIntM$SpiByteFifo$disableIntr();
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- if (CC1000RadioIntM$currentMAC == CC1000RadioIntM$ZMAC && CC1000RadioIntM$bTxPending) {
- CC1000RadioIntM$sMacDelay = CC1000RadioIntM$getZMACBackoff(CC1000RadioIntM$sMacDelay);
- }
- CC1000RadioIntM$rxbufptr->strength = CC1000RadioIntM$usRSSIVal;
- if (!TOS_post(CC1000RadioIntM$PacketRcvd)) {
- CC1000RadioIntM$rxbufptr->length = 0;
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- CC1000RadioIntM$SpiByteFifo$enableIntr();
- }
- CC1000RadioIntM$RSSIInitState = CC1000RadioIntM$RadioState;
- CC1000RadioIntM$RSSIADC$getData();
- }
- }
- }
- }
- #line 1541
- break;
- case CC1000RadioIntM$SENDING_ACK:
- {
- CC1000RadioIntM$send_sum++;
- CC1000RadioIntM$RxByteCnt++;
- if (CC1000RadioIntM$RxByteCnt >= CC1000RadioIntM$ACK_LENGTH) {
- CC1000RadioIntM$CC1000Control$RxMode();
- CC1000RadioIntM$SpiByteFifo$rxMode();
- CC1000RadioIntM$SpiByteFifo$disableIntr();
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- CC1000RadioIntM$rxbufptr->strength = CC1000RadioIntM$usRSSIVal;
- if (!TOS_post(CC1000RadioIntM$PacketRcvd)) {
- CC1000RadioIntM$rxbufptr->length = 0;
- CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE;
- CC1000RadioIntM$SpiByteFifo$enableIntr();
- }
- }
- else {
- #line 1558
- if (CC1000RadioIntM$RxByteCnt >= CC1000RadioIntM$ACK_LENGTH - sizeof CC1000RadioIntM$ack_code) {
- CC1000RadioIntM$SpiByteFifo$writeByte(CC1000RadioIntM$ack_code[CC1000RadioIntM$RxByteCnt + sizeof CC1000RadioIntM$ack_code - CC1000RadioIntM$ACK_LENGTH]);
- }
- }
- }
- #line 1562
- break;
- default:
- break;
- }
- if (CC1000RadioIntM$pulse_check_sum > CC1000RadioIntM$CHECK_MA_COUNT) {
- CC1000RadioIntM$power_sum++;
- CC1000RadioIntM$sp_sum++;
- CC1000RadioIntM$pulse_check_sum -= CC1000RadioIntM$CHECK_MA_COUNT;
- }
- if (CC1000RadioIntM$send_sum > CC1000RadioIntM$SEND_MA_COUNT) {
- CC1000RadioIntM$power_sum++;
- CC1000RadioIntM$tx_sum++;
- CC1000RadioIntM$send_sum -= CC1000RadioIntM$SEND_MA_COUNT;
- }
- if (CC1000RadioIntM$receive_sum > CC1000RadioIntM$RECEIVE_MA_COUNT) {
- CC1000RadioIntM$power_sum++;
- CC1000RadioIntM$rx_sum++;
- CC1000RadioIntM$receive_sum -= CC1000RadioIntM$RECEIVE_MA_COUNT;
- }
- return SUCCESS;
- }
- static
- #line 275
- void CC1000RadioIntM$SubTime(GTime *C, GTime *A, GTime *B)
- #line 275
- {
- if (B->sticks > A->sticks) {
- C->sticks = CC1000RadioIntM$MAX_VAL - (B->sticks - A->sticks);
- C->mticks = A->mticks - (B->mticks + 1);
- }
- else {
- C->sticks = A->sticks - B->sticks;
- C->mticks = A->mticks - B->mticks;
- }
- }
- static
- #line 432
- void CC1000RadioIntM$PacketRcvd(void)
- #line 432
- {
- TOS_MsgPtr pBuf;
- ecnForwardMsgType *recvEcnMsgPtr;
- ecnForwardMsgType *ecnForwardMsgPtr;
- #line 436
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 436
- {
- if (CC1000RadioIntM$pktsLastSync > 100) {
- {
- CC1000RadioIntM$ackOrig = CC1000RadioIntM$bAckEnable;
- CC1000RadioIntM$bAckEnable = FALSE;
- }
- CC1000RadioIntM$Send$send(&CC1000RadioIntM$syncMsgHdr);
- CC1000RadioIntM$pktsLastSync = 0;
- }
- CC1000RadioIntM$pktsLastSync++;
- CC1000RadioIntM$rxbufptr->time = 0;
- pBuf = CC1000RadioIntM$rxbufptr;
- recvEcnMsgPtr = (ecnForwardMsgType *)CC1000RadioIntM$rxbufptr->data;
- ecnForwardMsgPtr = (ecnForwardMsgType *)CC1000RadioIntM$ecnForwardMsgHdr.data;
- if (CC1000RadioIntM$currentMAC == CC1000RadioIntM$ZMAC && CC1000RadioIntM$HCLselect && pBuf->type == 222 && pBuf->crc != 0 &&
- recvEcnMsgPtr->senderAddress != TOS_LOCAL_ADDRESS) {
- if (recvEcnMsgPtr->hopCount == 0 && recvEcnMsgPtr->nextHop == TOS_LOCAL_ADDRESS) {
- ecnForwardMsgPtr->hopCount = 1;
- ecnForwardMsgPtr->nextHop = CC1000RadioIntM$nextHop;
- ecnForwardMsgPtr->senderAddress = TOS_LOCAL_ADDRESS;
- if (!CC1000RadioIntM$bTxBusy) {
- CC1000RadioIntM$ackOrig = CC1000RadioIntM$bAckEnable;
- CC1000RadioIntM$bAckEnable = FALSE;
- CC1000RadioIntM$Send$send(&CC1000RadioIntM$ecnForwardMsgHdr);
- }
- else {
- CC1000RadioIntM$ecnforward = TRUE;
- }
- }
- else {
- #line 477
- if (recvEcnMsgPtr->hopCount == 1) {
- CC1000RadioIntM$enableHCL = TRUE;
- if (recvEcnMsgPtr->senderAddress == CC1000RadioIntM$nextHop) {
- CC1000RadioIntM$ecnPending = FALSE;
- CC1000RadioIntM$slots_since_ecnsend = 0;
- CC1000RadioIntM$slots_since_ecnrecv = 0;
- }
- }
- }
- }
- else {
- #line 492
- if (pBuf->type != 223 && pBuf->type != 222) {
- pBuf = CC1000RadioIntM$Receive$receive((TOS_MsgPtr )pBuf);
- }
- }
- if (pBuf) {
- CC1000RadioIntM$rxbufptr = pBuf;
- }
- #line 501
- CC1000RadioIntM$rxbufptr->length = 0;
- }
- #line 502
- __nesc_atomic_end(__nesc_atomic); }
- CC1000RadioIntM$SpiByteFifo$enableIntr();
- }
- # 124 "../../tos/platform/mica2/HPLSClock.nc"
- void __attribute((interrupt)) __vector_26(void)
- #line 124
- {
- if (HPLSClock$needupdate) {
- if (HPLSClock$sign == NEGATIVE) {
- * (volatile uint16_t *)0x88 = MAX_VAL - HPLSClock$Update.sticks;
- HPLSClock$MTicks = HPLSClock$MTicks - HPLSClock$Update.mticks;
- }
- else {
- #line 130
- if (HPLSClock$sign == POSITIVE) {
- * (volatile uint16_t *)0x88 = HPLSClock$Update.sticks;
- HPLSClock$MTicks = HPLSClock$MTicks + HPLSClock$Update.mticks + 1;
- HPLSClock$SClock$fire(HPLSClock$MTicks);
- }
- }
- #line 135
- HPLSClock$needupdate = 0;
- HPLSClock$SClock$syncDone();
- }
- else {
- HPLSClock$MTicks++;
- HPLSClock$SClock$fire(HPLSClock$MTicks);
- }
- }
- static
- # 348 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
- result_t FramerM$ByteComm$rxByteReady(uint8_t data, bool error, uint16_t strength)
- #line 348
- {
- switch (FramerM$gRxState) {
- case FramerM$RXSTATE_NOSYNC:
- if (data == FramerM$HDLC_FLAG_BYTE && FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Length == 0) {
- FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Token = 0;
- FramerM$gRxByteCnt = FramerM$gRxRunningCRC = 0;
- FramerM$gpRxBuf = (uint8_t *)FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].pMsg;
- FramerM$gRxState = FramerM$RXSTATE_PROTO;
- }
- break;
- case FramerM$RXSTATE_PROTO:
- if (data == FramerM$HDLC_FLAG_BYTE) {
- break;
- }
- FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Proto = data;
- FramerM$gRxRunningCRC = crcByte(FramerM$gRxRunningCRC, data);
- switch (data) {
- case FramerM$PROTO_PACKET_ACK:
- FramerM$gRxState = FramerM$RXSTATE_TOKEN;
- break;
- case FramerM$PROTO_PACKET_NOACK:
- FramerM$gRxState = FramerM$RXSTATE_INFO;
- break;
- default:
- FramerM$gRxState = FramerM$RXSTATE_NOSYNC;
- break;
- }
- break;
- case FramerM$RXSTATE_TOKEN:
- if (data == FramerM$HDLC_FLAG_BYTE) {
- FramerM$gRxState = FramerM$RXSTATE_NOSYNC;
- }
- else {
- #line 384
- if (data == FramerM$HDLC_CTLESC_BYTE) {
- FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Token = 0x20;
- }
- else {
- FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Token ^= data;
- FramerM$gRxRunningCRC = crcByte(FramerM$gRxRunningCRC, FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Token);
- FramerM$gRxState = FramerM$RXSTATE_INFO;
- }
- }
- #line 392
- break;
- case FramerM$RXSTATE_INFO:
- if (FramerM$gRxByteCnt > FramerM$HDLC_MTU) {
- FramerM$gRxByteCnt = FramerM$gRxRunningCRC = 0;
- FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Length = 0;
- FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Token = 0;
- FramerM$gRxState = FramerM$RXSTATE_NOSYNC;
- }
- else {
- #line 402
- if (data == FramerM$HDLC_CTLESC_BYTE) {
- FramerM$gRxState = FramerM$RXSTATE_ESC;
- }
- else {
- #line 405
- if (data == FramerM$HDLC_FLAG_BYTE) {
- if (FramerM$gRxByteCnt >= 2) {
- uint16_t usRcvdCRC = FramerM$gpRxBuf[FramerM$gRxByteCnt - 1] & 0xff;
- #line 408
- usRcvdCRC = (usRcvdCRC << 8) | (FramerM$gpRxBuf[FramerM$gRxByteCnt - 2] & 0xff);
- if (usRcvdCRC == FramerM$gRxRunningCRC) {
- FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Length = FramerM$gRxByteCnt - 2;
- TOS_post(FramerM$PacketRcvd);
- FramerM$gRxHeadIndex++;
- #line 412
- FramerM$gRxHeadIndex %= FramerM$HDLC_QUEUESIZE;
- }
- else {
- FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Length = 0;
- FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Token = 0;
- }
- if (FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Length == 0) {
- FramerM$gpRxBuf = (uint8_t *)FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].pMsg;
- FramerM$gRxState = FramerM$RXSTATE_PROTO;
- }
- else {
- FramerM$gRxState = FramerM$RXSTATE_NOSYNC;
- }
- }
- else {
- FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Length = 0;
- FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Token = 0;
- FramerM$gRxState = FramerM$RXSTATE_NOSYNC;
- }
- FramerM$gRxByteCnt = FramerM$gRxRunningCRC = 0;
- }
- else {
- FramerM$gpRxBuf[FramerM$gRxByteCnt] = data;
- if (FramerM$gRxByteCnt >= 2) {
- FramerM$gRxRunningCRC = crcByte(FramerM$gRxRunningCRC, FramerM$gpRxBuf[FramerM$gRxByteCnt - 2]);
- }
- FramerM$gRxByteCnt++;
- }
- }
- }
- #line 440
- break;
- case FramerM$RXSTATE_ESC:
- if (data == FramerM$HDLC_FLAG_BYTE) {
- FramerM$gRxByteCnt = FramerM$gRxRunningCRC = 0;
- FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Length = 0;
- FramerM$gMsgRcvTbl[FramerM$gRxHeadIndex].Token = 0;
- FramerM$gRxState = FramerM$RXSTATE_NOSYNC;
- }
- else {
- data = data ^ 0x20;
- FramerM$gpRxBuf[FramerM$gRxByteCnt] = data;
- if (FramerM$gRxByteCnt >= 2) {
- FramerM$gRxRunningCRC = crcByte(FramerM$gRxRunningCRC, FramerM$gpRxBuf[FramerM$gRxByteCnt - 2]);
- }
- FramerM$gRxByteCnt++;
- FramerM$gRxState = FramerM$RXSTATE_INFO;
- }
- break;
- default:
- FramerM$gRxState = FramerM$RXSTATE_NOSYNC;
- break;
- }
- return SUCCESS;
- }
- static
- # 87 "/home/testuser/tinyos-1.x/tos/system/UARTM.nc"
- result_t UARTM$HPLUART$putDone(void)
- #line 87
- {
- bool oldState;
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 90
- {
- {
- }
- #line 91
- ;
- oldState = UARTM$state;
- UARTM$state = FALSE;
- }
- #line 94
- __nesc_atomic_end(__nesc_atomic); }
- if (oldState) {
- UARTM$ByteComm$txDone();
- UARTM$ByteComm$txByteReady(TRUE);
- }
- return SUCCESS;
- }
- static
- # 469 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
- result_t FramerM$TxArbitraryByte(uint8_t inByte)
- #line 469
- {
- if (inByte == FramerM$HDLC_FLAG_BYTE || inByte == FramerM$HDLC_CTLESC_BYTE) {
- { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
- #line 471
- {
- FramerM$gPrevTxState = FramerM$gTxState;
- FramerM$gTxState = FramerM$TXSTATE_ESC;
- FramerM$gTxEscByte = inByte;
- }
- #line 475
- __nesc_atomic_end(__nesc_atomic); }
- inByte = FramerM$HDLC_CTLESC_BYTE;
- }
- return FramerM$ByteComm$txByte(inByte);
- }