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

📄 app.c

📁 主要用于无线传感网络的编写的书籍.对于初学者有着很大的用处
💻 C
📖 第 1 页 / 共 5 页
字号:
}#line 152static __inline void TOSH_MAKE_PW3_OUTPUT(void)#line 152{#line 152  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 3;}#line 153static __inline void TOSH_MAKE_PW4_OUTPUT(void)#line 153{#line 153  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 4;}#line 154static __inline void TOSH_MAKE_PW5_OUTPUT(void)#line 154{#line 154  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 5;}#line 155static __inline void TOSH_MAKE_PW6_OUTPUT(void)#line 155{#line 155  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 6;}#line 156static __inline void TOSH_MAKE_PW7_OUTPUT(void)#line 156{#line 156  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 7;}#line 125static __inline void TOSH_MAKE_CC_CHP_OUT_INPUT(void)#line 125{#line 125  * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) &= ~(1 << 6);}static inline #line 171void TOSH_SET_PIN_DIRECTIONS(void ){  TOSH_MAKE_CC_CHP_OUT_INPUT();  TOSH_MAKE_PW7_OUTPUT();  TOSH_MAKE_PW6_OUTPUT();  TOSH_MAKE_PW5_OUTPUT();  TOSH_MAKE_PW4_OUTPUT();  TOSH_MAKE_PW3_OUTPUT();  TOSH_MAKE_PW2_OUTPUT();  TOSH_MAKE_PW1_OUTPUT();  TOSH_MAKE_PW0_OUTPUT();  TOSH_MAKE_CC_PALE_OUTPUT();  TOSH_MAKE_CC_PDATA_OUTPUT();  TOSH_MAKE_CC_PCLK_OUTPUT();  TOSH_MAKE_MISO_INPUT();  TOSH_MAKE_SPI_OC1C_INPUT();  TOSH_MAKE_SERIAL_ID_INPUT();  TOSH_CLR_SERIAL_ID_PIN();}static inline  # 57 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/avrmote/HPLInit.nc"result_t HPLInit$init(void)#line 57{  TOSH_SET_PIN_DIRECTIONS();  return SUCCESS;}# 47 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/RealMain.nc"inline static  result_t RealMain$hardwareInit(void){#line 47  unsigned char result;#line 47#line 47  result = HPLInit$init();#line 47#line 47  return result;#line 47}#line 47static inline  # 75 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLPotC.nc"result_t HPLPotC$Pot$finalise(void)#line 75{  return SUCCESS;}# 74 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/HPLPot.nc"inline static  result_t PotM$HPLPot$finalise(void){#line 74  unsigned char result;#line 74#line 74  result = HPLPotC$Pot$finalise();#line 74#line 74  return result;#line 74}#line 74static inline  # 66 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLPotC.nc"result_t HPLPotC$Pot$increase(void)#line 66{  return SUCCESS;}# 67 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/HPLPot.nc"inline static  result_t PotM$HPLPot$increase(void){#line 67  unsigned char result;#line 67#line 67  result = HPLPotC$Pot$increase();#line 67#line 67  return result;#line 67}#line 67static inline  # 57 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLPotC.nc"result_t HPLPotC$Pot$decrease(void)#line 57{  return SUCCESS;}# 59 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/HPLPot.nc"inline static  result_t PotM$HPLPot$decrease(void){#line 59  unsigned char result;#line 59#line 59  result = HPLPotC$Pot$decrease();#line 59#line 59  return result;#line 59}#line 59static inline # 93 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/PotM.nc"void PotM$setPot(uint8_t value)#line 93{  uint8_t i;#line 95  for (i = 0; i < 151; i++)     PotM$HPLPot$decrease();  for (i = 0; i < value; i++)     PotM$HPLPot$increase();  PotM$HPLPot$finalise();  PotM$potSetting = value;}static inline  result_t PotM$Pot$init(uint8_t initialSetting)#line 106{  PotM$setPot(initialSetting);  return SUCCESS;}# 78 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Pot.nc"inline static  result_t RealMain$Pot$init(uint8_t arg_0xa2e9d48){#line 78  unsigned char result;#line 78#line 78  result = PotM$Pot$init(arg_0xa2e9d48);#line 78#line 78  return result;#line 78}#line 78static inline # 83 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/sched.c"void TOSH_sched_init(void ){  int i;#line 86  TOSH_sched_free = 0;  TOSH_sched_full = 0;  for (i = 0; i < TOSH_MAX_TASKS; i++)     TOSH_queue[i].tp = (void *)0;}static inline # 120 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/tos.h"result_t rcombine(result_t r1, result_t r2){  return r1 == FAIL ? FAIL : r2;}# 63 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"inline static  result_t CC1000RadioIntM$TimerControl$init(void){#line 63  unsigned char result;#line 63#line 63  result = TimerM$StdControl$init();#line 63#line 63  return result;#line 63}#line 63static inline   # 59 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/system/RandomLFSR.nc"result_t RandomLFSR$Random$init(void)#line 59{  {  }#line 60  ;  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 61    {      RandomLFSR$shiftReg = 119 * 119 * (TOS_LOCAL_ADDRESS + 1);      RandomLFSR$initSeed = RandomLFSR$shiftReg;      RandomLFSR$mask = 137 * 29 * (TOS_LOCAL_ADDRESS + 1);    }#line 65    __nesc_atomic_end(__nesc_atomic); }  return SUCCESS;}# 57 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/Random.nc"inline static   result_t CC1000RadioIntM$Random$init(void){#line 57  unsigned char result;#line 57#line 57  result = RandomLFSR$Random$init();#line 57#line 57  return result;#line 57}#line 57static inline   # 90 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLADCM.nc"result_t HPLADCM$ADC$init(void)#line 90{  HPLADCM$init_portmap();  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 95    {      * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) = (1 << 3) | (6 << 0);      * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x07 + 0x20) = 0;    }#line 99    __nesc_atomic_end(__nesc_atomic); }  return SUCCESS;}# 54 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/HPLADC.nc"inline static   result_t ADCREFM$HPLADC$init(void){#line 54  unsigned char result;#line 54#line 54  result = HPLADCM$ADC$init();#line 54#line 54  return result;#line 54}#line 54static inline  # 99 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/ADCREFM.nc"result_t ADCREFM$ADCControl$init(void)#line 99{  { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 100    {      ADCREFM$ReqPort = 0;      ADCREFM$ReqVector = ADCREFM$ContReqMask = ADCREFM$CalReqMask = 0;      ADCREFM$RefVal = 381;    }#line 104    __nesc_atomic_end(__nesc_atomic); }  {  }#line 105  ;  return ADCREFM$HPLADC$init();}# 77 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/ADCControl.nc"inline static  result_t CC1000RadioIntM$ADCControl$init(void){#line 77  unsigned char result;#line 77#line 77  result = ADCREFM$ADCControl$init();#line 77#line 77  return result;#line 77}#line 77static inline   # 110 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLADCM.nc"result_t HPLADCM$ADC$bindPort(uint8_t port, uint8_t adcPort)#line 110{  if (#line 111  port < TOSH_ADC_PORTMAPSIZE &&   port != TOS_ADC_BANDGAP_PORT &&   port != TOS_ADC_GND_PORT) {      HPLADCM$init_portmap();      { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 115        HPLADCM$TOSH_adc_portmap[port] = adcPort;#line 115        __nesc_atomic_end(__nesc_atomic); }      return SUCCESS;    }  else {    return FAIL;    }}# 70 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/interfaces/HPLADC.nc"inline static   result_t ADCREFM$HPLADC$bindPort(uint8_t arg_0xa5548b8, uint8_t arg_0xa554a00){#line 70  unsigned char result;#line 70#line 70  result = HPLADCM$ADC$bindPort(arg_0xa5548b8, arg_0xa554a00);#line 70#line 70  return result;#line 70}#line 70static inline  # 114 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/ADCREFM.nc"result_t ADCREFM$ADCControl$bindPort(uint8_t port, uint8_t adcPort)#line 114{  return ADCREFM$HPLADC$bindPort(port, adcPort);}# 116 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/ADCControl.nc"inline static  result_t CC1000RadioIntM$ADCControl$bindPort(uint8_t arg_0xa48ec60, uint8_t arg_0xa48eda8){#line 116  unsigned char result;#line 116#line 116  result = ADCREFM$ADCControl$bindPort(arg_0xa48ec60, arg_0xa48eda8);#line 116#line 116  return result;#line 116}#line 116static inline  # 516 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc"bool CC1000ControlM$CC1000Control$GetLOStatus(void)#line 516{  return CC1000ControlM$gCurrentParameters[0x1e];}# 190 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/CC1000Control.nc"inline static  bool CC1000RadioIntM$CC1000Control$GetLOStatus(void){#line 190  unsigned char result;#line 190#line 190  result = CC1000ControlM$CC1000Control$GetLOStatus();#line 190#line 190  return result;#line 190}#line 190# 58 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLCC1000.nc"inline static   result_t CC1000ControlM$HPLChipcon$write(uint8_t arg_0xa512d50, uint8_t arg_0xa512e98){#line 58  unsigned char result;#line 58#line 58  result = HPLCC1000M$HPLCC1000$write(arg_0xa512d50, arg_0xa512e98);#line 58#line 58  return result;#line 58}#line 58static inline  # 504 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc"result_t CC1000ControlM$CC1000Control$SelectLock(uint8_t Value)#line 504{  CC1000ControlM$gCurrentParameters[0xd] = Value << 4;  return CC1000ControlM$HPLChipcon$write(0x0D, Value << 4);}# 170 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/CC1000Control.nc"inline static  result_t CC1000RadioIntM$CC1000Control$SelectLock(uint8_t arg_0xa451180){#line 170  unsigned char result;#line 170#line 170  result = CC1000ControlM$CC1000Control$SelectLock(arg_0xa451180);#line 170#line 170  return result;#line 170}#line 170# 65 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLCC1000.nc"inline static   uint8_t CC1000ControlM$HPLChipcon$read(uint8_t arg_0xa513308){#line 65  unsigned char result;#line 65#line 65  result = HPLCC1000M$HPLCC1000$read(arg_0xa513308);#line 65#line 65  return result;#line 65}#line 65static inline # 131 "C:/PROGRA~1/UCB/cygwin/opt/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc"result_t CC1000ControlM$chipcon_cal(void){  CC1000ControlM$HPLChipcon$write(0x0B, 0x00);  CC1000ControlM$HPLChipcon$write(0x42, 0x3f);  CC1000ControlM$HPLChipcon$write(0x00, (  1 << 4) | (1 << 0));  CC1000ControlM$HPLChipcon$write(0x0E, ((  1 << 7) | (  1 << 5)) | (6 << 0));  while ((CC1000ControlM$HPLChipcon$read(0x0E) & (1 << 3)) == 0) ;  CC1000ControlM$HPLChipcon$write(0x0E, (  1 << 5) | (6 << 0));  CC1000ControlM$HPLChipcon$write(0x00, (((  1 << 7) | (1 << 6)) | (1 << 5)) | (  1 << 0));  CC1000ControlM$HPLChipcon$write(0x09, CC1000ControlM$gCurrentParameters[29]);  CC1000ControlM$HPLChipcon$write(0x0B, 0x00);  CC1000ControlM$HPLChipcon$write(0x0E, ((  1 << 7) | (  1 << 5)) | (6 << 0));  while ((CC1000ControlM$HPLChipcon$read(0x0E) & (1 << 3)) == 0)

⌨️ 快捷键说明

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