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

📄 app.c

📁 tinyos最新版
💻 C
📖 第 1 页 / 共 4 页
字号:
static inline # 120 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/tos.h"result_t rcombine(result_t r1, result_t r2){  return r1 == FAIL ? FAIL : r2;}static inline   # 149 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/HPLClock.nc"result_t HPLClock$Clock$setRate(char interval, char scale)#line 149{  scale &= 0x7;  scale |= 0x8;  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 152    {      * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) &= ~(1 << 0);      * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) &= ~(1 << 1);      * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x30 + 0x20) |= 1 << 3;      * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x33 + 0x20) = scale;      * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x32 + 0x20) = 0;      * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20) = interval;      * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) |= 1 << 1;    }#line 162    __nesc_atomic_end(__nesc_atomic); }  return SUCCESS;}# 96 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.nc"inline static   result_t TimerM$Clock$setRate(char arg_0xa32a3d0, char arg_0xa32a510){#line 96  unsigned char result;#line 96#line 96  result = HPLClock$Clock$setRate(arg_0xa32a3d0, arg_0xa32a510);#line 96#line 96  return result;#line 96}#line 96static inline  # 77 "C:/PROGRA~1/UCB/cygwin/opt/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 inline  # 56 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/lib/Counters/Counter.nc"result_t Counter$StdControl$init(void){  Counter$state = 1;  return SUCCESS;}# 59 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/hardware.h"static __inline void TOSH_SET_GREEN_LED_PIN(void)#line 59{#line 59  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 1;}static inline   # 110 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/LedsC.nc"result_t LedsC$Leds$greenOff(void)#line 110{  {  }#line 111  ;  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 112    {      TOSH_SET_GREEN_LED_PIN();      LedsC$ledsOn &= ~LedsC$GREEN_BIT;    }#line 115    __nesc_atomic_end(__nesc_atomic); }  return SUCCESS;}# 97 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc"inline static   result_t IntToLedsM$Leds$greenOff(void){#line 97  unsigned char result;#line 97#line 97  result = LedsC$Leds$greenOff();#line 97#line 97  return result;#line 97}#line 97# 58 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/hardware.h"static __inline void TOSH_SET_YELLOW_LED_PIN(void)#line 58{#line 58  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 0;}static inline   # 139 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/LedsC.nc"result_t LedsC$Leds$yellowOff(void)#line 139{  {  }#line 140  ;  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 141    {      TOSH_SET_YELLOW_LED_PIN();      LedsC$ledsOn &= ~LedsC$YELLOW_BIT;    }#line 144    __nesc_atomic_end(__nesc_atomic); }  return SUCCESS;}# 122 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc"inline static   result_t IntToLedsM$Leds$yellowOff(void){#line 122  unsigned char result;#line 122#line 122  result = LedsC$Leds$yellowOff();#line 122#line 122  return result;#line 122}#line 122# 57 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/hardware.h"static __inline void TOSH_SET_RED_LED_PIN(void)#line 57{#line 57  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 2;}static inline   # 81 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/LedsC.nc"result_t LedsC$Leds$redOff(void)#line 81{  {  }#line 82  ;  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 83    {      TOSH_SET_RED_LED_PIN();      LedsC$ledsOn &= ~LedsC$RED_BIT;    }#line 86    __nesc_atomic_end(__nesc_atomic); }  return SUCCESS;}# 72 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc"inline static   result_t IntToLedsM$Leds$redOff(void){#line 72  unsigned char result;#line 72#line 72  result = LedsC$Leds$redOff();#line 72#line 72  return result;#line 72}#line 72# 59 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/hardware.h"static __inline void TOSH_MAKE_GREEN_LED_OUTPUT(void)#line 59{#line 59  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 1;}#line 58static __inline void TOSH_MAKE_YELLOW_LED_OUTPUT(void)#line 58{#line 58  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 0;}#line 57static __inline void TOSH_MAKE_RED_LED_OUTPUT(void)#line 57{#line 57  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 2;}static inline   # 58 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/LedsC.nc"result_t LedsC$Leds$init(void)#line 58{  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 59    {      LedsC$ledsOn = 0;      {      }#line 61      ;      TOSH_MAKE_RED_LED_OUTPUT();      TOSH_MAKE_YELLOW_LED_OUTPUT();      TOSH_MAKE_GREEN_LED_OUTPUT();      TOSH_SET_RED_LED_PIN();      TOSH_SET_YELLOW_LED_PIN();      TOSH_SET_GREEN_LED_PIN();    }#line 68    __nesc_atomic_end(__nesc_atomic); }  return SUCCESS;}# 56 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc"inline static   result_t IntToLedsM$Leds$init(void){#line 56  unsigned char result;#line 56#line 56  result = LedsC$Leds$init();#line 56#line 56  return result;#line 56}#line 56static inline  # 53 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/lib/Counters/IntToLedsM.nc"result_t IntToLedsM$StdControl$init(void){  IntToLedsM$Leds$init();  IntToLedsM$Leds$redOff();  IntToLedsM$Leds$yellowOff();  IntToLedsM$Leds$greenOff();  return SUCCESS;}# 63 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"inline static  result_t RealMain$StdControl$init(void){#line 63  unsigned char result;#line 63#line 63  result = IntToLedsM$StdControl$init();#line 63  result = rcombine(result, Counter$StdControl$init());#line 63  result = rcombine(result, TimerM$StdControl$init());#line 63#line 63  return result;#line 63}#line 63static inline  # 87 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/TimerM.nc"result_t TimerM$StdControl$start(void)#line 87{  return SUCCESS;}# 41 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/PowerManagement.nc"inline static   uint8_t TimerM$PowerManagement$adjustPower(void){#line 41  unsigned char result;#line 41#line 41  result = HPLPowerManagementM$PowerManagement$adjustPower();#line 41#line 41  return result;#line 41}#line 41static inline   # 87 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/HPLClock.nc"void HPLClock$Clock$setInterval(uint8_t value)#line 87{  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20) = value;}# 105 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.nc"inline static   void TimerM$Clock$setInterval(uint8_t arg_0xa32aed0){#line 105  HPLClock$Clock$setInterval(arg_0xa32aed0);#line 105}#line 105static inline   # 134 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/HPLClock.nc"uint8_t HPLClock$Clock$readCounter(void)#line 134{  return * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x32 + 0x20);}# 153 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.nc"inline static   uint8_t TimerM$Clock$readCounter(void){#line 153  unsigned char result;#line 153#line 153  result = HPLClock$Clock$readCounter();#line 153#line 153  return result;#line 153}#line 153static inline  # 98 "C:/PROGRA~1/UCB/cygwin/opt/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;}# 59 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Timer.nc"inline static  result_t Counter$Timer$start(char arg_0xa2d23f0, uint32_t arg_0xa2d2548){#line 59  unsigned char result;#line 59#line 59  result = TimerM$Timer$start(0, arg_0xa2d23f0, arg_0xa2d2548);#line 59#line 59  return result;#line 59}#line 59static inline  # 62 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/lib/Counters/Counter.nc"result_t Counter$StdControl$start(void){  return Counter$Timer$start(TIMER_REPEAT, 250);}static inline  # 62 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/lib/Counters/IntToLedsM.nc"result_t IntToLedsM$StdControl$start(void)#line 62{  return SUCCESS;}# 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 = IntToLedsM$StdControl$start();#line 70  result = rcombine(result, Counter$StdControl$start());#line 70  result = rcombine(result, TimerM$StdControl$start());#line 70#line 70  return result;#line 70}#line 70static 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 # 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;    }

⌨️ 快捷键说明

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