📄 app.c
字号:
#line 152 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) &= ~(1 << 0); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) &= ~(1 << 1); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x30 + 0x20) |= 1 << 3; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x33 + 0x20) = scale; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x32 + 0x20) = 0; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20) = interval; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) |= 1 << 1; }#line 162 __nesc_atomic_end(__nesc_atomic); } return SUCCESS;}# 96 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.nc"inline static result_t TimerM$Clock$setRate(char arg_0xa4aa3d0, char arg_0xa4aa510){#line 96 unsigned char result;#line 96#line 96 result = HPLClock$Clock$setRate(arg_0xa4aa3d0, arg_0xa4aa510);#line 96#line 96 return result;#line 96}#line 96static inline # 72 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/TimerM.nc"result_t TimerM$StdControl$init(void)#line 72{ TimerM$mState = 0; TimerM$setIntervalFlag = 0; TimerM$queue_head = TimerM$queue_tail = -1; TimerM$queue_size = 0; TimerM$mScale = 3; TimerM$mInterval = TimerM$maxTimerInterval; return TimerM$Clock$setRate(TimerM$mInterval, TimerM$mScale);}# 63 "C:/tinyos/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:/tinyos/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:/tinyos/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:/tinyos/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:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLADC.nc"inline static result_t ADCM$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 # 73 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/ADCM.nc"result_t ADCM$ADCControl$init(void)#line 73{ { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 74 { ADCM$ReqPort = 0; ADCM$ReqVector = ADCM$ContReqMask = 0; }#line 77 __nesc_atomic_end(__nesc_atomic); } { }#line 78 ; return ADCM$HPLADC$init();}# 50 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADCControl.nc"inline static result_t CC1000RadioIntM$ADCControl$init(void){#line 50 unsigned char result;#line 50#line 50 result = ADCM$ADCControl$init();#line 50#line 50 return result;#line 50}#line 50static inline # 110 "C:/tinyos/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:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLADC.nc"inline static result_t ADCM$HPLADC$bindPort(uint8_t arg_0xa459448, uint8_t arg_0xa459590){#line 70 unsigned char result;#line 70#line 70 result = HPLADCM$ADC$bindPort(arg_0xa459448, arg_0xa459590);#line 70#line 70 return result;#line 70}#line 70static inline # 87 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/ADCM.nc"result_t ADCM$ADCControl$bindPort(uint8_t port, uint8_t adcPort)#line 87{ return ADCM$HPLADC$bindPort(port, adcPort);}# 89 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADCControl.nc"inline static result_t CC1000RadioIntM$ADCControl$bindPort(uint8_t arg_0xa374060, uint8_t arg_0xa3741a8){#line 89 unsigned char result;#line 89#line 89 result = ADCM$ADCControl$bindPort(arg_0xa374060, arg_0xa3741a8);#line 89#line 89 return result;#line 89}#line 89static inline # 494 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc"bool CC1000ControlM$CC1000Control$GetLOStatus(void)#line 494{ return CC1000ControlM$gCurrentParameters[0x1e];}# 162 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/CC1000Control.nc"inline static bool CC1000RadioIntM$CC1000Control$GetLOStatus(void){#line 162 unsigned char result;#line 162#line 162 result = CC1000ControlM$CC1000Control$GetLOStatus();#line 162#line 162 return result;#line 162}#line 162# 58 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLCC1000.nc"inline static result_t CC1000ControlM$HPLChipcon$write(uint8_t arg_0xa3ff638, uint8_t arg_0xa3ff780){#line 58 unsigned char result;#line 58#line 58 result = HPLCC1000M$HPLCC1000$write(arg_0xa3ff638, arg_0xa3ff780);#line 58#line 58 return result;#line 58}#line 58static inline # 482 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc"result_t CC1000ControlM$CC1000Control$SelectLock(uint8_t Value)#line 482{ CC1000ControlM$gCurrentParameters[0xd] = Value << 4; return CC1000ControlM$HPLChipcon$write(0x0D, Value << 4);}# 142 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/CC1000Control.nc"inline static result_t CC1000RadioIntM$CC1000Control$SelectLock(uint8_t arg_0xa33e9f0){#line 142 unsigned char result;#line 142#line 142 result = CC1000ControlM$CC1000Control$SelectLock(arg_0xa33e9f0);#line 142#line 142 return result;#line 142}#line 142# 65 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLCC1000.nc"inline static uint8_t CC1000ControlM$HPLChipcon$read(uint8_t arg_0xa3ffbf0){#line 65 unsigned char result;#line 65#line 65 result = HPLCC1000M$HPLCC1000$read(arg_0xa3ffbf0);#line 65#line 65 return result;#line 65}#line 65static inline # 107 "C:/tinyos/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) ; CC1000ControlM$HPLChipcon$write(0x0E, ( 1 << 5) | (6 << 0)); return SUCCESS;}static inline void CC1000ControlM$cc1000SetFreq(void)#line 163{ uint8_t i; for (i = 1; i < 0x0d; i++) { CC1000ControlM$HPLChipcon$write(i, CC1000ControlM$gCurrentParameters[i]); } CC1000ControlM$HPLChipcon$write(0x12, CC1000ControlM$gCurrentParameters[0x12]); CC1000ControlM$chipcon_cal(); return;}static inline #line 376result_t CC1000ControlM$CC1000Control$TunePreset(uint8_t freq)#line 376{ int i; for (i = 1; i < 31; i++) { CC1000ControlM$gCurrentParameters[i] = ({#line 381 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[freq][i];#line 381 unsigned char __result;#line 381 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); }#line 383 CC1000ControlM$cc1000SetModem(); CC1000ControlM$cc1000SetFreq(); return SUCCESS;}static # 101 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/hardware.h"void __inline TOSH_uwait(int u_sec)#line 101{ while (u_sec > 0) { __asm volatile ("nop"); __asm volatile ("nop"); __asm volatile ("nop"); __asm volatile ("nop"); __asm volatile ("nop"); __asm volatile ("nop"); __asm volatile ("nop"); __asm volatile ("nop"); u_sec--; }}#line 127static __inline void TOSH_SET_CC_PCLK_PIN(void)#line 127{#line 127 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) |= 1 << 6;}#line 126static __inline void TOSH_SET_CC_PDATA_PIN(void)#line 126{#line 126 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) |= 1 << 7;}#line 128static __inline void TOSH_SET_CC_PALE_PIN(void)#line 128{#line 128 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) |= 1 << 4;}static inline # 51 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLCC1000M.nc"result_t HPLCC1000M$HPLCC1000$init(void)#line 51{ TOSH_MAKE_CC_CHP_OUT_INPUT(); TOSH_MAKE_CC_PALE_OUTPUT(); TOSH_MAKE_CC_PCLK_OUTPUT(); TOSH_MAKE_CC_PDATA_OUTPUT(); TOSH_SET_CC_PALE_PIN(); TOSH_SET_CC_PDATA_PIN(); TOSH_SET_CC_PCLK_PIN(); return SUCCESS;}# 51 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLCC1000.nc"inline static result_t CC1000ControlM$HPLChipcon$init(void){#line 51 unsigned char result;#line 51#line 51 result = HPLCC1000M$HPLCC1000$init();#line 51#line 51 return result;#line 51}#line 51static inline # 318 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc"result_t CC1000ControlM$StdControl$init(void)#line 318{ CC1000ControlM$HPLChipcon$init(); CC1000ControlM$HPLChipcon$write(0x00, ((( 1 << 5) | (1 << 4)) | ( 1 << 3)) | (1 << 1)); CC1000ControlM$HPLChipcon$write(0x00, (((( 1 << 5) | (1 << 4)) | ( 1 << 3)) | (1 << 1)) | ( 1 << 0)); TOSH_uwait(2000); CC1000ControlM$gCurrentParameters[0xb] = (8 << 4) | (0 << 0); CC1000ControlM$HPLChipcon$write(0x0B, CC1000ControlM$gCurrentParameters[0xb]); CC1000ControlM$gCurrentParameters[0xd] = 9 << 4; CC1000ControlM$HPLChipcon$write(4, CC1000ControlM$gCurrentParameters[0xd]); CC1000ControlM$gCurrentParameters[0xf] = 0; CC1000ControlM$gCurrentParameters[0x10] = (((3 << 5) | (1 << 3)) | ( 3 << 1)) | (1 << 0); CC1000ControlM$gCurrentParameters[0x11] = ((5 << 4) | (1 << 2)) | ( 1 << 0); CC1000ControlM$cc1000SetModem(); CC1000ControlM$gCurrentParameters[0x13] = 1 << 0; CC1000ControlM$HPLChipcon$write(0x13, CC1000ControlM$gCurrentParameters[0x13]); CC1000ControlM$gCurrentParameters[0x1e] = TRUE; CC1000ControlM$CC1000Control$TunePreset(0x00); return SUCCESS;}# 63 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"inline static result_t CC1000RadioIntM$CC1000StdControl$init(void){#line 63 unsigned char result;#line 63#line 63 result = CC1000ControlM$StdControl$init();#line 63#line 63 return result;#line 63}#line 63# 143 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/hardware.h"static __inline void TOSH_MAKE_MOSI_INPUT(void)#line 143{#line 143 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 2);}static __inline void TOSH_MAKE_SPI_SCK_INPUT(void)#line 146{#line 146 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 1);}static inline # 90 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc"result_t HPLSpiM$SpiByteFifo$initSlave(void)#line 90{ { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();#line 91 { TOSH_MAKE_SPI_SCK_INPUT(); TOSH_MAKE_MISO_INPUT(); TOSH_MAKE_MOSI_INPUT(); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) &= ~(1 << 3); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) &= ~(1 << 2); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) |= 1 << 7; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) |= 1 << 6; }#line 99 __nesc_atomic_end(__nesc_atomic); } return SUCCESS;}# 38 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc"inline static result_t CC1000RadioIntM$SpiByteFifo$initSlave(void){#line 38 unsigned char result;#line 38#line 38 result = HPLSpiM$SpiByteFifo$initSlave();#line 38#line 38 return result;#line 38}#line 38st
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -