📄 app.c
字号:
#define MANGLED_NESC_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//# 47 "/home/leopold/DIKU/tinyos-2.x-contrib.branches/0.1pre2/diku/mcs51/tos/chips/mcs51/keil_stdint.h"typedef signed char int8_t;typedef short int16_t;typedef long int32_t;typedef unsigned char uint8_t;typedef unsigned short uint16_t;typedef unsigned long uint32_t;//# 39 "/home/leopold/DIKU/tinyos-2.x-contrib.branches/0.1pre2/diku/mcs51/tos/chips/mcs51/stdint.h"typedef signed char int_least8_t;typedef short int int_least16_t;typedef long int_least32_t;/*__extension__*/ typedef long int int_least64_t;typedef unsigned char uint_least8_t;typedef unsigned short uint_least16_t;typedef unsigned long uint_least32_t;/*__extension__*/ typedef unsigned long int uint_least64_t;typedef signed char int_fast8_t;typedef int int_fast16_t;typedef int int_fast32_t;/*__extension__*/ typedef long int int_fast64_t;typedef unsigned char uint_fast8_t;typedef unsigned int uint_fast16_t;typedef unsigned int uint_fast32_t;/*__extension__*/ typedef unsigned long int uint_fast64_t;//# 99 "/home/leopold/DIKU/tinyos-2.x-contrib.branches/0.1pre2/diku/mcs51/tos/chips/mcs51/stdint.h" 3typedef int intptr_t;typedef unsigned int uintptr_t;/*__extension__*/ typedef long int intmax_t;/*__extension__*/ typedef unsigned long int uintmax_t;//# 35 "/usr/include/inttypes.h"typedef int __gwchar_t;//# 292 "/usr/include/inttypes.h" 3//#line 288typedef struct __nesc_unnamed4242 { long int quot; long int rem;} imaxdiv_t;//# 385 "/usr/local/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 int32_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 uint32_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 int32_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 uint32_t __nesc_nxbase_nxle_uint64_t ;//# 13 "/home/leopold/DIKU/tinyos-2.x-contrib.branches/0.1pre2/diku/mcs51/tos/chips/mcs51/string.h"extern void *memset(void *s, char val, int n);//# 214 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" 3//typedef unsigned int size_t;//#line 326typedef int wchar_t;//# 102 "/usr/include/stdlib.h" 3//#line 98typedef struct __nesc_unnamed4243 { int quot; int rem;} div_t;//#line 106typedef struct __nesc_unnamed4244 { long int quot; long int rem;} ldiv_t;//#line 158/*__extension__*/ //#line 195/*__extension__*/ /*__extension__*/ /*__extension__*/ /*__extension__*/ //#line 305/*__extension__*/ /*__extension__*/ //# 467 "/usr/include/stdlib.h"struct random__data { int32_t *fptr; int32_t *rptr; int32_t *state; int rand_type; int rand_deg; int rand_sep; int32_t *end_ptr;};//#line 536struct drand48__data { unsigned short int __x[3]; unsigned short int __old_x[3]; unsigned short int __c; unsigned short int __init; unsigned long int __a;};//# 765 "/usr/include/stdlib.h" 3typedef int (*__compar_fn_t)(const void *, const void *);//# 291 "/usr/include/math.h" 3//#line 284typedef enum __nesc_unnamed4245 { _IEEE_ = -1, _SVID_, _XOPEN_, _POSIX_, _ISOC_} _LIB_VERSION_TYPE;//#line 309struct exception { int type; char *name; double arg1; double arg2; double retval;};//# 152 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" 3typedef int ptrdiff_t;//# 20 "/home/leopold/DIKU/tinyos-2.x-contrib.branches/0.1pre2/diku/common/tos/system/tos.h"typedef uint8_t bool ;enum __nesc_unnamed4246 {//#line 21 FALSE = 0, TRUE = 1};typedef nx_int8_t nx_bool;/*struct __nesc_attr_atmostonce {};*///#line 40/*struct __nesc_attr_atleastonce {};*///#line 41/*struct __nesc_attr_exactlyonce {};*///# 34 "/home/leopold/DIKU/tinyos-2.x.2.0.1.release/tos/types/TinyError.h"enum __nesc_unnamed4247 { SUCCESS = 0, FAIL = 1, ESIZE = 2, ECANCEL = 3, EOFF = 4, EBUSY = 5, EINVAL = 6, ERETRY = 7, ERESERVE = 8, EALREADY = 9};typedef uint8_t error_t ;static /*inline*/ error_t ecombine(error_t r1, error_t r2);//# 207 "/home/leopold/DIKU/tinyos-2.x-contrib.branches/0.1pre2/diku/mcs51/tos/chips/mcs51/io8051.h"sbit EA = 0xAF;//#line 241sbit P1_0 = 0x90;sbit P1_3 = 0x93;//# 67 "/home/leopold/DIKU/tinyos-2.x-contrib.branches/0.1pre2/diku/mcs51/tos/chips/cc2430/ioCC2430.h"enum __nesc_unnamed4248 { CC2430_IEN0_EA = 0x7, CC2430_IEN0_STIE = 0x5, CC2430_IEN0_ENCIE = 0x4, CC2430_IEN0_URX1IE = 0x3, CC2430_IEN0_URX0IE = 0x2, CC2430_IEN0_ADCIE = 0x1, CC2430_IEN0_RFERRIE = 0x0};enum __nesc_unnamed4249 { CC2430_IEN2_WDTIE = 0x5, CC2430_IEN2_P1IE = 0x4, CC2430_IEN2_UTX1IE = 0x3, CC2430_IEN2_UTX0IE = 0x2, CC2430_IEN2_P2IE = 0x1, CC2430_IEN2_RFIE = 0x0};enum __nesc_unnamed4250 { CC2430_IRCON_STIF = 0x7, CC2430_IRCON_P0IF = 0x5, CC2430_IRCON_T4IF = 0x4, CC2430_IRCON_T3IF = 0x3, CC2430_IRCON_T2IF = 0x2, CC2430_IRCON_T1IF = 0x1, CC2430_IRCON_DMAIF = 0x0};enum __nesc_unnamed4251 { CC2430_IRCON2_WDTIF = 0x4, CC2430_IRCON2_P1IF = 0x3, CC2430_IRCON2_UTX1IF = 0x2, CC2430_IRCON2_UTX0IF = 0x1, CC2430_IRCON2_P2IF = 0x0};enum __nesc_unnamed4252 { CC2430_RFIM_RREG_PD = 0x7, CC2430_RFIM_TXDONE = 0x6, CC2430_RFIM_FIFOP = 0x5, CC2430_RFIM_SFD = 0x4, CC2430_RFIM_CCA = 0x3, CC2430_RFIM_CSP_WT = 0x2, CC2430_RFIM_CSP_STOP = 0x1, CC2430_RFIM_CSP_INT = 0x0};enum __nesc_unnamed4253 { CC2430_RFIF_RREG_ON = 0x7, CC2430_RFIF_TXDONE = 0x6, CC2430_RFIF_FIFOP = 0x5, CC2430_RFIF_SFD = 0x4, CC2430_RFIF_CCA = 0x3, CC2430_RFIF_CSP_WT = 0x2, CC2430_RFIF_CSP_STOP = 0x1, CC2430_RFIF_CSP_INT = 0x0};//#line 256sfr SLEEP = 0xBE;sfr CLKCON = 0xC6;//#line 352sfr P1_DIR = 0xFE;//#line 393//typedef uint16_t uint16_t xdata;//typedef uint8_t uint8_t xdata;//typedef uint16_t uint16_t code;//typedef uint8_t uint8_t code;//#line 479enum __nesc_unnamed4254 { CC2430_RFPWR_ADI_RADIO_PD = 0x4, CC2430_RFPWR_RREG_RADIO_PD = 0x3, CC2430_RFPWR_RREG_DELAY = 0x0, CC2430_RFPWR_RREG_DELAY_MASK = 0x7};enum __nesc_unnamed4255 { CC2430_RREG_DELAY_0 = 0x0, CC2430_RREG_DELAY_31 = 0x1, CC2430_RREG_DELAY_63 = 0x2, CC2430_RREG_DELAY_125 = 0x3, CC2430_RREG_DELAY_250 = 0x4, CC2430_RREG_DELAY_500 = 0x5, CC2430_RREG_DELAY_1000 = 0x6, CC2430_RREG_DELAY_2000 = 0x7};enum __nesc_unnamed4256 { CC2430_MDMCTRL0L_AUTOCRC = 0x5, CC2430_MDMCTRL0L_AUTOACK = 0x4};enum __nesc_unnamed4257 { CC2430_MDMCTRL0H_FRAME_FILT = 0x6, CC2430_MDMCTRL0H_RESERVED_FRAME_MODE = 0x5, CC2430_MDMCTRL0H_PAN_COORDINATOR = 0x4, CC2430_MDMCTRL0H_ADDR_DECODE = 0x3, CC2430_MDMCTRL0H_CCA_HYST = 0x0};enum __nesc_unnamed4258 { CC2430_RFSTATUS_TX_ACTIVE = 0x4, CC2430_RFSTATUS_FIFO = 0x3, CC2430_RFSTATUS_FIFOP = 0x2, CC2430_RFSTATUS_SFD = 0x1, CC2430_RFSTATUS_CCA = 0x0};//# 101 "/home/leopold/DIKU/tinyos-2.x-contrib.branches/0.1pre2/diku/mcs51/tos/chips/mcs51/mcs51hardware.h"typedef uint8_t __nesc_atomic_t;static /*inline*/ void __nesc_disable_interrupt(void);static /*inline*/ void __nesc_enable_interrupt(void); /*inline*/ __nesc_atomic_t __nesc_atomic_start(void ) ; /*inline*/ void __nesc_atomic_end(__nesc_atomic_t oldSreg) ;//# 71 "/home/leopold/DIKU/tinyos-2.x-contrib.branches/0.1pre2/diku/mcs51/tos/chips/cc2430/timer/CC2430Timer.h"enum __nesc_unnamed4259 { CC2430_SLEEP_OSC32K_CALDIS = 7, CC2430_SLEEP_XOSC_STB = 6, CC2430_SLEEP_HFRC_STB = 5, CC2430_SLEEP_DIV = 3, CC2430_SLEEP_OSC_PD = 2, CC2430_SLEEP_MODE = 0, CC2430_SLEEP_MODE_MASK = 3};enum __nesc_unnamed4260 { CC2430_SLEEP_POWERMODE_0 = 0, CC2430_SLEEP_POWERMODE_1 = 1, CC2430_SLEEP_POWERMODE_2 = 2, CC2430_SLEEP_POWERMODE_3 = 3};enum __nesc_unnamed4261 { CC2430_CLKCON_OSC32K = 7, CC2430_CLKCON_OSC = 6, CC2430_CLKCON_TICKSPD = 3, CC2430_CLKCON_CLKSPD = 0, CC2430_CLKCON_TICKSPD_MASK = 0x38};enum cc2430_tick_spd_t { CC2430_TICKF_DIV_1 = 0x0 << CC2430_CLKCON_TICKSPD, CC2430_TICKF_DIV_2 = 0x1 << CC2430_CLKCON_TICKSPD, CC2430_TICKF_DIV_4 = 0x2 << CC2430_CLKCON_TICKSPD, CC2430_TICKF_DIV_8 = 0x3 << CC2430_CLKCON_TICKSPD, CC2430_TICKF_DIV_16 = 0x4 << CC2430_CLKCON_TICKSPD, CC2430_TICKF_DIV_32 = 0x5 << CC2430_CLKCON_TICKSPD, CC2430_TICKF_DIV_64 = 0x6 << CC2430_CLKCON_TICKSPD, CC2430_TICKF_DIV_128 = 0x7 << CC2430_CLKCON_TICKSPD};enum __nesc_unnamed4262 { CC2430_T1CTL_CH2IF = 0x7, CC2430_T1CTL_CH1IF = 0x6, CC2430_T1CTL_CH0IF = 0x5, CC2430_T1CTL_OVFIF = 0x4, CC2430_T1CTL_DIV = 0x2, CC2430_T1CTL_MODE = 0x0, CC2430_T1CTL_MODE_MASK = 0x3, CC2430_T1CTL_DIV_MASK = 0xc, CC2430_T1CTL_IF_MASK = 0xf0};enum cc2430_timer1_mode_t { CC2430_TIMER1_MODE_OFF = 0x0 << CC2430_T1CTL_MODE, CC2430_TIMER1_MODE_FREE = 0x1 << CC2430_T1CTL_MODE, CC2430_TIMER1_MODE_MODULO = 0x2 << CC2430_T1CTL_MODE, CC2430_TIMER1_MODE_UPDOWN = 0x3 << CC2430_T1CTL_MODE};enum cc2430_timer1_if_t { CC2430_T1_CH2IF = 1 << CC2430_T1CTL_CH2IF, CC2430_T1_CH1IF = 1 << CC2430_T1CTL_CH1IF, CC2430_T1_CH0IF = 1 << CC2430_T1CTL_CH0IF, CC2430_T1_OVFIF = 1 << CC2430_T1CTL_OVFIF};enum cc2430_timer1_prescaler_t { CC2430_TIMER1_DIV_1 = 0x0 << CC2430_T1CTL_DIV, CC2430_TIMER1_DIV_8 = 0x1 << CC2430_T1CTL_DIV, CC2430_TIMER1_DIV_32 = 0x2 << CC2430_T1CTL_DIV, CC2430_TIMER1_DIV_128 = 0x3 << CC2430_T1CTL_DIV};enum __nesc_unnamed4263 { CC2430_T1CCTLx_CPSEL = 0x7, CC2430_T1CCTLx_IM = 0x6, CC2430_T1CCTLx_CMP = 0x3, CC2430_T1CCTLx_MODE = 0x2,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -