⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 app.c

📁 主要用于无线传感网络的编写的书籍.对于初学者有着很大的用处
💻 C
📖 第 1 页 / 共 5 页
字号:
enum __nesc_unnamed4268 {  TOS_DEFAULT_AM_GROUP = 0x7d};uint8_t TOS_AM_GROUP = TOS_DEFAULT_AM_GROUP;#line 71typedef 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;  int8_t data[28];  uint8_t strength;  uint8_t lqi;  bool crc;  bool ack;  uint16_t time;} __attribute((packed))  TOS_Msg;enum __nesc_unnamed4269 {  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_CLR_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_CLR_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_UTXD0_IOFUNC(void);static inline void TOSH_SEL_URXD0_IOFUNC(void);static inline void TOSH_SEL_UTXD1_MODFUNC(void);static inline void TOSH_SEL_URXD1_MODFUNC(void);#line 82enum __nesc_unnamed4270 {  TOSH_HUMIDITY_ADDR = 5,   TOSH_HUMIDTEMP_ADDR = 3,   TOSH_HUMIDITY_RESET = 0x1E};static inline void TOSH_SET_FLASH_CS_PIN(void);static inline #line 91void TOSH_CLR_FLASH_CS_PIN(void);static inline #line 91void TOSH_MAKE_FLASH_CS_OUTPUT(void);static inline void TOSH_SET_FLASH_HOLD_PIN(void);static inline #line 92void TOSH_CLR_FLASH_HOLD_PIN(void);static inline #line 92void 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 146void 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_unnamed4271 {  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_unnamed4272 {  void (*tp)(void);} TOSH_sched_entry_T;enum __nesc_unnamed4273 {  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 );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_unnamed4274 {  IDENT_MAX_PROGRAM_NAME_LENGTH = 17};typedef struct __nesc_unnamed4275 {  uint32_t unix_time;  uint32_t user_hash;  char program_name[IDENT_MAX_PROGRAM_NAME_LENGTH];} Ident_t;# 10 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/apps/Sasha/Sasha.h"enum __nesc_unnamed4276 {  ANYCAST = 0,   IDLE = 0,   TRAINING = 1,   MARZULLO = 2,   VERIFY = 3,   SLEEP = 5,   JOIN = 0x01,   DATA = 0x02,   INTERVAL = 0x03,   FAULT = 0x04};enum __nesc_unnamed4277 {  MAX_EPOCH = 100,   NUM_UNITS = 10,   NEGDIST = -1,   INTERVALS = 5,   MAX_TRAIN = 10 * NUM_UNITS,   SENSOR_PERIOD = 50,   M_START = -1,   M_END = 1,   M_MID = 0,   PACKET_TO_SEND = 2};enum __nesc_unnamed4278 {  UART_QUEUE_LEN = 12,   RADIO_QUEUE_LEN = 12,   DISCOVERY = 15000,   REPEAT_MSG = 3,   TIMEOUT = 30000,   TEN_MIN = 900000,   VERIFY_DELAY = 1,   MAX_MOTES = 10};enum __nesc_unnamed4279 {  ROUTING_TABLE = 2,   TABLE_EXIST = 5,   TABLE_TIMER = 5000,   SLEEP_TIMER = 30000,   SENSOR_TIMER = 5000,   NUM_DATA = 10,   MAX_SEQ = 240,   MAX_FAULTS = 500};typedef struct Mrouting {  uint16_t sinkID;  uint16_t parent;  uint8_t seqNum;  uint8_t hop;  uint8_t timer;  bool empty;} Mrouting;typedef struct Anycast {  uint8_t type;  uint16_t src;  uint16_t parent;  uint8_t seqNum;  uint8_t hop;  uint16_t from;  uint8_t request;  uint16_t min;  uint16_t max;  uint16_t min1;  uint16_t max1;  uint16_t min2;  uint16_t max2;  uint16_t min3;  uint16_t max3;  uint8_t nintervals;} Anycast;typedef struct CLNNMsg {  uint8_t type;  uint16_t src;  uint16_t training;  uint16_t min;  uint16_t max;  uint16_t f;  uint16_t percent;  uint16_t mean;  uint16_t limit;  uint16_t trust;  uint32_t s2;} CLNNMsg;typedef struct clnn {  int16_t weights[NUM_UNITS][NUM_UNITS];  int16_t clusters[NUM_UNITS][3];  uint16_t min;  uint16_t max;  uint16_t f;  uint16_t percent;  uint16_t mean;  uint16_t limit;  uint32_t s2;} clnn;typedef struct Marzullo {  uint16_t endpt;  int8_t type;} Marzullo;typedef struct Mote {  uint16_t mote;  uint16_t min;  uint16_t max;  uint16_t percent;  uint32_t s2;  bool fail;} Mote;typedef struct Cluster_Msg {  uint8_t type;  uint16_t train;  uint16_t src;  uint16_t win1;  uint16_t win2;  uint16_t win3;  uint16_t win4;  uint16_t min1;  uint16_t min2;  uint16_t min3;  uint16_t min4;  uint16_t max1;  uint16_t max2;  uint16_t max3;  uint16_t max4;} Cluster_Msg;typedef struct Interval {  uint8_t type;  uint16_t pt1;  uint16_t pt2;  uint32_t prob;} Interval;# 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,   MSP430TIMER_TACLK = 0,   MSP430TIMER_TBCLK = 0,   MSP430TIMER_ACLK = 1,   MSP430TIMER_SMCLK = 2,   MSP430TIMER_INCLK = 3,   MSP430TIMER_CLOCKDIV_1 = 0,   MSP430TIMER_CLOCKDIV_2 = 1,   MSP430TIMER_CLOCKDIV_4 = 2,   MSP430TIMER_CLOCKDIV_8 = 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;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -