⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 app.c

📁 tinyos最新版
💻 C
📖 第 1 页 / 共 5 页
字号:
#line 63  return result;#line 63}#line 63# 34 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/ChannelMon.nc"inline static   result_t MicaHighSpeedRadioM$ChannelMon$startSymbolSearch(void){#line 34  unsigned char result;#line 34#line 34  result = ChannelMonC$ChannelMon$startSymbolSearch();#line 34#line 34  return result;#line 34}#line 34static inline # 62 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/HPLPowerManagementM.nc"uint8_t HPLPowerManagementM$getPowerLevel(void)#line 62{  uint8_t diff;#line 64  if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) & ~((1 << 1) | (1 << 0))) {      return HPLPowerManagementM$IDLE;    }  else {#line 67    if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) & (1 << 7)) {        return HPLPowerManagementM$IDLE;      }    else {#line 69      if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0A + 0x20) & ((1 << 6) | (1 << 7))) {          return HPLPowerManagementM$IDLE;        }      else {        if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) & (1 << 7)) {            return HPLPowerManagementM$ADC_NR;          }        else {#line 75          if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) & ((1 << 1) | (1 << 0))) {              diff = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20) - * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x32 + 0x20);              if (diff < 16) {                return HPLPowerManagementM$IDLE;                }#line 79              return HPLPowerManagementM$POWER_SAVE;            }          else #line 80            {              return HPLPowerManagementM$POWER_DOWN;            }          }        }      }    }}static inline  #line 85void HPLPowerManagementM$doAdjustment(void)#line 85{  uint8_t foo;#line 86  uint8_t mcu;#line 87  foo = HPLPowerManagementM$getPowerLevel();  mcu = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20);  mcu &= 0xe3;  if (foo == HPLPowerManagementM$POWER_SAVE) {      mcu |= HPLPowerManagementM$IDLE;      while ((* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x30 + 0x20) & 0x7) != 0) {           __asm volatile ("nop");}      mcu &= 0xe3;    }  mcu |= foo;  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) = mcu;  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) |= 1 << 5;}static inline   uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void)#line 103{  uint8_t mcu;#line 105  if (!HPLPowerManagementM$disabled) {    TOS_post(HPLPowerManagementM$doAdjustment);    }  else #line 107    {      mcu = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20);      mcu &= 0xe3;      mcu |= HPLPowerManagementM$IDLE;      * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) = mcu;      * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) |= 1 << 5;    }  return 0;}# 41 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/PowerManagement.nc"inline static   uint8_t MicaHighSpeedRadioM$PowerManagement$adjustPower(void){#line 41  unsigned char result;#line 41#line 41  result = HPLPowerManagementM$PowerManagement$adjustPower();#line 41#line 41  return result;#line 41}#line 41static inline  # 154 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/MicaHighSpeedRadioM.nc"result_t MicaHighSpeedRadioM$Control$start(void)#line 154{  uint8_t oldState;  result_t rval = SUCCESS;#line 157  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 157    {      oldState = MicaHighSpeedRadioM$state;      if (MicaHighSpeedRadioM$state == MicaHighSpeedRadioM$STOPPED_STATE) {          MicaHighSpeedRadioM$state = MicaHighSpeedRadioM$IDLE_STATE;          MicaHighSpeedRadioM$send_state = MicaHighSpeedRadioM$IDLE_STATE;          MicaHighSpeedRadioM$PowerManagement$adjustPower();          rval = MicaHighSpeedRadioM$ChannelMon$startSymbolSearch();        }    }#line 165    __nesc_atomic_end(__nesc_atomic); }  return rval;}# 70 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"inline static  result_t TOSBaseM$RadioControl$start(void){#line 70  unsigned char result;#line 70#line 70  result = MicaHighSpeedRadioM$Control$start();#line 70#line 70  return result;#line 70}#line 70# 98 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/hardware.h"static __inline void TOSH_SET_UART_RXD0_PIN(void)#line 98{#line 98  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x03 + 0x20) |= 1 << 0;}static inline   # 56 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/avrmote/HPLUARTM.nc"result_t HPLUARTM$UART$init(void)#line 56{  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x09 + 0x20) = 12;  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0C + 0x20);  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0A + 0x20) = 0xd8;  TOSH_SET_UART_RXD0_PIN();  return SUCCESS;}# 62 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/HPLUART.nc"inline static   result_t UARTM$HPLUART$init(void){#line 62  unsigned char result;#line 62#line 62  result = HPLUARTM$UART$init();#line 62#line 62  return result;#line 62}#line 62static inline  # 68 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/UARTM.nc"result_t UARTM$Control$start(void)#line 68{  return UARTM$HPLUART$init();}# 70 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"inline static  result_t FramerM$ByteControl$start(void){#line 70  unsigned char result;#line 70#line 70  result = UARTM$Control$start();#line 70#line 70  return result;#line 70}#line 70static inline  # 296 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/FramerM.nc"result_t FramerM$StdControl$start(void)#line 296{  FramerM$HDLCInitialize();  return FramerM$ByteControl$start();}# 70 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"inline static  result_t TOSBaseM$UARTControl$start(void){#line 70  unsigned char result;#line 70#line 70  result = FramerM$StdControl$start();#line 70#line 70  return result;#line 70}#line 70static inline  # 114 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/apps/TOSBase/TOSBaseM.nc"result_t TOSBaseM$StdControl$start(void)#line 114{  result_t ok1;#line 115  result_t ok2;  ok1 = TOSBaseM$UARTControl$start();  ok2 = TOSBaseM$RadioControl$start();  return rcombine(ok1, ok2);}# 70 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"inline static  result_t RealMain$StdControl$start(void){#line 70  unsigned char result;#line 70#line 70  result = TOSBaseM$StdControl$start();#line 70#line 70  return result;#line 70}#line 70static # 172 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/avrmote/avrhardware.h"__inline void __nesc_enable_interrupt(void)#line 172{   __asm volatile ("sei");}static inline #line 135void TOSH_wait(void){   __asm volatile ("nop");   __asm volatile ("nop");}static inline void TOSH_sleep(void){  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) |= 1 << 5;   __asm volatile ("sleep");}#line 165__inline void  __nesc_atomic_end(__nesc_atomic_t oldSreg){  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x3F + 0x20) = oldSreg;}#line 158__inline __nesc_atomic_t  __nesc_atomic_start(void ){  __nesc_atomic_t result = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x3F + 0x20);#line 161   __asm volatile ("cli");  return result;}static inline # 140 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/sched.c"bool TOSH_run_next_task(void){  __nesc_atomic_t fInterruptFlags;  uint8_t old_full;  void (*func)(void );  fInterruptFlags = __nesc_atomic_start();  old_full = TOSH_sched_full;  func = TOSH_queue[old_full].tp;  if (func == (void *)0)     {      __nesc_atomic_end(fInterruptFlags);      return 0;    }  TOSH_queue[old_full].tp = (void *)0;  TOSH_sched_full = (old_full + 1) & TOSH_TASK_BITMASK;  __nesc_atomic_end(fInterruptFlags);  func();  return 1;}static inline void TOSH_run_task(void)#line 163{  while (TOSH_run_next_task())     ;  TOSH_sleep();  TOSH_wait();}static inline    # 400 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/MicaHighSpeedRadioM.nc"void MicaHighSpeedRadioM$RadioSendCoordinator$default$startSymbol(uint8_t bitsPerBlock, uint8_t offset, TOS_MsgPtr msgBuff)#line 400{}# 31 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/RadioCoordinator.nc"inline static   void MicaHighSpeedRadioM$RadioSendCoordinator$startSymbol(uint8_t arg_0xa35a400, uint8_t arg_0xa35a548, TOS_MsgPtr arg_0xa35a698){#line 31  MicaHighSpeedRadioM$RadioSendCoordinator$default$startSymbol(arg_0xa35a400, arg_0xa35a548, arg_0xa35a698);#line 31}#line 31static inline # 66 "C:/PROGRA~1/UCB/cygwin/opt/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,%B3\n"  "\tlsl %1\n"  "\tadc %B2, __zero_reg__\n"  "\tadd %A2, %1\n"  "\tadc %B2, __zero_reg__\n"  "\tlpm\n"  "\tmov %B0, %A3\n"  "\tmov %A0, r0\n"  "\tadiw r30,1\n"  "\tlpm\n"  "\teor %B0, r0" :   "=r"(newCrc), "+r"(byte), "+z"(table) : "r"(oldCrc));  return newCrc;}static inline   # 55 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/RadioTimingC.nc"uint16_t RadioTimingC$RadioTiming$currentTime(void)#line 55{  return ({#line 56    uint16_t __t;#line 56    bool bStatus;#line 56    bStatus = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x3F + 0x20) & (1 << 7);#line 56     __asm volatile ("cli");__t = * (volatile unsigned int *)(unsigned int )& * (volatile unsigned char *)(0x2C + 0x20);#line 56    if (bStatus) {#line 56       __asm volatile ("sei");      }#line 56    __t;  }  );}# 34 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/RadioTiming.nc"inline static   uint16_t MicaHighSpeedRadioM$RadioTiming$currentTime(void){#line 34  unsigned int result;#line 34#line 34  result = RadioTimingC$RadioTiming$currentTime();#line 34#line 34  return result;#line 34}#line 34# 33 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/SpiByteFifo.nc"inline static   result_t MicaHighSpeedRadioM$SpiByteFifo$send(uint8_t arg_0xa36c8f0){#line 33  unsigned char result;#line 33#line 33  result = SpiByteFifoC$SpiByteFifo$send(arg_0xa36c8f0);#line 33#line 33  return result;#line 33}#line 33# 34 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/RadioEncoding.nc"inline static   result_t MicaHighSpeedRadioM$Code$encode(char arg_0xa360c88){#line 34  unsigned char result;#line 34#line 34  result = SecDedEncoding$Code$encode(arg_0xa360c88);#line 34#line 34  return result;#line 34}#line 34static inline   # 217 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/MicaHighSpeedRadioM.nc"result_t MicaHighSpeedRadioM$ChannelMon$idleDetect(void)#line 217{  uint8_t firstSSByte;  uint8_t firstMsgByte;  uint16_t timeVal;  uint16_t tmpCrc;  uint8_t oldSendState;  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 224    {      oldSendState = MicaHighSpeedRadioM$send_state;      if (MicaHighSpeedRadioM$send_state == MicaHighSpeedRadioM$SEND_WAITING) {          MicaHighSpeedRadioM$send_state = MicaHighSpeedRadioM$IDLE_STATE;          MicaHighSpeedRadioM$state = MicaHighSpeedRadioM$TRANSMITTING_START;        }    }#line 230    __nesc_atomic_end(__nesc_atomic); }  if (oldSendState == MicaHighSpeedRadioM$SEND_WAITING) {      { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 233        {          firstMsgByte = ((char *)MicaHighSpeedRadioM$send_ptr)[0];          firstSSByte = TOSH_MHSR_start[0];          MicaHighSpeedRadioM$buf_end = MicaHighSpeedRadioM$buf_head = 0;          MicaHighSpeedRadioM$enc_count = 0;          MicaHighSpeedRadioM$Code$encode(firstMsgByte);          MicaHighSpeedRadioM$rx_count = 0;          MicaHighSpeedRadioM$msg_length = (unsigned char )MicaHighSpeedRadioM$send_ptr->length + MSG_DATA_SIZE - DATA_LENGTH - 2;        }#line 242        __nesc_atomic_end(__nesc_atomic); }      MicaHighSpeedRadioM$SpiByteFifo$send(firstSSByte);      timeVal = MicaHighSpeedRadioM$RadioTiming$currentTime();      tmpCrc = crcByte(0x00, firstMsgByte);      { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 248        {          MicaHighSpeedRadioM$send_ptr->time = timeVal;          MicaHighSpeedRadioM$calc_crc = tmpCrc;        }#line 251        __nesc_atomic_end(__nesc_atomic); }    }  MicaHighSpeedRadioM$RadioSendCoordinator$startSymbol(8, 0, MicaHighSpeedRadioM$send_ptr);  return 1;}# 39 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/ChannelMon.nc"inline static   result_t ChannelMonC$ChannelMon$idleDetect(void){#line 39  unsigned char result;#line 39#line 39  result = MicaHighSpeedRadioM$ChannelMon$idleDetect();#line 39#line 39  return result;#line 39}#line 39# 37 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/RadioEncoding.nc"inline static   result_t SecDedEncoding$Code$encodeDone(char arg_0xa361a10){#line 37  unsigned char result;#line 37#line 37  result = MicaHighSpeedRadioM$Code$encodeDone(arg_0xa361a10);#line 37#line 37  return result;#lin

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -