📄 app.c
字号:
CP_MDMCTRL1, CP_RSSI, CP_SYNCWORD, CP_TXCTRL, CP_RXCTRL0, CP_RXCTRL1, CP_FSCTRL, CP_SECCTRL0, CP_SECCTRL1, CP_BATTMON, CP_IOCFG0, CP_IOCFG1};# 10 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/telosb/AM.h"enum __nesc_unnamed4271 { TOS_BCAST_ADDR = 0xffff, TOS_UART_ADDR = 0x007e};enum __nesc_unnamed4272 { TOS_DEFAULT_AM_GROUP = 0x7d};uint8_t TOS_AM_GROUP = TOS_DEFAULT_AM_GROUP;#line 35typedef struct TOS_Msg { uint8_t length; uint8_t fcfhi; uint8_t fcflo; uint8_t dsn; uint16_t destpan; uint16_t addr; uint8_t type; uint8_t group; uint16_t ctr; uint32_t mac; int8_t data[28]; uint8_t strength; uint8_t lqi; bool crc; bool ack; uint16_t time;} __attribute((packed)) TOS_Msg;enum __nesc_unnamed4273 { MSG_HEADER_SIZE = (size_t )& ((struct TOS_Msg *)0)->data - 1, MSG_FOOTER_SIZE = 2, MSG_DATA_SIZE = (size_t )& ((struct TOS_Msg *)0)->strength + sizeof(uint16_t ), DATA_LENGTH = 28, LENGTH_BYTE_NUMBER = (size_t )& ((struct TOS_Msg *)0)->length + 1};typedef TOS_Msg *TOS_MsgPtr;static inline # 12 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/telosb/hardware.h"void TOSH_SET_RED_LED_PIN(void);static inline #line 12void TOSH_CLR_RED_LED_PIN(void);static inline #line 12void TOSH_MAKE_RED_LED_OUTPUT(void);static inline void TOSH_SET_GREEN_LED_PIN(void);static inline #line 13void TOSH_MAKE_GREEN_LED_OUTPUT(void);static inline void TOSH_SET_YELLOW_LED_PIN(void);static inline #line 14void TOSH_MAKE_YELLOW_LED_OUTPUT(void);static inline void TOSH_SET_RADIO_CSN_PIN(void);static inline #line 17void TOSH_CLR_RADIO_CSN_PIN(void);static inline #line 17void TOSH_MAKE_RADIO_CSN_OUTPUT(void);static inline uint8_t TOSH_READ_RADIO_CCA_PIN(void);static inline uint8_t TOSH_READ_CC_FIFOP_PIN(void);static inline uint8_t TOSH_READ_CC_FIFO_PIN(void);static inline uint8_t TOSH_READ_CC_SFD_PIN(void);static inline #line 29void TOSH_SEL_CC_SFD_MODFUNC(void);static inline #line 29void TOSH_SEL_CC_SFD_IOFUNC(void);static inline void TOSH_SET_CC_VREN_PIN(void);static inline void TOSH_SET_CC_RSTN_PIN(void);static inline #line 31void TOSH_CLR_CC_RSTN_PIN(void);static inline void TOSH_SEL_SOMI0_MODFUNC(void);static inline void TOSH_SET_SIMO0_PIN(void);static inline #line 35void TOSH_CLR_SIMO0_PIN(void);static inline #line 35void TOSH_MAKE_SIMO0_OUTPUT(void);static inline #line 35void TOSH_MAKE_SIMO0_INPUT(void);static inline #line 35void TOSH_SEL_SIMO0_MODFUNC(void);static inline void TOSH_SET_UCLK0_PIN(void);static inline #line 36void TOSH_CLR_UCLK0_PIN(void);static inline #line 36void TOSH_MAKE_UCLK0_OUTPUT(void);static inline #line 36void TOSH_MAKE_UCLK0_INPUT(void);static inline #line 36void TOSH_SEL_UCLK0_MODFUNC(void);static inline void TOSH_SEL_UTXD1_MODFUNC(void);static inline void TOSH_SEL_URXD1_MODFUNC(void);#line 78enum __nesc_unnamed4274 { TOSH_HUMIDITY_ADDR = 5, TOSH_HUMIDTEMP_ADDR = 3, TOSH_HUMIDITY_RESET = 0x1E};static inline void TOSH_SET_FLASH_CS_PIN(void);static inline #line 87void TOSH_CLR_FLASH_CS_PIN(void);static inline #line 87void TOSH_MAKE_FLASH_CS_OUTPUT(void);static inline void TOSH_SET_FLASH_HOLD_PIN(void);static inline #line 88void TOSH_CLR_FLASH_HOLD_PIN(void);static inline #line 88void TOSH_MAKE_FLASH_HOLD_OUTPUT(void);static inline void TOSH_FLASH_M25P_DP_bit(bool set);static inline void TOSH_FLASH_M25P_DP(void);static inline #line 142void TOSH_SET_PIN_DIRECTIONS(void );# 54 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/types/dbg_modes.h"typedef long long TOS_dbg_mode;enum __nesc_unnamed4275 { 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:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/sched.c"typedef struct __nesc_unnamed4276 { void (*tp)(void);} TOSH_sched_entry_T;enum __nesc_unnamed4277 { 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 void TOSH_wait(void );static void TOSH_sleep(void );static inline void TOSH_sched_init(void );#line 102bool TOS_post(void (*tp)(void));static inline #line 134bool TOSH_run_next_task(void);static inline #line 157void TOSH_run_task(void);# 28 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/Ident.h"enum __nesc_unnamed4278 { IDENT_MAX_PROGRAM_NAME_LENGTH = 10};typedef struct __nesc_unnamed4279 { uint32_t unix_time; uint32_t user_hash; char program_name[IDENT_MAX_PROGRAM_NAME_LENGTH];} Ident_t;# 28 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/msp430/MSP430Timer.h"enum __nesc_unnamed4280 { MSP430TIMER_CM_NONE = 0, MSP430TIMER_CM_RISING = 1, MSP430TIMER_CM_FALLING = 2, MSP430TIMER_CM_BOTH = 3, MSP430TIMER_STOP_MODE = 0, MSP430TIMER_UP_MODE = 1, MSP430TIMER_CONTINUOUS_MODE = 2, MSP430TIMER_UPDOWN_MODE = 3};typedef struct __nesc_unnamed4281 { int ccifg : 1; int cov : 1; int out : 1; int cci : 1; int ccie : 1; int outmod : 3; int cap : 1; int clld : 2; int scs : 1; int ccis : 2; int cm : 2;} MSP430CompareControl_t;typedef struct __nesc_unnamed4282 { int taifg : 1; int taie : 1; int taclr : 1; int _unused0 : 1; int mc : 2; int id : 2; int tassel : 2; int _unused1 : 6;} MSP430TimerAControl_t;typedef struct __nesc_unnamed4283 { int tbifg : 1; int tbie : 1; int tbclr : 1; int _unused0 : 1; int mc : 2; int id : 2; int tbssel : 2; int _unused1 : 1; int cntl : 2; int tbclgrp : 2; int _unused2 : 1;} MSP430TimerBControl_t;# 20 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/msp430/msp430baudrates.h"enum __nesc_unnamed4284 { UBR_ACLK_1200 = 0x001B, UMCTL_ACLK_1200 = 0x94, UBR_ACLK_1800 = 0x0012, UMCTL_ACLK_1800 = 0x84, UBR_ACLK_2400 = 0x000D, UMCTL_ACLK_2400 = 0x6D, UBR_ACLK_4800 = 0x0006, UMCTL_ACLK_4800 = 0x77, UBR_ACLK_9600 = 0x0003, UMCTL_ACLK_9600 = 0x29, UBR_SMCLK_1200 = 0x0369, UMCTL_SMCLK_1200 = 0x7B, UBR_SMCLK_1800 = 0x0246, UMCTL_SMCLK_1800 = 0x55, UBR_SMCLK_2400 = 0x01B4, UMCTL_SMCLK_2400 = 0xDF, UBR_SMCLK_4800 = 0x00DA, UMCTL_SMCLK_4800 = 0xAA, UBR_SMCLK_9600 = 0x006D, UMCTL_SMCLK_9600 = 0x44, UBR_SMCLK_19200 = 0x0036, UMCTL_SMCLK_19200 = 0xB5, UBR_SMCLK_38400 = 0x001B, UMCTL_SMCLK_38400 = 0x94, UBR_SMCLK_57600 = 0x0012, UMCTL_SMCLK_57600 = 0x84, UBR_SMCLK_76800 = 0x000D, UMCTL_SMCLK_76800 = 0x6D, UBR_SMCLK_115200 = 0x0009, UMCTL_SMCLK_115200 = 0x10, UBR_SMCLK_230400 = 0x0004, UMCTL_SMCLK_230400 = 0x55};# 46 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/lib/Counters/IntMsg.h"typedef struct IntMsg { uint16_t val; uint16_t src;} IntMsg;enum __nesc_unnamed4285 { AM_INTMSG = 4};# 39 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Timer.h"enum __nesc_unnamed4286 { TIMER_REPEAT = 0, TIMER_ONE_SHOT = 1, NUM_TIMERS = 1};static # 10 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/lib/CC2420Radio/byteorder.h"__inline int is_host_lsb(void);static __inline uint16_t toLSB16(uint16_t a);static __inline uint16_t fromLSB16(uint16_t a);# 31 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/msp430/crc.h"uint16_t const ccitt_crc16_table[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 };static uint16_t crcByte(uint16_t fcs, uint8_t c);static result_t HPLInitM$init(void);static void MSP430ClockM$MSP430ClockInit$default$initTimerB(void);static void MSP430ClockM$MSP430ClockInit$defaultInitTimerA(void);static void MSP430ClockM$MSP430ClockInit$default$initTimerA(void);static void MSP430ClockM$MSP430ClockInit$defaultInitTimerB(void);static void MSP430ClockM$MSP430ClockInit$default$initClocks(void);static void MSP430ClockM$MSP430ClockInit$defaultInitClocks(void);static void MSP430ClockM$ACLKCompare$fired(void);static result_t MSP430ClockM$StdControl$init(void);static result_t MSP430ClockM$StdControl$start(void);static MSP430CompareControl_t MSP430TimerM$ControlA2$getControl(void);static MSP430CompareControl_t MSP430TimerM$ControlB0$getControl(void);static uint16_t MSP430TimerM$CaptureA1$getEvent(void);static void MSP430TimerM$CaptureA1$default$captured(uint16_t arg_0xa4939e8);static uint16_t MSP430TimerM$CaptureB3$getEvent(void);static void MSP430TimerM$CaptureB3$default$captured(uint16_t arg_0xa4939e8);static void MSP430TimerM$CompareA1$default$fired(void);static void MSP430TimerM$CompareB3$setEventFromNow(uint16_t arg_0xa4570e8);static uint16_t MSP430TimerM$CaptureB6$getEvent(void);static void MSP430TimerM$CaptureB6$default$captured(uint16_t arg_0xa4939e8);static MSP430CompareControl_t MSP430TimerM$ControlB4$getControl(void);static void MSP430TimerM$ControlB4$enableEvents(void);static void MSP430TimerM$ControlB4$setControlAsCompare(void);static void MSP430TimerM$ControlB4$disableEvents(void);static void MSP430TimerM$ControlB4$clearPendingInterrupt(void);static MSP430CompareControl_t MSP430TimerM$ControlA0$getControl(void);static uint16_t MSP430TimerM$CaptureB1$getEvent(void);static void MSP430TimerM$CaptureB1$clearOverflow(void);static bool MSP430TimerM$CaptureB1$isOverflowPending(void);static void MSP430TimerM$CompareB1$default$fired(void);static void MSP430TimerM$ControlB1$setControlAsCapture(bool arg_0xa46b898);static MSP430CompareControl_t MSP430TimerM$ControlB1$getControl(void);static void MSP430TimerM$ControlB1$enableEvents(void);static void MSP430TimerM$ControlB1$disableEvents(void);static void MSP430TimerM$ControlB1$clearPendingInterrupt(void);static uint16_t MSP430TimerM$CaptureA2$getEvent(void);static void MSP430TimerM$CaptureA2$default$captured(uint16_t arg_0xa4939e8);static uint16_t MSP430TimerM$CaptureB4$getEvent(void);static void MSP430TimerM$CaptureB4$default$captured(uint16_t arg_0xa4939e8);static MSP430CompareControl_t MSP430TimerM$ControlB2$getControl(void);static void MSP430TimerM$ControlB2$enableEvents(void);static void MSP430TimerM$ControlB2$setControlAsCompare(void);static void MSP430TimerM$CompareA2$default$fired(void);static void MSP430TimerM$TimerA$default$overflow(void);static void MSP430TimerM$CompareB4$setEventFromNow(uint16_t arg_0xa4570e8);static MSP430CompareControl_t MSP430TimerM$ControlA1$getControl(void);static MSP430CompareControl_t MSP430TimerM$ControlB5$getControl(void);static uint16_t MSP430TimerM$CaptureA0$getEvent(void);static void MSP430TimerM$CaptureA0$default$captured(uint16_t arg_0xa4939e8);static uint16_t MSP430TimerM$CaptureB2$getEvent(void);static void MSP430TimerM$CaptureB2$default$captured(uint16_t arg_0xa4939e8);static void MSP430TimerM$CompareA0$default$fired(void);static void MSP430TimerM$CompareB2$setEventFromPrev(uint16_t arg_0xa456cd0);static void MSP430TimerM$CompareB2$setEventFromNow(uint16_t arg_0xa4570e8);static uint16_t MSP430TimerM$CaptureB5$getEvent(void);static void MSP430TimerM$CaptureB5$default$captured(uint16_t arg_0xa4939e8);static MSP430CompareControl_t MSP430TimerM$ControlB3$getControl(void);static void MSP430TimerM$ControlB3$enableEvents(void);static void MSP430TimerM$ControlB3$setControlAsCompare(void);static void MSP430TimerM$ControlB3$disableEvents(void);static void MSP430TimerM$ControlB3$clearPendingInterrupt(void);static uint16_t MSP430TimerM$TimerB$read(void);static void MSP430TimerM$TimerB$clearOverflow(void);static bool MSP430TimerM$TimerB$isOverflowPending(void);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -