📄 app.c
字号:
#define nx_struct struct#define nx_union union#define dbg(mode, format, ...) ((void)0)#define dbg_clear(mode, format, ...) ((void)0)#define dbg_active(mode) 0# 116 "D:\\Crossbow\\cygwin\\usr\\local\\avr\\include\\stdint.h" 3typedef int int8_t __attribute((__mode__(__QI__))) ;typedef unsigned int uint8_t __attribute((__mode__(__QI__))) ;typedef int int16_t __attribute((__mode__(__HI__))) ;typedef unsigned int uint16_t __attribute((__mode__(__HI__))) ;typedef int int32_t __attribute((__mode__(__SI__))) ;typedef unsigned int uint32_t __attribute((__mode__(__SI__))) ;typedef int int64_t __attribute((__mode__(__DI__))) ;typedef unsigned int uint64_t __attribute((__mode__(__DI__))) ;#line 135typedef int16_t intptr_t;typedef uint16_t uintptr_t;#line 152typedef int8_t int_least8_t;typedef uint8_t uint_least8_t;typedef int16_t int_least16_t;typedef uint16_t uint_least16_t;typedef int32_t int_least32_t;typedef uint32_t uint_least32_t;typedef int64_t int_least64_t;typedef uint64_t uint_least64_t;#line 200typedef int8_t int_fast8_t;typedef uint8_t uint_fast8_t;typedef int16_t int_fast16_t;typedef uint16_t uint_fast16_t;typedef int32_t int_fast32_t;typedef uint32_t uint_fast32_t;typedef int64_t int_fast64_t;typedef uint64_t uint_fast64_t;#line 249typedef int64_t intmax_t;typedef uint64_t uintmax_t;# 76 "D:\\Crossbow\\cygwin\\usr\\local\\avr\\include\\inttypes.h"typedef int32_t int_farptr_t;typedef uint32_t uint_farptr_t;# 385 "D:\\Crossbow\\cygwin\\lib\\ncc\\nesc_nx.h"typedef struct { char data[1]; } __attribute__((packed)) nx_int8_t;typedef int8_t __nesc_nxbase_nx_int8_t ;typedef struct { char data[2]; } __attribute__((packed)) nx_int16_t;typedef int16_t __nesc_nxbase_nx_int16_t ;typedef struct { char data[4]; } __attribute__((packed)) nx_int32_t;typedef int32_t __nesc_nxbase_nx_int32_t ;typedef struct { char data[8]; } __attribute__((packed)) nx_int64_t;typedef int64_t __nesc_nxbase_nx_int64_t ;typedef struct { char data[1]; } __attribute__((packed)) nx_uint8_t;typedef uint8_t __nesc_nxbase_nx_uint8_t ;typedef struct { char data[2]; } __attribute__((packed)) nx_uint16_t;typedef uint16_t __nesc_nxbase_nx_uint16_t ;typedef struct { char data[4]; } __attribute__((packed)) nx_uint32_t;typedef uint32_t __nesc_nxbase_nx_uint32_t ;typedef struct { char data[8]; } __attribute__((packed)) nx_uint64_t;typedef uint64_t __nesc_nxbase_nx_uint64_t ;typedef struct { char data[1]; } __attribute__((packed)) nxle_int8_t;typedef int8_t __nesc_nxbase_nxle_int8_t ;typedef struct { char data[2]; } __attribute__((packed)) nxle_int16_t;typedef int16_t __nesc_nxbase_nxle_int16_t ;typedef struct { char data[4]; } __attribute__((packed)) nxle_int32_t;typedef int32_t __nesc_nxbase_nxle_int32_t ;typedef struct { char data[8]; } __attribute__((packed)) nxle_int64_t;typedef int64_t __nesc_nxbase_nxle_int64_t ;typedef struct { char data[1]; } __attribute__((packed)) nxle_uint8_t;typedef uint8_t __nesc_nxbase_nxle_uint8_t ;typedef struct { char data[2]; } __attribute__((packed)) nxle_uint16_t;typedef uint16_t __nesc_nxbase_nxle_uint16_t ;typedef struct { char data[4]; } __attribute__((packed)) nxle_uint32_t;typedef uint32_t __nesc_nxbase_nxle_uint32_t ;typedef struct { char data[8]; } __attribute__((packed)) nxle_uint64_t;typedef uint64_t __nesc_nxbase_nxle_uint64_t ;# 213 "D:\\Crossbow\\cygwin\\usr\\local\\lib\\gcc\\avr\\3.4.5\\include\\stddef.h" 3typedef unsigned int size_t;#line 325typedef int wchar_t;# 69 "D:\\Crossbow\\cygwin\\usr\\local\\avr\\include\\stdlib.h"#line 66typedef struct __nesc_unnamed4242 { int quot; int rem;} div_t;#line 72typedef struct __nesc_unnamed4243 { long quot; long rem;} ldiv_t;typedef int (*__compar_fn_t)(const void *, const void *);# 151 "D:\\Crossbow\\cygwin\\usr\\local\\lib\\gcc\\avr\\3.4.5\\include\\stddef.h" 3typedef int ptrdiff_t;# 71 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\system\\tos.h"typedef unsigned char bool;enum __nesc_unnamed4244 { FALSE = 0, TRUE = 1};uint8_t TOS_ROUTE_PROTOCOL = 0x90;#line 104uint8_t TOS_BASE_STATION = 0;const uint8_t TOS_DATA_LENGTH = 36;#line 132uint8_t TOS_PLATFORM = 7;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 178enum __nesc_unnamed4246 { NULL = 0x0};# 203 "D:\\Crossbow\\cygwin\\usr\\local\\avr\\include\\avr\\pgmspace.h" 3typedef void prog_void __attribute((__progmem__)) ;typedef char prog_char __attribute((__progmem__)) ;typedef unsigned char prog_uchar __attribute((__progmem__)) ;typedef int8_t prog_int8_t __attribute((__progmem__)) ;typedef uint8_t prog_uint8_t __attribute((__progmem__)) ;typedef int16_t prog_int16_t __attribute((__progmem__)) ;typedef uint16_t prog_uint16_t __attribute((__progmem__)) ;typedef int32_t prog_int32_t __attribute((__progmem__)) ;typedef uint32_t prog_uint32_t __attribute((__progmem__)) ;typedef int64_t prog_int64_t __attribute((__progmem__)) ;typedef uint64_t prog_uint64_t __attribute((__progmem__)) ;# 118 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\platform\\atm1281\\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);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_atomic_sleep(void);static __inline void __nesc_enable_interrupt(void);static __inline void __nesc_disable_interrupt(void);# 63 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\platform\\micazc\\hardware.h"static __inline void TOSH_SET_RED_LED_PIN(void);#line 63static __inline void TOSH_CLR_RED_LED_PIN(void);#line 63static __inline void TOSH_MAKE_RED_LED_OUTPUT(void);static __inline void TOSH_SET_GREEN_LED_PIN(void);#line 64static __inline void TOSH_MAKE_GREEN_LED_OUTPUT(void);static __inline void TOSH_SET_YELLOW_LED_PIN(void);#line 65static __inline void TOSH_MAKE_YELLOW_LED_OUTPUT(void);static __inline void TOSH_CLR_SERIAL_ID_PIN(void);#line 67static __inline void TOSH_MAKE_SERIAL_ID_INPUT(void);#line 79static __inline void TOSH_SET_FLASH_SELECT_PIN(void);#line 79static __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);#line 98static __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);#line 134static inline void TOSH_SET_PIN_DIRECTIONS(void );#line 187enum __nesc_unnamed4248 { TOSH_ADC_PORTMAPSIZE = 12};enum __nesc_unnamed4249 { TOSH_ACTUAL_VOLTAGE_PORT = 30, TOSH_ACTUAL_BANDGAP_PORT = 30, TOSH_ACTUAL_GND_PORT = 31};enum __nesc_unnamed4250 { TOS_ADC_VOLTAGE_PORT = 7, TOS_ADC_BANDGAP_PORT = 10, TOS_ADC_GND_PORT = 11};# 33 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\types\\dbg_modes.h"typedef long long TOS_dbg_mode;enum __nesc_unnamed4251 { 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};# 41 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\system\\sched.c"#line 39typedef struct __nesc_unnamed4252 { void (*tp)(void);} TOSH_sched_entry_T;enum __nesc_unnamed4253 { TOSH_MAX_TASKS = 32, 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_sched_init(void );bool TOS_post(void (*tp)(void));#line 82bool TOS_post(void (*tp)(void)) ;#line 116static inline bool TOSH_run_next_task(void);#line 139static inline void TOSH_run_task(void);# 14 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\system\\Ident.h"enum __nesc_unnamed4254 { IDENT_MAX_PROGRAM_NAME_LENGTH = 17};#line 19typedef struct __nesc_unnamed4255 { uint32_t unix_time; uint32_t user_hash; char program_name[IDENT_MAX_PROGRAM_NAME_LENGTH];} Ident_t;# 18 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Timer.h"enum __nesc_unnamed4256 { TIMER_REPEAT = 0, TIMER_ONE_SHOT = 1, NUM_TIMERS = 1U};# 13 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\platform\\atm1281\\Clock.h"enum __nesc_unnamed4257 { 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_unnamed4258 { DEFAULT_SCALE = 3, DEFAULT_INTERVAL = 127};# 57 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Pot.nc"static result_t PotM$Pot$init(uint8_t arg_0x1a525df0);# 53 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\HPLPot.nc"static result_t HPLPotC$Pot$finalise(void);#line 38static result_t HPLPotC$Pot$decrease(void);static result_t HPLPotC$Pot$increase(void);# 32 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\platform\\atm1281\\HPLInit.nc"static result_t HPLInit$init(void);# 41 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\StdControl.nc"static result_t MyAppM$StdControl$init(void);static result_t MyAppM$StdControl$start(void);# 51 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Timer.nc"static result_t MyAppM$Timer$fired(void);# 159 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Clock.nc"static result_t TimerM$Clock$fire(void);# 41 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\StdControl.nc"static result_t TimerM$StdControl$init(void);static result_t TimerM$StdControl$start(void);# 51 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Timer.nc"static result_t TimerM$Timer$default$fired(# 26 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\system\\TimerM.nc"uint8_t arg_0x1a5b2c68);# 37 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Timer.nc"static result_t TimerM$Timer$start(# 26 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\system\\TimerM.nc"uint8_t arg_0x1a5b2c68, # 37 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Timer.nc"char arg_0x1a584258, uint32_t arg_0x1a5843f0);# 84 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Clock.nc"static void HPLClock$Clock$setInterval(uint8_t arg_0x1a5c0e30);#line 127static result_t HPLClock$Clock$setIntervalAndScale(uint8_t arg_0x1a5d0d20, uint8_t arg_0x1a5d0ea8);static uint8_t HPLClock$Clock$readCounter(void);#line 75static result_t HPLClock$Clock$setRate(char arg_0x1a5c0098, char arg_0x1a5c0218);#line 100static uint8_t HPLClock$Clock$getInterval(void);# 19 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\PowerManagement.nc"static uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void);# 35 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Leds.nc"static result_t LedsC$Leds$init(void);#line 51static result_t LedsC$Leds$redOff(void);static result_t LedsC$Leds$redToggle(void);#line 43static result_t LedsC$Leds$redOn(void);# 27 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\system\\RealMain.nc"static result_t RealMain$hardwareInit(void);# 57 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Pot.nc"static result_t RealMain$Pot$init(uint8_t arg_0x1a525df0);# 41 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\StdControl.nc"static result_t RealMain$StdControl$init(void);static result_t RealMain$StdControl$start(void);# 34 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\system\\RealMain.nc"int main(void) ;# 53 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\HPLPot.nc"static result_t PotM$HPLPot$finalise(void);#line 38static result_t PotM$HPLPot$decrease(void);static result_t PotM$HPLPot$increase(void);# 70 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\system\\PotM.nc"uint8_t PotM$potSetting;static inline void PotM$setPot(uint8_t value);#line 85static inline result_t PotM$Pot$init(uint8_t initialSetting);# 37 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\platform\\atm1281\\HPLPotC.nc"static inline result_t HPLPotC$Pot$decrease(void);static inline result_t HPLPotC$Pot$increase(void);static inline result_t HPLPotC$Pot$finalise(void);# 37 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\platform\\atm1281\\HPLInit.nc"static inline result_t HPLInit$init(void);# 35 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Leds.nc"static result_t MyAppM$Leds$init(void);#line 60static result_t MyAppM$Leds$redToggle(void);# 37 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Timer.nc"static result_t MyAppM$Timer$start(char arg_0x1a584258, uint32_t arg_0x1a5843f0);# 29 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\apps\\tutorials\\lesson_1\\MyAppM.nc"static inline result_t MyAppM$StdControl$init(void);static inline result_t MyAppM$StdControl$start(void);#line 59static inline result_t MyAppM$Timer$fired(void);# 19 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\PowerManagement.nc"static uint8_t TimerM$PowerManagement$adjustPower(void);# 84 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Clock.nc"static void TimerM$Clock$setInterval(uint8_t arg_0x1a5c0e30);#line 132static uint8_t TimerM$Clock$readCounter(void);#line 75static result_t TimerM$Clock$setRate(char arg_0x1a5c0098, char arg_0x1a5c0218);#line 100static uint8_t TimerM$Clock$getInterval(void);# 51 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Timer.nc"static result_t TimerM$Timer$fired(# 26 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\system\\TimerM.nc"uint8_t arg_0x1a5b2c68);uint32_t TimerM$mState;uint8_t TimerM$setIntervalFlag;uint8_t TimerM$mScale;#line 38uint8_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;#line 45struct TimerM$timer_s { uint8_t type; int32_t ticks; int32_t ticksLeft;} TimerM$mTimerList[NUM_TIMERS];enum TimerM$__nesc_unnamed4259 { TimerM$maxTimerInterval = 230};static inline result_t TimerM$StdControl$init(void);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -