📄 app.c
字号:
static inline uint8_t HPLPowerManagementM$getPowerLevel(void);static inline #line 84void HPLPowerManagementM$doAdjustment(void);static #line 101uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void);# 50 "C:/UCB/cygwin/opt/tinyos-1.x/tos/system/LedsC.nc"uint8_t LedsC$ledsOn;enum LedsC$__nesc_unnamed4264 { LedsC$RED_BIT = 1, LedsC$GREEN_BIT = 2, LedsC$YELLOW_BIT = 4};static inline result_t LedsC$Leds$init(void);static inline #line 72result_t LedsC$Leds$redOn(void);static inline result_t LedsC$Leds$redOff(void);static inline result_t LedsC$Leds$redToggle(void);# 117 "C:/UCB/cygwin/opt/tinyos-1.x/tos/platform/micaz/hardware.h"static __inline void TOSH_SET_GREEN_LED_PIN(void)#line 117{#line 117 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 1;}#line 118static __inline void TOSH_SET_YELLOW_LED_PIN(void)#line 118{#line 118 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 0;}#line 116static __inline void TOSH_SET_RED_LED_PIN(void)#line 116{#line 116 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 2;}#line 155static __inline void TOSH_SET_FLASH_SELECT_PIN(void)#line 155{#line 155 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 3;}#line 156static __inline void TOSH_MAKE_FLASH_CLK_OUTPUT(void)#line 156{#line 156 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 5;}#line 157static __inline void TOSH_MAKE_FLASH_OUT_OUTPUT(void)#line 157{#line 157 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 3;}#line 155static __inline void TOSH_MAKE_FLASH_SELECT_OUTPUT(void)#line 155{#line 155 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 3;}#line 120static __inline void TOSH_CLR_SERIAL_ID_PIN(void)#line 120{#line 120 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 4);}#line 120static __inline void TOSH_MAKE_SERIAL_ID_INPUT(void)#line 120{#line 120 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) &= ~(1 << 4);}#line 152static __inline void TOSH_MAKE_RADIO_CCA_INPUT(void)#line 152{#line 152 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) &= ~(1 << 6);}#line 150static __inline void TOSH_MAKE_CC_FIFO_INPUT(void)#line 150{#line 150 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 7);}#line 148static __inline void TOSH_MAKE_CC_SFD_INPUT(void)#line 148{#line 148 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) &= ~(1 << 4);}#line 147static __inline void TOSH_MAKE_CC_CCA_INPUT(void)#line 147{#line 147 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) &= ~(1 << 6);}#line 145static __inline void TOSH_MAKE_CC_FIFOP1_INPUT(void)#line 145{#line 145 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x02 + 0x20) &= ~(1 << 6);}static __inline void TOSH_MAKE_CC_CS_INPUT(void)#line 149{#line 149 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 0);}#line 142static __inline void TOSH_MAKE_CC_VREN_OUTPUT(void)#line 142{#line 142 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 5;}#line 141static __inline void TOSH_MAKE_CC_RSTN_OUTPUT(void)#line 141{#line 141 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 6;}#line 170static __inline void TOSH_MAKE_SPI_SCK_OUTPUT(void)#line 170{#line 170 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) |= 1 << 1;}#line 167static __inline void TOSH_MAKE_MOSI_OUTPUT(void)#line 167{#line 167 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) |= 1 << 2;}#line 168static __inline void TOSH_MAKE_MISO_INPUT(void)#line 168{#line 168 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 3);}static __inline void TOSH_MAKE_PW0_OUTPUT(void)#line 173{#line 173 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 0;}#line 174static __inline void TOSH_MAKE_PW1_OUTPUT(void)#line 174{#line 174 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 1;}#line 175static __inline void TOSH_MAKE_PW2_OUTPUT(void)#line 175{#line 175 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 2;}#line 176static __inline void TOSH_MAKE_PW3_OUTPUT(void)#line 176{#line 176 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 3;}#line 177static __inline void TOSH_MAKE_PW4_OUTPUT(void)#line 177{#line 177 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 4;}#line 178static __inline void TOSH_MAKE_PW5_OUTPUT(void)#line 178{#line 178 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 5;}#line 179static __inline void TOSH_MAKE_PW6_OUTPUT(void)#line 179{#line 179 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 6;}#line 180static __inline void TOSH_MAKE_PW7_OUTPUT(void)#line 180{#line 180 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 7;}#line 117static __inline void TOSH_MAKE_GREEN_LED_OUTPUT(void)#line 117{#line 117 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 1;}#line 118static __inline void TOSH_MAKE_YELLOW_LED_OUTPUT(void)#line 118{#line 118 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 0;}#line 116static __inline void TOSH_MAKE_RED_LED_OUTPUT(void)#line 116{#line 116 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 2;}static inline #line 196void TOSH_SET_PIN_DIRECTIONS(void ){ TOSH_MAKE_RED_LED_OUTPUT(); TOSH_MAKE_YELLOW_LED_OUTPUT(); TOSH_MAKE_GREEN_LED_OUTPUT(); TOSH_MAKE_PW7_OUTPUT(); TOSH_MAKE_PW6_OUTPUT(); TOSH_MAKE_PW5_OUTPUT(); TOSH_MAKE_PW4_OUTPUT(); TOSH_MAKE_PW3_OUTPUT(); TOSH_MAKE_PW2_OUTPUT(); TOSH_MAKE_PW1_OUTPUT(); TOSH_MAKE_PW0_OUTPUT(); TOSH_MAKE_MISO_INPUT(); TOSH_MAKE_MOSI_OUTPUT(); TOSH_MAKE_SPI_SCK_OUTPUT(); TOSH_MAKE_CC_RSTN_OUTPUT(); TOSH_MAKE_CC_VREN_OUTPUT(); TOSH_MAKE_CC_CS_INPUT(); TOSH_MAKE_CC_FIFOP1_INPUT(); TOSH_MAKE_CC_CCA_INPUT(); TOSH_MAKE_CC_SFD_INPUT(); TOSH_MAKE_CC_FIFO_INPUT(); TOSH_MAKE_RADIO_CCA_INPUT(); TOSH_MAKE_SERIAL_ID_INPUT(); TOSH_CLR_SERIAL_ID_PIN(); TOSH_MAKE_FLASH_SELECT_OUTPUT(); TOSH_MAKE_FLASH_OUT_OUTPUT(); TOSH_MAKE_FLASH_CLK_OUTPUT(); TOSH_SET_FLASH_SELECT_PIN(); TOSH_SET_RED_LED_PIN(); TOSH_SET_YELLOW_LED_PIN(); TOSH_SET_GREEN_LED_PIN();}static inline # 57 "C:/UCB/cygwin/opt/tinyos-1.x/tos/platform/avrmote/HPLInit.nc"result_t HPLInit$init(void)#line 57{ TOSH_SET_PIN_DIRECTIONS(); return SUCCESS;}# 47 "C:/UCB/cygwin/opt/tinyos-1.x/tos/system/RealMain.nc"inline static result_t RealMain$hardwareInit(void){#line 47 unsigned char result;#line 47#line 47 result = HPLInit$init();#line 47#line 47 return result;#line 47}#line 47static inline # 75 "C:/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLPotC.nc"result_t HPLPotC$Pot$finalise(void)#line 75{ return SUCCESS;}# 74 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/HPLPot.nc"inline static result_t PotM$HPLPot$finalise(void){#line 74 unsigned char result;#line 74#line 74 result = HPLPotC$Pot$finalise();#line 74#line 74 return result;#line 74}#line 74static inline # 66 "C:/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLPotC.nc"result_t HPLPotC$Pot$increase(void)#line 66{ return SUCCESS;}# 67 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/HPLPot.nc"inline static result_t PotM$HPLPot$increase(void){#line 67 unsigned char result;#line 67#line 67 result = HPLPotC$Pot$increase();#line 67#line 67 return result;#line 67}#line 67static inline # 57 "C:/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLPotC.nc"result_t HPLPotC$Pot$decrease(void)#line 57{ return SUCCESS;}# 59 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/HPLPot.nc"inline static result_t PotM$HPLPot$decrease(void){#line 59 unsigned char result;#line 59#line 59 result = HPLPotC$Pot$decrease();#line 59#line 59 return result;#line 59}#line 59static inline # 93 "C:/UCB/cygwin/opt/tinyos-1.x/tos/system/PotM.nc"void PotM$setPot(uint8_t value)#line 93{ uint8_t i;#line 95 for (i = 0; i < 151; i++) PotM$HPLPot$decrease(); for (i = 0; i < value; i++) PotM$HPLPot$increase(); PotM$HPLPot$finalise(); PotM$potSetting = value;}static inline result_t PotM$Pot$init(uint8_t initialSetting)#line 106{ PotM$setPot(initialSetting); return SUCCESS;}# 78 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Pot.nc"inline static result_t RealMain$Pot$init(uint8_t arg_0xa9f690){#line 78 unsigned char result;#line 78#line 78 result = PotM$Pot$init(arg_0xa9f690);#line 78#line 78 return result;#line 78}#line 78static inline # 83 "C:/UCB/cygwin/opt/tinyos-1.x/tos/system/sched.c"void TOSH_sched_init(void ){ int i;#line 86 TOSH_sched_free = 0; TOSH_sched_full = 0; for (i = 0; i < TOSH_MAX_TASKS; i++) TOSH_queue[i].tp = (void *)0;}static inline # 120 "C:/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 # 58 "C:/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:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc"inline static result_t BlinkM$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 # 52 "BlinkM.nc"result_t BlinkM$StdControl$init(void)#line 52{ BlinkM$Leds$init(); return SUCCESS;}static inline # 149 "C:/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:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.nc"inline static result_t TimerM$Clock$setRate(char arg_0xb170d0, char arg_0xb17210){#line 96 unsigned char result;#line 96#line 96 result = HPLClock$Clock$setRate(arg_0xb170d0, arg_0xb17210);#line 96#line 96 return result;#line 96}#line 96static inline # 77 "C:/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);}# 63 "C:/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 = TimerM$StdControl$init();#line 63 result = rcombine(result, BlinkM$StdControl$init());#line 63#line 63 return result;#line 63}#line 63# 41 "C:/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:/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:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.nc"inline static void TimerM$Clock$setInterval(uint8_t arg_0xb17bd0){#line 105 HPLClock$Clock$setInterval(arg_0xb17bd0);#line 105}#line 105static inline # 134 "C:/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:/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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -