📄 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:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/tos.h"typedef unsigned char bool;enum __nesc_unnamed4244 { FALSE = 0, TRUE = 1};uint16_t TOS_LOCAL_ADDRESS = 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);static inline result_t rcombine3(result_t r1, result_t r2, result_t r3);#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:/PROGRA~1/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);# 57 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica/hardware.h"static __inline void TOSH_SET_RED_LED_PIN(void);#line 57static __inline void TOSH_CLR_RED_LED_PIN(void);#line 57static __inline void TOSH_MAKE_RED_LED_OUTPUT(void);static __inline void TOSH_SET_YELLOW_LED_PIN(void);#line 58static __inline void TOSH_CLR_YELLOW_LED_PIN(void);#line 58static __inline void TOSH_MAKE_YELLOW_LED_OUTPUT(void);static __inline void TOSH_SET_GREEN_LED_PIN(void);#line 59static __inline void TOSH_CLR_GREEN_LED_PIN(void);#line 59static __inline void TOSH_MAKE_GREEN_LED_OUTPUT(void);static __inline void TOSH_SET_UD_PIN(void);#line 61static __inline void TOSH_CLR_UD_PIN(void);static __inline void TOSH_SET_INC_PIN(void);#line 62static __inline void TOSH_CLR_INC_PIN(void);static __inline void TOSH_SET_POT_SELECT_PIN(void);#line 63static __inline void TOSH_CLR_POT_SELECT_PIN(void);#line 63static __inline void TOSH_MAKE_POT_SELECT_OUTPUT(void);static __inline void TOSH_SET_POT_POWER_PIN(void);#line 64static __inline void TOSH_MAKE_POT_POWER_OUTPUT(void);static __inline void TOSH_SET_BOOST_ENABLE_PIN(void);#line 65static __inline void TOSH_MAKE_BOOST_ENABLE_OUTPUT(void);static __inline void TOSH_MAKE_FLASH_SELECT_INPUT(void);static __inline int TOSH_READ_RFM_RXD_PIN(void);static __inline void TOSH_CLR_RFM_TXD_PIN(void);#line 77static __inline void TOSH_MAKE_RFM_TXD_OUTPUT(void);#line 77static __inline void TOSH_MAKE_RFM_TXD_INPUT(void);static __inline void TOSH_SET_RFM_CTL0_PIN(void);#line 78static __inline void TOSH_CLR_RFM_CTL0_PIN(void);#line 78static __inline void TOSH_MAKE_RFM_CTL0_OUTPUT(void);static __inline void TOSH_SET_RFM_CTL1_PIN(void);#line 79static __inline void TOSH_CLR_RFM_CTL1_PIN(void);#line 79static __inline void TOSH_MAKE_RFM_CTL1_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 void TOSH_SET_UART_RXD0_PIN(void);static __inline void TOSH_SET_ONE_WIRE_PIN(void);#line 101static __inline void TOSH_CLR_ONE_WIRE_PIN(void);#line 101static __inline void TOSH_MAKE_ONE_WIRE_OUTPUT(void);#line 101static __inline void TOSH_MAKE_ONE_WIRE_INPUT(void);static inline void TOSH_SET_PIN_DIRECTIONS(void );#line 138enum __nesc_unnamed4248 { TOSH_ADC_PORTMAPSIZE = 12};enum __nesc_unnamed4249 { TOSH_ACTUAL_VOLTAGE_PORT = 7};enum __nesc_unnamed4250 { TOS_ADC_VOLTAGE_PORT = 7};# 54 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/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};# 59 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/sched.c"typedef struct __nesc_unnamed4252 { void (*tp)(void);} TOSH_sched_entry_T;enum __nesc_unnamed4253 { 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:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/Ident.h"enum __nesc_unnamed4254 { IDENT_MAX_PROGRAM_NAME_LENGTH = 17};typedef struct __nesc_unnamed4255 { uint32_t unix_time; uint32_t user_hash; char program_name[IDENT_MAX_PROGRAM_NAME_LENGTH];} Ident_t;# 49 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/types/AM.h"enum __nesc_unnamed4256 { TOS_BCAST_ADDR = 0xffff, TOS_UART_ADDR = 0x007e};enum __nesc_unnamed4257 { TOS_DEFAULT_AM_GROUP = 0x7d};uint8_t TOS_AM_GROUP = TOS_DEFAULT_AM_GROUP;#line 84typedef struct TOS_Msg { uint16_t addr; uint8_t type; uint8_t group; uint8_t length; int8_t data[29]; uint16_t crc; uint16_t strength; uint8_t ack; uint16_t time; uint8_t sendSecurityMode; uint8_t receiveSecurityMode;} TOS_Msg;typedef struct TOS_Msg_TinySecCompat { uint16_t addr; uint8_t type; uint8_t length; uint8_t group; int8_t data[29]; uint16_t crc; uint16_t strength; uint8_t ack; uint16_t time; uint8_t sendSecurityMode; uint8_t receiveSecurityMode;} TOS_Msg_TinySecCompat;typedef struct TinySec_Msg { uint16_t addr; uint8_t type; uint8_t length; uint8_t iv[4]; uint8_t enc[29]; uint8_t mac[4]; uint8_t calc_mac[4]; uint8_t ack_byte; bool cryptoDone; bool receiveDone; bool MACcomputed;} __attribute((packed)) TinySec_Msg;enum __nesc_unnamed4258 { MSG_DATA_SIZE = (size_t )& ((struct TOS_Msg *)0)->crc + sizeof(uint16_t ), TINYSEC_MSG_DATA_SIZE = (size_t )& ((struct TinySec_Msg *)0)->mac + 4, DATA_LENGTH = 29, LENGTH_BYTE_NUMBER = (size_t )& ((struct TOS_Msg *)0)->length + 1, TINYSEC_NODE_ID_SIZE = sizeof(uint16_t )};enum __nesc_unnamed4259 { TINYSEC_AUTH_ONLY = 1, TINYSEC_ENCRYPT_AND_AUTH = 2, TINYSEC_DISABLED = 3, TINYSEC_RECEIVE_AUTHENTICATED = 4, TINYSEC_RECEIVE_CRC = 5, TINYSEC_RECEIVE_ANY = 6, TINYSEC_ENABLED_BIT = 128, TINYSEC_ENCRYPT_ENABLED_BIT = 64} __attribute((packed)) ;typedef TOS_Msg *TOS_MsgPtr;# 33 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/TosTime.h"typedef struct __nesc_unnamed4260 { uint32_t high32; uint32_t low32;} tos_time_t;# 31 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/avrmote/crc.h"uint16_t __attribute((__progmem__)) crcTable[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 inline uint16_t crcByte(uint16_t oldCrc, uint8_t byte);static result_t PotM$Pot$init(uint8_t arg_0xa28e970);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 TOSBaseM$UARTSend$sendDone(TOS_MsgPtr arg_0xa2dfd38, result_t arg_0xa2dfe88);static TOS_MsgPtr TOSBaseM$UARTTokenReceive$receive(TOS_MsgPtr arg_0xa2d2bd8, uint8_t arg_0xa2d2d20);static TOS_MsgPtr TOSBaseM$RadioReceive$receive(TOS_MsgPtr arg_0xa2cb490);static result_t TOSBaseM$RadioSend$sendDone(TOS_MsgPtr arg_0xa2dfd38, result_t arg_0xa2dfe88);static result_t TOSBaseM$StdControl$init(void);static result_t TOSBaseM$StdControl$start(void);static TOS_MsgPtr TOSBaseM$UARTReceive$receive(TOS_MsgPtr arg_0xa2cb490);static result_t SlavePinM$SlavePin$low(void);static result_t SlavePinM$SlavePin$high(bool arg_0xa31e0f0);static result_t HPLSlavePinC$SlavePin$low(void);static result_t HPLSlavePinC$SlavePin$high(void);static result_t MicaHighSpeedRadioM$Send$send(TOS_MsgPtr arg_0xa2df820);static result_t MicaHighSpeedRadioM$Code$decodeDone(char arg_0xa3614b0, char arg_0xa3615f0);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -