📄 app.c
字号:
#define dbg(mode, format, ...) ((void)0)#define dbg_clear(mode, format, ...) ((void)0)#define dbg_active(mode) 0# 60 "/usr/local/avr/include/inttypes.h"typedef signed char int8_t;typedef unsigned char uint8_t;# 83 "/usr/local/avr/include/inttypes.h" 3typedef int int16_t;typedef unsigned int uint16_t;typedef long int32_t;typedef unsigned long uint32_t;#line 117typedef long long int64_t;typedef unsigned long long uint64_t;#line 134typedef int16_t intptr_t;typedef uint16_t uintptr_t;# 213 "/usr/local/lib/gcc-lib/avr/3.3-tinyos/include/stddef.h" 3typedef unsigned int size_t;#line 325typedef int wchar_t;# 60 "/usr/local/avr/include/stdlib.h"typedef struct __nesc_unnamed4242 { int quot; int rem;} div_t;typedef struct __nesc_unnamed4243 { long quot; long rem;} ldiv_t;typedef int (*__compar_fn_t)(const void *, const void *);# 151 "/usr/local/lib/gcc-lib/avr/3.3-tinyos/include/stddef.h" 3typedef int ptrdiff_t;# 91 "C:/UCB/cygwin/opt/tinyos-1.x/tos/system/tos.h"typedef unsigned char bool;enum __nesc_unnamed4244 { FALSE = 0, TRUE = 1};enum __nesc_unnamed4245 { FAIL = 0, SUCCESS = 1};static inline uint8_t rcombine(uint8_t r1, uint8_t r2);typedef uint8_t result_t;static inline result_t rcombine(result_t r1, result_t r2);#line 140enum __nesc_unnamed4246 { NULL = 0x0};# 81 "/usr/local/avr/include/avr/pgmspace.h"typedef void __attribute((__progmem__)) prog_void;typedef char __attribute((__progmem__)) prog_char;typedef unsigned char __attribute((__progmem__)) prog_uchar;typedef int __attribute((__progmem__)) prog_int;typedef long __attribute((__progmem__)) prog_long;typedef long long __attribute((__progmem__)) prog_long_long;# 124 "C:/UCB/cygwin/opt/tinyos-1.x/tos/platform/avrmote/avrhardware.h"enum __nesc_unnamed4247 { TOSH_period16 = 0x00, TOSH_period32 = 0x01, TOSH_period64 = 0x02, TOSH_period128 = 0x03, TOSH_period256 = 0x04, TOSH_period512 = 0x05, TOSH_period1024 = 0x06, TOSH_period2048 = 0x07};static inline void TOSH_wait(void);static inline void TOSH_sleep(void);typedef uint8_t __nesc_atomic_t;__nesc_atomic_t __nesc_atomic_start(void );void __nesc_atomic_end(__nesc_atomic_t oldSreg);__inline __nesc_atomic_t __nesc_atomic_start(void );__inline void __nesc_atomic_end(__nesc_atomic_t oldSreg);static __inline void __nesc_enable_interrupt(void);# 58 "C:/UCB/cygwin/opt/tinyos-1.x/tos/lib/CC2420Radio/CC2420Const.h"enum __nesc_unnamed4248 { CC2420_TIME_BIT = 4, CC2420_TIME_BYTE = CC2420_TIME_BIT << 3, CC2420_TIME_SYMBOL = 16};enum __nesc_unnamed4249 { CC2420_MIN_CHANNEL = 11, CC2420_MAX_CHANNEL = 26};#line 257enum __nesc_unnamed4250 { CP_MAIN = 0, CP_MDMCTRL0, CP_MDMCTRL1, CP_RSSI, CP_SYNCWORD, CP_TXCTRL, CP_RXCTRL0, CP_RXCTRL1, CP_FSCTRL, CP_SECCTRL0, CP_SECCTRL1, CP_BATTMON, CP_IOCFG0, CP_IOCFG1};# 116 "C:/UCB/cygwin/opt/tinyos-1.x/tos/platform/micaz/hardware.h"static __inline void TOSH_SET_RED_LED_PIN(void);#line 116static __inline void TOSH_CLR_RED_LED_PIN(void);#line 116static __inline void TOSH_MAKE_RED_LED_OUTPUT(void);static __inline void TOSH_SET_GREEN_LED_PIN(void);#line 117static __inline void TOSH_MAKE_GREEN_LED_OUTPUT(void);static __inline void TOSH_SET_YELLOW_LED_PIN(void);#line 118static __inline void TOSH_MAKE_YELLOW_LED_OUTPUT(void);static __inline void TOSH_CLR_SERIAL_ID_PIN(void);#line 120static __inline void TOSH_MAKE_SERIAL_ID_INPUT(void);#line 141static __inline void TOSH_MAKE_CC_RSTN_OUTPUT(void);static __inline void TOSH_MAKE_CC_VREN_OUTPUT(void);static __inline void TOSH_MAKE_CC_FIFOP1_INPUT(void);static __inline void TOSH_MAKE_CC_CCA_INPUT(void);static __inline void TOSH_MAKE_CC_SFD_INPUT(void);static __inline void TOSH_MAKE_CC_CS_INPUT(void);static __inline void TOSH_MAKE_CC_FIFO_INPUT(void);static __inline void TOSH_MAKE_RADIO_CCA_INPUT(void);static __inline void TOSH_SET_FLASH_SELECT_PIN(void);#line 155static __inline void TOSH_MAKE_FLASH_SELECT_OUTPUT(void);static __inline void TOSH_MAKE_FLASH_CLK_OUTPUT(void);static __inline void TOSH_MAKE_FLASH_OUT_OUTPUT(void);static __inline void TOSH_MAKE_MOSI_OUTPUT(void);static __inline void TOSH_MAKE_MISO_INPUT(void);static __inline void TOSH_MAKE_SPI_SCK_OUTPUT(void);static __inline void TOSH_MAKE_PW0_OUTPUT(void);static __inline void TOSH_MAKE_PW1_OUTPUT(void);static __inline void TOSH_MAKE_PW2_OUTPUT(void);static __inline void TOSH_MAKE_PW3_OUTPUT(void);static __inline void TOSH_MAKE_PW4_OUTPUT(void);static __inline void TOSH_MAKE_PW5_OUTPUT(void);static __inline void TOSH_MAKE_PW6_OUTPUT(void);static __inline void TOSH_MAKE_PW7_OUTPUT(void);static inline #line 196void TOSH_SET_PIN_DIRECTIONS(void );#line 249enum __nesc_unnamed4251 { TOSH_ADC_PORTMAPSIZE = 12};enum __nesc_unnamed4252 { TOSH_ACTUAL_VOLTAGE_PORT = 30, TOSH_ACTUAL_BANDGAP_PORT = 30, TOSH_ACTUAL_GND_PORT = 31};enum __nesc_unnamed4253 { TOS_ADC_VOLTAGE_PORT = 7, TOS_ADC_BANDGAP_PORT = 10, TOS_ADC_GND_PORT = 11};# 54 "C:/UCB/cygwin/opt/tinyos-1.x/tos/types/dbg_modes.h"typedef long long TOS_dbg_mode;enum __nesc_unnamed4254 { DBG_ALL = ~0ULL, DBG_BOOT = 1ULL << 0, DBG_CLOCK = 1ULL << 1, DBG_TASK = 1ULL << 2, DBG_SCHED = 1ULL << 3, DBG_SENSOR = 1ULL << 4, DBG_LED = 1ULL << 5, DBG_CRYPTO = 1ULL << 6, DBG_ROUTE = 1ULL << 7, DBG_AM = 1ULL << 8, DBG_CRC = 1ULL << 9, DBG_PACKET = 1ULL << 10, DBG_ENCODE = 1ULL << 11, DBG_RADIO = 1ULL << 12, DBG_LOG = 1ULL << 13, DBG_ADC = 1ULL << 14, DBG_I2C = 1ULL << 15, DBG_UART = 1ULL << 16, DBG_PROG = 1ULL << 17, DBG_SOUNDER = 1ULL << 18, DBG_TIME = 1ULL << 19, DBG_POWER = 1ULL << 20, DBG_SIM = 1ULL << 21, DBG_QUEUE = 1ULL << 22, DBG_SIMRADIO = 1ULL << 23, DBG_HARD = 1ULL << 24, DBG_MEM = 1ULL << 25, DBG_USR1 = 1ULL << 27, DBG_USR2 = 1ULL << 28, DBG_USR3 = 1ULL << 29, DBG_TEMP = 1ULL << 30, DBG_ERROR = 1ULL << 31, DBG_NONE = 0, DBG_DEFAULT = DBG_ALL};# 59 "C:/UCB/cygwin/opt/tinyos-1.x/tos/system/sched.c"typedef struct __nesc_unnamed4255 { void (*tp)(void);} TOSH_sched_entry_T;enum __nesc_unnamed4256 { TOSH_MAX_TASKS = 8, TOSH_TASK_BITMASK = TOSH_MAX_TASKS - 1};volatile TOSH_sched_entry_T TOSH_queue[TOSH_MAX_TASKS];uint8_t TOSH_sched_full;volatile uint8_t TOSH_sched_free;static inline void TOSH_wait(void );static inline void TOSH_sleep(void );static inline void TOSH_sched_init(void );bool TOS_post(void (*tp)(void));#line 106bool TOS_post(void (*tp)(void));static inline #line 140bool TOSH_run_next_task(void);static inline #line 163void TOSH_run_task(void);# 28 "C:/UCB/cygwin/opt/tinyos-1.x/tos/system/Ident.h"enum __nesc_unnamed4257 { IDENT_MAX_PROGRAM_NAME_LENGTH = 17};typedef struct __nesc_unnamed4258 { uint32_t unix_time; uint32_t user_hash; char program_name[IDENT_MAX_PROGRAM_NAME_LENGTH];} Ident_t;# 39 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Timer.h"enum __nesc_unnamed4259 { TIMER_REPEAT = 0, TIMER_ONE_SHOT = 1, NUM_TIMERS = 1};# 33 "C:/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica128/Clock.h"enum __nesc_unnamed4260 { TOS_I1000PS = 32, TOS_S1000PS = 1, TOS_I100PS = 40, TOS_S100PS = 2, TOS_I10PS = 101, TOS_S10PS = 3, TOS_I1024PS = 0, TOS_S1024PS = 3, TOS_I512PS = 1, TOS_S512PS = 3, TOS_I256PS = 3, TOS_S256PS = 3, TOS_I128PS = 7, TOS_S128PS = 3, TOS_I64PS = 15, TOS_S64PS = 3, TOS_I32PS = 31, TOS_S32PS = 3, TOS_I16PS = 63, TOS_S16PS = 3, TOS_I8PS = 127, TOS_S8PS = 3, TOS_I4PS = 255, TOS_S4PS = 3, TOS_I2PS = 15, TOS_S2PS = 7, TOS_I1PS = 31, TOS_S1PS = 7, TOS_I0PS = 0, TOS_S0PS = 0};enum __nesc_unnamed4261 { DEFAULT_SCALE = 3, DEFAULT_INTERVAL = 127};static result_t PotM$Pot$init(uint8_t arg_0xa9f690);static result_t HPLPotC$Pot$finalise(void);static result_t HPLPotC$Pot$decrease(void);static result_t HPLPotC$Pot$increase(void);static result_t HPLInit$init(void);static result_t BlinkM$StdControl$init(void);static result_t BlinkM$StdControl$start(void);static result_t BlinkM$Timer$fired(void);static result_t TimerM$Clock$fire(void);static result_t TimerM$StdControl$init(void);static result_t TimerM$StdControl$start(void);static result_t TimerM$Timer$default$fired(uint8_t arg_0xaf96a8);static result_t TimerM$Timer$start(uint8_t arg_0xaf96a8, char arg_0xaeef40, uint32_t arg_0xaef098);static void HPLClock$Clock$setInterval(uint8_t arg_0xb17bd0);static uint8_t HPLClock$Clock$readCounter(void);static result_t HPLClock$Clock$setRate(char arg_0xb170d0, char arg_0xb17210);static uint8_t HPLClock$Clock$getInterval(void);static uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void);static result_t LedsC$Leds$init(void);static result_t LedsC$Leds$redOff(void);static result_t LedsC$Leds$redToggle(void);static result_t LedsC$Leds$redOn(void);static # 47 "C:/UCB/cygwin/opt/tinyos-1.x/tos/system/RealMain.nc"result_t RealMain$hardwareInit(void);static # 78 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Pot.nc"result_t RealMain$Pot$init(uint8_t arg_0xa9f690);static # 63 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"result_t RealMain$StdControl$init(void);static result_t RealMain$StdControl$start(void);# 54 "C:/UCB/cygwin/opt/tinyos-1.x/tos/system/RealMain.nc"int main(void);static # 74 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/HPLPot.nc"result_t PotM$HPLPot$finalise(void);static #line 59result_t PotM$HPLPot$decrease(void);static result_t PotM$HPLPot$increase(void);# 91 "C:/UCB/cygwin/opt/tinyos-1.x/tos/system/PotM.nc"uint8_t PotM$potSetting;static inline void PotM$setPot(uint8_t value);static inline #line 106result_t PotM$Pot$init(uint8_t initialSetting);static inline # 57 "C:/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLPotC.nc"result_t HPLPotC$Pot$decrease(void);static inline result_t HPLPotC$Pot$increase(void);static inline result_t HPLPotC$Pot$finalise(void);static inline # 57 "C:/UCB/cygwin/opt/tinyos-1.x/tos/platform/avrmote/HPLInit.nc"result_t HPLInit$init(void);static # 56 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc"result_t BlinkM$Leds$init(void);static #line 81result_t BlinkM$Leds$redToggle(void);static # 59 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Timer.nc"result_t BlinkM$Timer$start(char arg_0xaeef40, uint32_t arg_0xaef098);static inline # 52 "BlinkM.nc"result_t BlinkM$StdControl$init(void);static inline result_t BlinkM$StdControl$start(void);static inline #line 84result_t BlinkM$Timer$fired(void);static # 41 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/PowerManagement.nc"uint8_t TimerM$PowerManagement$adjustPower(void);static # 105 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.nc"void TimerM$Clock$setInterval(uint8_t arg_0xb17bd0);static #line 153uint8_t TimerM$Clock$readCounter(void);static #line 96result_t TimerM$Clock$setRate(char arg_0xb170d0, char arg_0xb17210);static #line 121uint8_t TimerM$Clock$getInterval(void);static # 73 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Timer.nc"result_t TimerM$Timer$fired(# 49 "C:/UCB/cygwin/opt/tinyos-1.x/tos/system/TimerM.nc"uint8_t arg_0xaf96a8);uint32_t TimerM$mState;uint8_t TimerM$setIntervalFlag;uint8_t TimerM$mScale;#line 61uint8_t TimerM$mInterval;int8_t TimerM$queue_head;int8_t TimerM$queue_tail;uint8_t TimerM$queue_size;uint8_t TimerM$queue[NUM_TIMERS];volatile uint16_t TimerM$interval_outstanding;struct TimerM$timer_s { uint8_t type; int32_t ticks; int32_t ticksLeft;} TimerM$mTimerList[NUM_TIMERS];enum TimerM$__nesc_unnamed4262 { TimerM$maxTimerInterval = 230};static inline result_t TimerM$StdControl$init(void);static inline result_t TimerM$StdControl$start(void);static inline result_t TimerM$Timer$start(uint8_t id, char type, uint32_t interval);#line 129static void TimerM$adjustInterval(void);static inline #line 182result_t TimerM$Timer$default$fired(uint8_t id);static inline void TimerM$enqueue(uint8_t value);static inline uint8_t TimerM$dequeue(void);static inline void TimerM$signalOneTimer(void);static inline void TimerM$HandleFire(void);static inline #line 253result_t TimerM$Clock$fire(void);static # 180 "C:/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.nc"result_t HPLClock$Clock$fire(void);# 54 "C:/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/HPLClock.nc"uint8_t HPLClock$set_flag;uint8_t HPLClock$mscale;#line 55uint8_t HPLClock$nextScale;#line 55uint8_t HPLClock$minterval;static inline #line 87void HPLClock$Clock$setInterval(uint8_t value);static inline uint8_t HPLClock$Clock$getInterval(void);static inline #line 134uint8_t HPLClock$Clock$readCounter(void);static inline #line 149result_t HPLClock$Clock$setRate(char interval, char scale);#line 167void __attribute((interrupt)) __vector_15(void);# 51 "C:/UCB/cygwin/opt/tinyos-1.x/tos/platform/micaz/HPLPowerManagementM.nc"bool HPLPowerManagementM$disabled = TRUE;enum HPLPowerManagementM$__nesc_unnamed4263 { HPLPowerManagementM$IDLE = 0, HPLPowerManagementM$ADC_NR = 1 << 3, HPLPowerManagementM$POWER_DOWN = 1 << 4, HPLPowerManagementM$POWER_SAVE = (1 << 3) + (1 << 4), HPLPowerManagementM$STANDBY = (1 << 2) + (1 << 4), HPLPowerManagementM$EXT_STANDBY = (1 << 3) + (1 << 4) + (1 << 2)};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -