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

📄 app.c

📁 这是在tinyos中用nesC语言编程示例
💻 C
📖 第 1 页 / 共 5 页
字号:
};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;# 13 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\apps\\tutorials\\lesson_2\\sensorboardApp.h"static __inline void TOSH_SET_PHOTO_CTL_PIN(void);#line 13static __inline void TOSH_CLR_PHOTO_CTL_PIN(void);#line 13static __inline void TOSH_MAKE_PHOTO_CTL_OUTPUT(void);static __inline void TOSH_CLR_TEMP_CTL_PIN(void);#line 14static __inline void TOSH_MAKE_TEMP_CTL_INPUT(void);enum __nesc_unnamed4256 {  TOSH_ACTUAL_PHOTO_PORT = 1,   TOSH_ACTUAL_TEMP_PORT = 1};enum __nesc_unnamed4257 {  TOS_ADC_PHOTO_PORT = 1,   TOS_ADC_TEMP_PORT = 2};#line 50#line 45typedef struct XSensorHeader {  uint8_t board_id;  uint8_t packet_id;  uint8_t node_id;  uint8_t rsvd;} __attribute((packed))  XSensorHeader;#line 52typedef struct PData1 {  uint16_t vref;  uint16_t thermistor;  uint16_t light;  uint16_t mic;  uint16_t accelX;  uint16_t accelY;  uint16_t magX;  uint16_t magY;} __attribute((packed))  PData1;#line 63typedef struct XDataMsg {  XSensorHeader xSensorHeader;  union __nesc_unnamed4258 {    PData1 datap1;  } xData;} __attribute((packed))  XDataMsg;enum __nesc_unnamed4259 {  AM_XSXMSG = 0};# 18 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Timer.h"enum __nesc_unnamed4260 {  TIMER_REPEAT = 0,   TIMER_ONE_SHOT = 1,   NUM_TIMERS = 7U};# 13 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\ADC.h"enum __nesc_unnamed4261 {  TOS_ADCSample3750ns = 0,   TOS_ADCSample7500ns = 1,   TOS_ADCSample15us = 2,   TOS_ADCSample30us = 3,   TOS_ADCSample60us = 4,   TOS_ADCSample120us = 5,   TOS_ADCSample240us = 6,   TOS_ADCSample480us = 7};# 89 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\radio\\rf230\\AM.h"enum __nesc_unnamed4262 {  TOS_BCAST_ADDR = 0xffff,   TOS_UART_ADDR = 0x007e};enum __nesc_unnamed4263 {  TOS_DEFAULT_AM_GROUP = 0x7d};uint8_t TOS_AM_GROUP = TOS_DEFAULT_AM_GROUP;#line 156#line 132typedef 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[29 + 3];  uint8_t strength;  uint8_t lqi;  bool crc;  uint8_t ack;  uint16_t time;} TOS_Msg;#line 158typedef struct TinySec_Msg {  uint8_t invalid;} TinySec_Msg;#line 163typedef struct Ack_Msg {  uint8_t length;  uint8_t fcfhi;  uint8_t fcflo;  uint8_t dsn;  uint8_t fcshi;  uint8_t fcslo;} Ack_Msg;enum __nesc_unnamed4264 {  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 = 29,   LENGTH_BYTE_NUMBER = (size_t )& ((struct TOS_Msg *)0)->length + 1,   TOS_HEADER_SIZE = 5};typedef TOS_Msg *TOS_MsgPtr;# 13 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\platform\\atm1281\\Clock.h"enum __nesc_unnamed4265 {  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_unnamed4266 {  DEFAULT_SCALE = 3, DEFAULT_INTERVAL = 127};# 19 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\radio\\rf230\\byteorder.h"static __inline int is_host_lsb(void);static __inline uint16_t toLSB16(uint16_t a);static __inline uint16_t fromLSB16(uint16_t a);# 11 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\platform\\atm1281\\HPLTimer1.h"enum __nesc_unnamed4267 {  TCLK_CPU_OFF = 0,   TCLK_CPU_DIV1 = 1,   TCLK_CPU_DIV8 = 2,   TCLK_CPU_DIV64 = 3,   TCLK_CPU_DIV256 = 4,   TCLK_CPU_DIV1024 = 5};enum __nesc_unnamed4268 {  TIMER1_DEFAULT_SCALE = TCLK_CPU_DIV64,   TIMER1_DEFAULT_INTERVAL = 255};# 12 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\platform\\atm1281\\crc.h"uint16_t crcTable[256] __attribute((__progmem__))  = { 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);# 57 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Pot.nc"static  result_t PotM$Pot$init(uint8_t arg_0x1a543170);# 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);# 48 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\ADC.nc"static   result_t MyAppM$Light$dataReady(uint16_t arg_0x1a5c1d18);# 27 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\SendMsg.nc"static  result_t MyAppM$SendMsg$sendDone(TOS_MsgPtr arg_0x1a5e5560, result_t arg_0x1a5e56f0);# 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_0x1a623570);# 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_0x1a623570, # 37 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Timer.nc"char arg_0x1a5a3358, uint32_t arg_0x1a5a34f0);static  result_t TimerM$Timer$stop(# 26 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\system\\TimerM.nc"uint8_t arg_0x1a623570);# 84 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Clock.nc"static   void HPLClock$Clock$setInterval(uint8_t arg_0x1a631ae0);#line 127static   result_t HPLClock$Clock$setIntervalAndScale(uint8_t arg_0x1a6409d0, uint8_t arg_0x1a640b58);static   uint8_t HPLClock$Clock$readCounter(void);#line 75static   result_t HPLClock$Clock$setRate(char arg_0x1a641798, char arg_0x1a641918);#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);# 101 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Leds.nc"static   result_t LedsC$Leds$yellowOff(void);#line 93static   result_t LedsC$Leds$yellowOn(void);#line 35static   result_t LedsC$Leds$init(void);#line 76static   result_t LedsC$Leds$greenOff(void);#line 51static   result_t LedsC$Leds$redOff(void);#line 85static   result_t LedsC$Leds$greenToggle(void);#line 110static   result_t LedsC$Leds$yellowToggle(void);#line 60static   result_t LedsC$Leds$redToggle(void);#line 43static   result_t LedsC$Leds$redOn(void);#line 68static   result_t LedsC$Leds$greenOn(void);# 51 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Timer.nc"static  result_t PhotoM$PhotoTimer$fired(void);# 41 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\StdControl.nc"static  result_t PhotoM$PhotoStdControl$init(void);static  result_t PhotoM$PhotoStdControl$start(void);static  result_t PhotoM$PhotoStdControl$stop(void);# 30 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\ADC.nc"static   result_t PhotoM$ExternalPhotoADC$getData(void);#line 48static   result_t PhotoM$InternalPhotoADC$dataReady(uint16_t arg_0x1a5c1d18);# 78 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\HPLADC.nc"static   result_t ADCREFM$HPLADC$dataReady(uint16_t arg_0x1a7b4170);# 48 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\ADC.nc"static   result_t ADCREFM$CalADC$default$dataReady(# 46 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\platform\\atm1281\\ADCREFM.nc"uint8_t arg_0x1a7a5978, # 48 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\ADC.nc"uint16_t arg_0x1a5c1d18);# 66 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\platform\\atm1281\\ADCControl.nc"static  result_t ADCREFM$ADCControl$bindPort(uint8_t arg_0x1a773ad0, uint8_t arg_0x1a773c58);#line 27static  result_t ADCREFM$ADCControl$init(void);#line 74static   result_t ADCREFM$ADCControl$manualCalibrate(void);# 30 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\ADC.nc"static   result_t ADCREFM$ADC$getData(# 45 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\platform\\atm1281\\ADCREFM.nc"uint8_t arg_0x1a7a51e0);# 48 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\ADC.nc"static   result_t ADCREFM$ADC$default$dataReady(# 45 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\platform\\atm1281\\ADCREFM.nc"uint8_t arg_0x1a7a51e0, # 48 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\ADC.nc"uint16_t arg_0x1a5c1d18);# 51 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Timer.nc"static  result_t ADCREFM$Timer$fired(void);# 49 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\HPLADC.nc"static   result_t HPLADCM$ADC$bindPort(uint8_t arg_0x1a7b6748, uint8_t arg_0x1a7b68d0);#line 33static   result_t HPLADCM$ADC$init(void);#line 56static   result_t HPLADCM$ADC$samplePort(uint8_t arg_0x1a7b5010);# 53 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\ReceiveMsg.nc"static  TOS_MsgPtr AMStandard$ReceiveMsg$default$receive(# 35 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\system\\AMStandard.nc"uint8_t arg_0x1a832a70, # 53 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\ReceiveMsg.nc"TOS_MsgPtr arg_0x1a8367d8);# 51 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\Timer.nc"static  result_t AMStandard$ActivityTimer$fired(void);# 45 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\BareSendMsg.nc"static  result_t AMStandard$UARTSend$sendDone(TOS_MsgPtr arg_0x1a844768, result_t arg_0x1a8448f8);# 53 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\ReceiveMsg.nc"static  TOS_MsgPtr AMStandard$RadioReceive$receive(TOS_MsgPtr arg_0x1a8367d8);# 41 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\StdControl.nc"static  result_t AMStandard$Control$init(void);static  result_t AMStandard$Control$start(void);# 44 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\system\\AMStandard.nc"static  result_t AMStandard$default$sendDone(void);# 45 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\BareSendMsg.nc"static  result_t AMStandard$RadioSend$sendDone(TOS_MsgPtr arg_0x1a844768, result_t arg_0x1a8448f8);# 26 "D:\\Crossbow\\cygwin\\opt\\MoteWorks\\tos\\interfaces\\SendMsg.nc"

⌨️ 快捷键说明

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