#define dbg(mode, format, ...) ((void)0) #define dbg_clear(mode, format, ...) ((void)0) #define dbg_active(mode) 0 # 60 "c:/avrgcc/avr/include/inttypes.h" typedef signed char int8_t; typedef unsigned char uint8_t; # 83 "c:/avrgcc/avr/include/inttypes.h" 3 typedef int int16_t; typedef unsigned int uint16_t; typedef long int32_t; typedef unsigned long uint32_t; #line 117 typedef long long int64_t; typedef unsigned long long uint64_t; #line 134 typedef int16_t intptr_t; typedef uint16_t uintptr_t; # 213 "c:/avrgcc/lib/gcc-lib/avr/3.3/include/stddef.h" 3 typedef unsigned int size_t; #line 325 typedef int wchar_t; # 60 "c:/avrgcc/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 "c:/avrgcc/lib/gcc-lib/avr/3.3/include/stddef.h" 3 typedef int ptrdiff_t; # 90 "c:/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 #line 126 result_t rcombine4(result_t r1, result_t r2, result_t r3, result_t r4); enum __nesc_unnamed4246 { NULL = 0x0 }; # 81 "c:/avrgcc/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; # 147 "c:/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; __inline __nesc_atomic_t __nesc_atomic_start(void ); __inline void __nesc_atomic_end(__nesc_atomic_t oldSreg); # 224 "c:/tinyos-1.x/tos/platform/mica2/CC1000Const.h" static const prog_uchar CC1K_LPL_PreambleLength[7 * 2] = { 0, 28, 0, 94, 0, 250, 0x01, 0x73, 0x01, 0xEA, 0x04, 0xBC, 0x0A, 0x5E }; static const prog_uchar CC1K_LPL_ValidPrecursor[7] = { 5, 2, 2, 2, 2, 2, 2 }; static const prog_uchar CC1K_LPL_SleepTime[7 * 2] = { 0, 0, 0, 20, 0, 85, 0, 135, 0, 185, 0x01, 0xE5, 0x04, 0x3D }; static const prog_uchar CC1K_LPL_SleepPreamble[7] = { 0, 8, 8, 8, 8, 8, 8 }; static const prog_uchar CC1K_LPL_SquelchInit[7] = { 0x70, 0xEF, 0xEF, 0xEF, 0xEF, 0xEF, 0xEF }; static const prog_uchar CC1K_Params[5][31] = { { 0x31, 0x58, 0x00, 0x00, 0x57, 0xf6, 0x85, 0X03, 0x55, ( 8 << 4) | (4 << 2), 1 << 1, ( 0x0 << 4) | (0xf << 0), 12 << 3, 0xe << 4, ( 1 << 5) | (6 << 0), ( 1 << 7) | (33 << 0), ((( 3 << 5) | (1 << 3)) | (3 << 1)) | (1 << 0), (( 5 << 4) | (1 << 2)) | (1 << 0), ( 0x7 << 4) | (0x0 << 0), 1 << 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ( 8 << 4) | (1 << 0), TRUE }, { 0x31, 0x7c, 0x00, 0x00, 0x7b, 0xf9, 0xae, 0x02, 0x38, ( 8 << 4) | (3 << 2), (( 1 << 5) | (2 << 3)) | (1 << 1), ( 0x8 << 4) | (0x0 << 0), 8 << 3, 0x1 << 4, ( 1 << 5) | (6 << 0), ( 1 << 7) | (33 << 0), ((( 3 << 5) | (1 << 3)) | (3 << 1)) | (1 << 0), (( 5 << 4) | (1 << 2)) | (1 << 0), ( 0x1 << 4) | (0x0 << 0), 1 << 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ( 15 << 4) | (3 << 0), TRUE }, { 0x31, 0x51, 0x00, 0x00, 0x50, 0xf7, 0x4F, 0X03, 0x0E, ( 8 << 4) | (4 << 2), 1 << 1, ( 0x0 << 4) | (0xf << 0), 11 << 3, 0xe << 4, ( 1 << 5) | (6 << 0), ( 1 << 7) | (33 << 0), ((( 3 << 5) | (1 << 3)) | (3 << 1)) | (1 << 0), (( 5 << 4) | (1 << 2)) | (1 << 0), ( 0x7 << 4) | (0x0 << 0), 1 << 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ( 8 << 4) | (1 << 0), TRUE }, { 0x31, 0x58, 0x00, 0x00, 0x57, 0xf6, 0x85, 0X03, 0x55, ( 4 << 4) | (1 << 2), 1 << 1, ( 0x0 << 4) | (0xf << 0), 12 << 3, 0xe << 4, ( 1 << 5) | (6 << 0), ( 1 << 7) | (55 << 0), ((( 3 << 5) | (1 << 3)) | (3 << 1)) | (1 << 0), (( 5 << 4) | (1 << 2)) | (0 << 0), ( 0x7 << 4) | (0x0 << 0), 1 << 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ( 8 << 4) | (1 << 0), TRUE }, { 0x31, 0x58, 0x00, 0x00, 0x57, 0xf6, 0x85, 0X03, 0x55, ( 8 << 4) | (4 << 2), 1 << 1, ( 0x0 << 4) | (0xf << 0), 12 << 3, 0xe << 4, ( 1 << 5) | (6 << 0), ( 1 << 7) | (33 << 0), ((( 3 << 5) | (1 << 3)) | (3 << 1)) | (1 << 0), (( 5 << 4) | (1 << 2)) | (1 << 0), ( 0x7 << 4) | (0x0 << 0), 1 << 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ( 8 << 4) | (1 << 0), TRUE } }; static # 95 "c:/tinyos-1.x/tos/platform/mica2/hardware.h" void __inline TOSH_uwait(int u_sec); #line 110 static __inline void TOSH_SET_RED_LED_PIN(void); #line 110 static __inline void TOSH_CLR_RED_LED_PIN(void); #line 110 static __inline void TOSH_MAKE_RED_LED_OUTPUT(void); static __inline void TOSH_SET_GREEN_LED_PIN(void); #line 111 static __inline void TOSH_CLR_GREEN_LED_PIN(void); #line 111 static __inline void TOSH_MAKE_GREEN_LED_OUTPUT(void); static __inline void TOSH_SET_YELLOW_LED_PIN(void); #line 112 static __inline void TOSH_CLR_YELLOW_LED_PIN(void); #line 112 static __inline void TOSH_MAKE_YELLOW_LED_OUTPUT(void); static __inline void TOSH_MAKE_CC_CHP_OUT_INPUT(void); static __inline void TOSH_SET_CC_PDATA_PIN(void); #line 120 static __inline void TOSH_CLR_CC_PDATA_PIN(void); #line 120 static __inline int TOSH_READ_CC_PDATA_PIN(void); #line 120 static __inline void TOSH_MAKE_CC_PDATA_OUTPUT(void); #line 120 static __inline void TOSH_MAKE_CC_PDATA_INPUT(void); static __inline void TOSH_SET_CC_PCLK_PIN(void); #line 121 static __inline void TOSH_CLR_CC_PCLK_PIN(void); #line 121 static __inline void TOSH_MAKE_CC_PCLK_OUTPUT(void); static __inline void TOSH_SET_CC_PALE_PIN(void); #line 122 static __inline void TOSH_CLR_CC_PALE_PIN(void); #line 122 static __inline void TOSH_MAKE_CC_PALE_OUTPUT(void); static __inline void TOSH_SET_FLASH_SELECT_PIN(void); #line 125 static __inline void TOSH_MAKE_FLASH_SELECT_OUTPUT(void); static __inline void TOSH_MAKE_FLASH_CLK_OUTPUT(void); static __inline void TOSH_MAKE_FLASH_OUT_OUTPUT(void); static __inline void TOSH_MAKE_MOSI_OUTPUT(void); #line 137 static __inline void TOSH_MAKE_MOSI_INPUT(void); static __inline void TOSH_MAKE_MISO_OUTPUT(void); #line 138 static __inline void TOSH_MAKE_MISO_INPUT(void); static __inline void TOSH_MAKE_SPI_OC1C_INPUT(void); static __inline void TOSH_MAKE_SPI_SCK_INPUT(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 #line 165 void TOSH_SET_PIN_DIRECTIONS(void ); #line 206 enum __nesc_unnamed4248 { TOSH_ADC_PORTMAPSIZE = 12 }; enum __nesc_unnamed4249 { TOSH_ACTUAL_CC_RSSI_PORT = 0, TOSH_ACTUAL_VOLTAGE_PORT = 7, TOSH_ACTUAL_BANDGAP_PORT = 30, TOSH_ACTUAL_GND_PORT = 31 }; enum __nesc_unnamed4250 { TOS_ADC_CC_RSSI_PORT = 0, TOS_ADC_VOLTAGE_PORT = 7, TOS_ADC_BANDGAP_PORT = 10, TOS_ADC_GND_PORT = 11 }; # 85 "c:/tinyos-1.x/tos/system/dbg.h" typedef long long TOS_dbg_mode; # 80 "c:/tinyos-1.x/tos/system/dbg_modes.h" 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_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 }; # 89 "c:/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 }; TOSH_sched_entry_T TOSH_queue[TOSH_MAX_TASKS]; volatile uint8_t TOSH_sched_full; volatile uint8_t TOSH_sched_free; static inline void TOSH_interrupt_enable(void ); static inline bool TOSH_interrupt_disable(void ); static inline void TOSH_wait(void ); static inline void TOSH_sleep(void ); static inline void TOSH_sched_init(void ); #line 130 bool TOS_post(void (*tp)(void)); static inline #line 170 bool TOSH_run_next_task(void); static inline #line 189 void TOSH_run_task(void); # 69 "c:/tinyos-1.x/tos/lib/IntMsg.h" typedef struct IntMsg { char val; int src; } IntMsg; enum __nesc_unnamed4254 { AM_INTMSG = 4 }; # 71 "c:/tinyos-1.x/tos/system/AM.h" enum __nesc_unnamed4255 { TOS_BCAST_ADDR = 0xffff, TOS_UART_ADDR = 0x007e }; enum __nesc_unnamed4256 { TOS_DEFAULT_AM_GROUP = 60 }; uint8_t TOS_AM_GROUP = TOS_DEFAULT_AM_GROUP; #line 106 typedef 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; } TOS_Msg; 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 computeMACDone; bool validMAC; } __attribute((packed)) TinySec_Msg; enum __nesc_unnamed4257 { 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_LENGTH_BYTE_NUMBER = (size_t )& ((struct TinySec_Msg *)0)->length + 1, TINYSEC_END_OF_IV_BYTE_NUMBER = (size_t )& ((struct TinySec_Msg *)0)->iv + 4, TINYSEC_ENCRYPTED_DATA_BEGIN_BYTE_NUMBER = (size_t )& ((struct TinySec_Msg *)0)->enc + 1 }; typedef TOS_Msg *TOS_MsgPtr; static inline uint8_t TOS_MsgLength(uint8_t type); # 69 "c:/tinyos-1.x/tos/interfaces/Timer.h" enum __nesc_unnamed4258 { TIMER_REPEAT = 0, TIMER_ONE_SHOT = 1, NUM_TIMERS = 2 }; # 1 "c:/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); # 65 "c:/tinyos-1.x/tos/interfaces/ADC.h" enum __nesc_unnamed4259 { TOS_ADCSample3750ns = 0, TOS_ADCSample7500ns = 1, TOS_ADCSample15us = 2, TOS_ADCSample30us = 3, TOS_ADCSample60us = 4, TOS_ADCSample120us = 5, TOS_ADCSample240us = 6, TOS_ADCSample480us = 7 }; # 68 "c:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" enum __nesc_unnamed4260 { TOSH_ACTUAL_PHOTO_PORT = 1, TOSH_ACTUAL_TEMP_PORT = 1, TOSH_ACTUAL_MIC_PORT = 2, TOSH_ACTUAL_ACCEL_X_PORT = 3, TOSH_ACTUAL_ACCEL_Y_PORT = 4, TOSH_ACTUAL_MAG_X_PORT = 6, TOSH_ACTUAL_MAG_Y_PORT = 5 }; enum __nesc_unnamed4261 { TOS_ADC_PHOTO_PORT = 1, TOS_ADC_TEMP_PORT = 2, TOS_ADC_MIC_PORT = 3, TOS_ADC_ACCEL_X_PORT = 4, TOS_ADC_ACCEL_Y_PORT = 5, TOS_ADC_MAG_X_PORT = 6, TOS_ADC_MAG_Y_PORT = 8 }; enum __nesc_unnamed4262 { TOS_MAG_POT_ADDR = 0, TOS_MIC_POT_ADDR = 1 }; # 3 "c:/tinyos-1.x/tos/interfaces/TosTime.h" typedef struct __nesc_unnamed4263 { uint32_t high32; uint32_t low32; } tos_time_t; # 63 "c:/tinyos-1.x/tos/platform/mica128/Clock.h" enum __nesc_unnamed4264 { 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_unnamed4265 { DEFAULT_SCALE = 3, DEFAULT_INTERVAL = 127 }; # 2 "c:/tinyos-1.x/tos/interfaces/AbsoluteTimer.h" enum __nesc_unnamed4266 { MAX_NUM_TIMERS = 0 }; static result_t PotM$Pot$init(uint8_t arg_0xa2b0ad8); 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 bool HPLInterrupt$Interrupt$disable(void); static result_t HPLInterrupt$Interrupt$enable(void); static TOS_MsgPtr RfmToIntM$ReceiveIntMsg$receive(TOS_MsgPtr arg_0xa2e53e8); static result_t RfmToIntM$IntOutput$outputComplete(result_t arg_0xa2cf458); static result_t RfmToIntM$StdControl$init(void); static result_t RfmToIntM$StdControl$start(void); static TOS_MsgPtr AMStandard$ReceiveMsg$default$receive(uint8_t arg_0xa2ebdb8, TOS_MsgPtr arg_0xa2e53e8); static result_t AMStandard$ActivityTimer$fired(void); static result_t AMStandard$UARTSend$sendDone(TOS_MsgPtr arg_0xa2f3d48, result_t arg_0xa2f3e90); static TOS_MsgPtr AMStandard$RadioReceive$receive(TOS_MsgPtr arg_0xa2e53e8); static result_t AMStandard$Control$init(void); static result_t AMStandard$Control$start(void); static result_t AMStandard$default$sendDone(void); static result_t AMStandard$RadioSend$sendDone(TOS_MsgPtr arg_0xa2f3d48, result_t arg_0xa2f3e90); static result_t AMStandard$SendMsg$default$sendDone(uint8_t arg_0xa2eb820, TOS_MsgPtr arg_0xa2d9288, result_t arg_0xa2d93d0); static TOS_MsgPtr AMStandard$UARTReceive$receive(TOS_MsgPtr arg_0xa2e53e8); static result_t CC1000RadioIntM$SpiByteFifo$dataReady(uint8_t arg_0xa359958); static void CC1000RadioIntM$RadioReceiveCoordinator$default$byte(TOS_MsgPtr arg_0xa34c780, uint8_t arg_0xa34c8c8); static void CC1000RadioIntM$RadioReceiveCoordinator$default$startSymbol(void); static result_t CC1000RadioIntM$WakeupTimer$fired(void); static void CC1000RadioIntM$RadioSendCoordinator$default$byte(TOS_MsgPtr arg_0xa34c780, uint8_t arg_0xa34c8c8); static void CC1000RadioIntM$RadioSendCoordinator$default$startSymbol(void); static result_t CC1000RadioIntM$StdControl$init(void); static result_t CC1000RadioIntM$StdControl$start(void); static result_t CC1000RadioIntM$RSSIADC$dataReady(uint16_t arg_0xa374d98); static result_t CC1000ControlM$CC1000Control$Tune(uint8_t arg_0xa329078); static bool CC1000ControlM$CC1000Control$GetLOStatus(void); static result_t CC1000ControlM$CC1000Control$RxMode(void); static result_t CC1000ControlM$CC1000Control$BIASOn(void); static result_t CC1000ControlM$CC1000Control$TxMode(void); static result_t CC1000ControlM$CC1000Control$SelectLock(uint8_t arg_0xa32cd10); static result_t CC1000ControlM$StdControl$init(void); static result_t CC1000ControlM$StdControl$start(void); static result_t CC1000ControlM$StdControl$stop(void); static result_t HPLCC1000M$HPLCC1000$init(void); static uint8_t HPLCC1000M$HPLCC1000$read(uint8_t arg_0xa3d8700); static result_t HPLCC1000M$HPLCC1000$write(uint8_t arg_0xa3d8178, uint8_t arg_0xa3d82b8); static uint16_t RandomLFSR$Random$rand(void); static result_t RandomLFSR$Random$init(void); static result_t ADCM$HPLADC$dataReady(uint16_t arg_0xa4157f8); static result_t ADCM$ADCControl$bindPort(uint8_t arg_0xa352e60, uint8_t arg_0xa352fa0); static result_t ADCM$ADCControl$init(void); static result_t ADCM$ADC$getData(uint8_t arg_0xa3f69b8); static result_t ADCM$ADC$default$dataReady(uint8_t arg_0xa3f69b8, uint16_t arg_0xa374d98); static result_t HPLADCM$ADC$bindPort(uint8_t arg_0xa4146d8, uint8_t arg_0xa414818); static result_t HPLADCM$ADC$init(void); static result_t HPLADCM$ADC$samplePort(uint8_t arg_0xa414cf0); static result_t HPLSpiM$SpiByteFifo$initSlave(void); static result_t HPLSpiM$SpiByteFifo$disableIntr(void); static result_t HPLSpiM$SpiByteFifo$writeByte(uint8_t arg_0xa3581e8); static result_t HPLSpiM$SpiByteFifo$enableIntr(void); static result_t HPLSpiM$SpiByteFifo$txMode(void); static result_t HPLSpiM$SpiByteFifo$rxMode(void); static void HPLClock$Clock$setInterval(uint8_t arg_0xa456080); static uint8_t HPLClock$Clock$readCounter(void); static result_t HPLClock$Clock$setRate(char arg_0xa451578, char arg_0xa4516b0); static uint8_t HPLClock$Clock$getInterval(void); static result_t HPLClock$StdControl$init(void); static result_t HPLClock$StdControl$start(void); static result_t LogicalTimeM$AbsoluteTimer$default$fired(uint8_t arg_0xa46c4a8); static tos_time_t LogicalTimeM$Time$get(void); static result_t LogicalTimeM$Clock$fire(void); static result_t LogicalTimeM$StdControl$init(void); static result_t LogicalTimeM$StdControl$start(void); static result_t LogicalTimeM$Timer$default$fired(uint8_t arg_0xa46fe50); static result_t LogicalTimeM$Timer$start(uint8_t arg_0xa46fe50, char arg_0xa3091d8, uint32_t arg_0xa309328); static tos_time_t TimeUtilC$TimeUtil$addint32(tos_time_t arg_0xa437058, int32_t arg_0xa437198); static tos_time_t TimeUtilC$TimeUtil$addUint32(tos_time_t arg_0xa4376d8, uint32_t arg_0xa437820); static tos_time_t TimeUtilC$TimeUtil$subtract(tos_time_t arg_0xa444fc8, tos_time_t arg_0xa445110); static char TimeUtilC$TimeUtil$compare(tos_time_t arg_0xa444450, tos_time_t arg_0xa444598); static uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void); static result_t NoCRCPacket$SendVarLenPacket$default$sendDone(uint8_t *arg_0xa2db638, result_t arg_0xa2db780); static result_t NoCRCPacket$ByteComm$txDone(void); static result_t NoCRCPacket$ByteComm$txByteReady(bool arg_0xa4cf858); static result_t NoCRCPacket$ByteComm$rxByteReady(uint8_t arg_0xa4cf0a8, bool arg_0xa4cf1e8, uint16_t arg_0xa4cf338); static result_t NoCRCPacket$Control$init(void); static result_t NoCRCPacket$Control$start(void); static result_t UARTM$HPLUART$get(uint8_t arg_0xa4fd528); static result_t UARTM$HPLUART$putDone(void); static result_t UARTM$ByteComm$txByte(uint8_t arg_0xa4cec28); static result_t UARTM$Control$init(void); static result_t UARTM$Control$start(void); static result_t HPLUART0M$UART$init(void); static result_t HPLUART0M$UART$put(uint8_t arg_0xa4fd038); static result_t IntToLedsM$IntOutput$output(uint16_t arg_0xa2cefd8); static result_t IntToLedsM$StdControl$init(void); static result_t IntToLedsM$StdControl$start(void); static result_t LedsC$Leds$yellowOff(void); static result_t LedsC$Leds$yellowOn(void); static result_t LedsC$Leds$init(void); static result_t LedsC$Leds$greenOff(void); static result_t LedsC$Leds$redOff(void); static result_t LedsC$Leds$redOn(void); static result_t LedsC$Leds$greenOn(void); static # 70 "c:/tinyos-1.x/tos/system/RealMain.nc" result_t RealMain$hardwareInit(void); static # 105 "c:/tinyos-1.x/tos/interfaces/Pot.nc" result_t RealMain$Pot$init(uint8_t arg_0xa2b0ad8); static # 86 "c:/tinyos-1.x/tos/interfaces/Interrupt.nc" result_t RealMain$Interrupt$enable(void); static # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t RealMain$StdControl$init(void); static result_t RealMain$StdControl$start(void); # 78 "c:/tinyos-1.x/tos/system/RealMain.nc" int main(void); static # 101 "c:/tinyos-1.x/tos/interfaces/HPLPot.nc" result_t PotM$HPLPot$finalise(void); static #line 86 result_t PotM$HPLPot$decrease(void); static result_t PotM$HPLPot$increase(void); # 114 "c:/tinyos-1.x/tos/system/PotM.nc" uint8_t PotM$potSetting; static inline void PotM$setPot(uint8_t value); static inline #line 129 result_t PotM$Pot$init(uint8_t initialSetting); static inline # 80 "c:/tinyos-1.x/tos/platform/mica2/HPLPotC.nc" result_t HPLPotC$Pot$decrease(void); static inline result_t HPLPotC$Pot$increase(void); static inline result_t HPLPotC$Pot$finalise(void); static inline # 80 "c:/tinyos-1.x/tos/platform/avrmote/HPLInit.nc" result_t HPLInit$init(void); static inline # 79 "c:/tinyos-1.x/tos/platform/avrmote/HPLInterrupt.nc" result_t HPLInterrupt$Interrupt$enable(void); static inline bool HPLInterrupt$Interrupt$disable(void); static inline void TOSH_interrupt_enable(void); static inline bool TOSH_interrupt_disable(void); static # 82 "c:/tinyos-1.x/tos/interfaces/IntOutput.nc" result_t RfmToIntM$IntOutput$output(uint16_t arg_0xa2cefd8); static # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t RfmToIntM$CommControl$init(void); static result_t RfmToIntM$CommControl$start(void); static inline # 79 "c:/tinyos-1.x/tos/lib/RfmToIntM.nc" result_t RfmToIntM$StdControl$init(void); static inline result_t RfmToIntM$StdControl$start(void); static inline TOS_MsgPtr RfmToIntM$ReceiveIntMsg$receive(TOS_MsgPtr m); static inline result_t RfmToIntM$IntOutput$outputComplete(result_t success); static # 106 "c:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" TOS_MsgPtr AMStandard$ReceiveMsg$receive( # 79 "c:/tinyos-1.x/tos/system/AMStandard.nc" uint8_t arg_0xa2ebdb8, # 106 "c:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" TOS_MsgPtr arg_0xa2e53e8); static # 90 "c:/tinyos-1.x/tos/interfaces/Timer.nc" result_t AMStandard$ActivityTimer$start(char arg_0xa3091d8, uint32_t arg_0xa309328); static # 29 "c:/tinyos-1.x/tos/interfaces/PowerManagement.nc" uint8_t AMStandard$PowerManagement$adjustPower(void); static # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t AMStandard$RadioControl$init(void); static result_t AMStandard$RadioControl$start(void); static #line 52 result_t AMStandard$TimerControl$init(void); static result_t AMStandard$TimerControl$start(void); static #line 52 result_t AMStandard$UARTControl$init(void); static result_t AMStandard$UARTControl$start(void); static # 88 "c:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$sendDone(void); static # 73 "c:/tinyos-1.x/tos/interfaces/SendMsg.nc" result_t AMStandard$SendMsg$sendDone( # 78 "c:/tinyos-1.x/tos/system/AMStandard.nc" uint8_t arg_0xa2eb820, # 73 "c:/tinyos-1.x/tos/interfaces/SendMsg.nc" TOS_MsgPtr arg_0xa2d9288, result_t arg_0xa2d93d0); # 105 "c:/tinyos-1.x/tos/system/AMStandard.nc" bool AMStandard$state; uint16_t AMStandard$lastCount; uint16_t AMStandard$counter; static inline bool AMStandard$Control$init(void); static inline #line 126 bool AMStandard$Control$start(void); static inline #line 156 void AMStandard$dbgPacket(TOS_MsgPtr data); static result_t AMStandard$reportSendDone(TOS_MsgPtr msg, result_t success); static inline result_t AMStandard$ActivityTimer$fired(void); static inline result_t AMStandard$SendMsg$default$sendDone(uint8_t id, TOS_MsgPtr msg, result_t success); static inline result_t AMStandard$default$sendDone(void); static inline #line 245 result_t AMStandard$UARTSend$sendDone(TOS_MsgPtr msg, result_t success); static inline result_t AMStandard$RadioSend$sendDone(TOS_MsgPtr msg, result_t success); TOS_MsgPtr received(TOS_MsgPtr packet); static inline #line 282 TOS_MsgPtr AMStandard$ReceiveMsg$default$receive(uint8_t id, TOS_MsgPtr msg); static inline TOS_MsgPtr AMStandard$UARTReceive$receive(TOS_MsgPtr packet); static inline TOS_MsgPtr AMStandard$RadioReceive$receive(TOS_MsgPtr packet); static # 94 "c:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" result_t CC1000RadioIntM$Send$sendDone(TOS_MsgPtr arg_0xa2f3d48, result_t arg_0xa2f3e90); static # 86 "c:/tinyos-1.x/tos/interfaces/Random.nc" uint16_t CC1000RadioIntM$Random$rand(void); static #line 80 result_t CC1000RadioIntM$Random$init(void); static # 116 "c:/tinyos-1.x/tos/interfaces/ADCControl.nc" result_t CC1000RadioIntM$ADCControl$bindPort(uint8_t arg_0xa352e60, uint8_t arg_0xa352fa0); static #line 77 result_t CC1000RadioIntM$ADCControl$init(void); static # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t CC1000RadioIntM$TimerControl$init(void); static result_t CC1000RadioIntM$TimerControl$start(void); static #line 52 result_t CC1000RadioIntM$CC1000StdControl$init(void); static result_t CC1000RadioIntM$CC1000StdControl$start(void); static result_t CC1000RadioIntM$CC1000StdControl$stop(void); static # 106 "c:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" TOS_MsgPtr CC1000RadioIntM$Receive$receive(TOS_MsgPtr arg_0xa2e53e8); static # 68 "c:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" result_t CC1000RadioIntM$SpiByteFifo$initSlave(void); static #line 67 result_t CC1000RadioIntM$SpiByteFifo$disableIntr(void); static #line 63 result_t CC1000RadioIntM$SpiByteFifo$writeByte(uint8_t arg_0xa3581e8); static result_t CC1000RadioIntM$SpiByteFifo$enableIntr(void); static result_t CC1000RadioIntM$SpiByteFifo$txMode(void); static result_t CC1000RadioIntM$SpiByteFifo$rxMode(void); static # 32 "c:/tinyos-1.x/tos/interfaces/RadioCoordinator.nc" void CC1000RadioIntM$RadioReceiveCoordinator$byte(TOS_MsgPtr arg_0xa34c780, uint8_t arg_0xa34c8c8); static #line 29 void CC1000RadioIntM$RadioReceiveCoordinator$startSymbol(void); static # 90 "c:/tinyos-1.x/tos/interfaces/Timer.nc" result_t CC1000RadioIntM$WakeupTimer$start(char arg_0xa3091d8, uint32_t arg_0xa309328); static # 32 "c:/tinyos-1.x/tos/interfaces/RadioCoordinator.nc" void CC1000RadioIntM$RadioSendCoordinator$byte(TOS_MsgPtr arg_0xa34c780, uint8_t arg_0xa34c8c8); static #line 29 void CC1000RadioIntM$RadioSendCoordinator$startSymbol(void); static # 175 "c:/tinyos-1.x/tos/platform/mica2/CC1000Control.nc" bool CC1000RadioIntM$CC1000Control$GetLOStatus(void); static #line 101 result_t CC1000RadioIntM$CC1000Control$RxMode(void); static #line 122 result_t CC1000RadioIntM$CC1000Control$BIASOn(void); static #line 93 result_t CC1000RadioIntM$CC1000Control$TxMode(void); static #line 155 result_t CC1000RadioIntM$CC1000Control$SelectLock(uint8_t arg_0xa32cd10); static # 82 "c:/tinyos-1.x/tos/interfaces/ADC.nc" result_t CC1000RadioIntM$RSSIADC$getData(void); # 102 "c:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" enum CC1000RadioIntM$__nesc_unnamed4267 { CC1000RadioIntM$TX_STATE, CC1000RadioIntM$DISABLED_STATE, CC1000RadioIntM$IDLE_STATE, CC1000RadioIntM$PRETX_STATE, CC1000RadioIntM$SYNC_STATE, CC1000RadioIntM$RX_STATE, CC1000RadioIntM$POWER_DOWN_STATE }; enum CC1000RadioIntM$__nesc_unnamed4268 { CC1000RadioIntM$TXSTATE_WAIT, CC1000RadioIntM$TXSTATE_START, CC1000RadioIntM$TXSTATE_PREAMBLE, CC1000RadioIntM$TXSTATE_SYNC, CC1000RadioIntM$TXSTATE_DATA, CC1000RadioIntM$TXSTATE_CRC, CC1000RadioIntM$TXSTATE_FLUSH, CC1000RadioIntM$TXSTATE_DONE }; enum CC1000RadioIntM$__nesc_unnamed4269 { CC1000RadioIntM$SYNC_BYTE = 0x33, CC1000RadioIntM$NSYNC_BYTE = 0xcc, CC1000RadioIntM$SYNC_WORD = 0x33cc, CC1000RadioIntM$NSYNC_WORD = 0xcc33 }; uint8_t CC1000RadioIntM$RadioState; uint8_t CC1000RadioIntM$RadioTxState; uint16_t CC1000RadioIntM$txlength; uint16_t CC1000RadioIntM$rxlength; TOS_MsgPtr CC1000RadioIntM$txbufptr; TOS_MsgPtr CC1000RadioIntM$rxbufptr; TOS_Msg CC1000RadioIntM$RxBuf; uint8_t CC1000RadioIntM$NextTxByte; uint8_t CC1000RadioIntM$lplpower; uint8_t CC1000RadioIntM$lplpowertx; uint16_t CC1000RadioIntM$preamblelen; uint16_t CC1000RadioIntM$PreambleCount; uint8_t CC1000RadioIntM$SOFCount; union CC1000RadioIntM$__nesc_unnamed4270 { uint16_t W; struct { uint8_t LSB; uint8_t MSB; } ; } CC1000RadioIntM$RxShiftBuf; uint8_t CC1000RadioIntM$RxBitOffset; uint16_t CC1000RadioIntM$RxByteCnt; uint16_t CC1000RadioIntM$TxByteCnt; uint16_t CC1000RadioIntM$RSSISampleFreq; bool CC1000RadioIntM$bInvertRxData; bool CC1000RadioIntM$bTxPending; bool CC1000RadioIntM$bTxBusy; bool CC1000RadioIntM$bRSSIValid; uint16_t CC1000RadioIntM$usRunningCRC; uint16_t CC1000RadioIntM$usRSSIVal; uint16_t CC1000RadioIntM$usSquelchVal; int16_t CC1000RadioIntM$sMacDelay; volatile uint16_t CC1000RadioIntM$LocalAddr; static inline void CC1000RadioIntM$PacketRcvd(void); static inline #line 196 void CC1000RadioIntM$PacketSent(void); static inline #line 210 result_t CC1000RadioIntM$StdControl$init(void); static inline #line 346 result_t CC1000RadioIntM$WakeupTimer$fired(void); static inline #line 392 result_t CC1000RadioIntM$StdControl$start(void); static #line 472 result_t CC1000RadioIntM$SpiByteFifo$dataReady(uint8_t data_in); static inline #line 757 result_t CC1000RadioIntM$RSSIADC$dataReady(uint16_t data); static inline void CC1000RadioIntM$RadioSendCoordinator$default$startSymbol(void); static inline void CC1000RadioIntM$RadioSendCoordinator$default$byte(TOS_MsgPtr msg, uint8_t byteCount); static inline void CC1000RadioIntM$RadioReceiveCoordinator$default$startSymbol(void); static inline void CC1000RadioIntM$RadioReceiveCoordinator$default$byte(TOS_MsgPtr msg, uint8_t byteCount); static # 74 "c:/tinyos-1.x/tos/platform/mica2/HPLCC1000.nc" result_t CC1000ControlM$HPLChipcon$init(void); static #line 88 uint8_t CC1000ControlM$HPLChipcon$read(uint8_t arg_0xa3d8700); static #line 81 result_t CC1000ControlM$HPLChipcon$write(uint8_t arg_0xa3d8178, uint8_t arg_0xa3d82b8); # 82 "c:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" uint8_t CC1000ControlM$tunefreq; uint8_t CC1000ControlM$rfpower; uint8_t CC1000ControlM$LockVal; static inline #line 96 result_t CC1000ControlM$chipcon_cal(void); static inline #line 156 result_t CC1000ControlM$StdControl$init(void); static inline #line 178 result_t CC1000ControlM$CC1000Control$Tune(uint8_t freq); static inline #line 196 result_t CC1000ControlM$CC1000Control$TxMode(void); static #line 209 result_t CC1000ControlM$CC1000Control$RxMode(void); static inline #line 231 result_t CC1000ControlM$CC1000Control$BIASOn(void); static inline #line 243 result_t CC1000ControlM$StdControl$stop(void); static inline result_t CC1000ControlM$StdControl$start(void); static inline #line 278 result_t CC1000ControlM$CC1000Control$SelectLock(uint8_t Value); static inline bool CC1000ControlM$CC1000Control$GetLOStatus(void); static inline # 79 "c:/tinyos-1.x/tos/platform/mica2/HPLCC1000M.nc" result_t HPLCC1000M$HPLCC1000$init(void); static #line 103 result_t HPLCC1000M$HPLCC1000$write(uint8_t addr, uint8_t data); static #line 156 uint8_t HPLCC1000M$HPLCC1000$read(uint8_t addr); # 77 "c:/tinyos-1.x/tos/system/RandomLFSR.nc" uint16_t RandomLFSR$shiftReg; uint16_t RandomLFSR$initSeed; uint16_t RandomLFSR$mask; static inline result_t RandomLFSR$Random$init(void); static uint16_t RandomLFSR$Random$rand(void); static # 97 "c:/tinyos-1.x/tos/interfaces/HPLADC.nc" result_t ADCM$HPLADC$bindPort(uint8_t arg_0xa4146d8, uint8_t arg_0xa414818); static #line 81 result_t ADCM$HPLADC$init(void); static #line 104 result_t ADCM$HPLADC$samplePort(uint8_t arg_0xa414cf0); static # 100 "c:/tinyos-1.x/tos/interfaces/ADC.nc" result_t ADCM$ADC$dataReady( # 83 "c:/tinyos-1.x/tos/platform/mica2/ADCM.nc" uint8_t arg_0xa3f69b8, # 100 "c:/tinyos-1.x/tos/interfaces/ADC.nc" uint16_t arg_0xa374d98); # 92 "c:/tinyos-1.x/tos/platform/mica2/ADCM.nc" enum ADCM$__nesc_unnamed4271 { ADCM$IDLE = 0, ADCM$SINGLE_CONVERSION = 1, ADCM$CONTINUOUS_CONVERSION = 2 }; uint16_t ADCM$ReqPort; uint16_t ADCM$ReqVector; uint16_t ADCM$ContReqMask; static inline result_t ADCM$ADCControl$init(void); static inline #line 116 result_t ADCM$ADCControl$bindPort(uint8_t port, uint8_t adcPort); static inline result_t ADCM$ADC$default$dataReady(uint8_t port, uint16_t data); static inline result_t ADCM$HPLADC$dataReady(uint16_t data); static #line 164 result_t ADCM$startGet(uint8_t newState, uint8_t port); static inline #line 200 result_t ADCM$ADC$getData(uint8_t port); static # 126 "c:/tinyos-1.x/tos/interfaces/HPLADC.nc" result_t HPLADCM$ADC$dataReady(uint16_t arg_0xa4157f8); # 86 "c:/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" bool HPLADCM$init_portmap_done; uint8_t HPLADCM$TOSH_adc_portmap[TOSH_ADC_PORTMAPSIZE]; static void HPLADCM$init_portmap(void); static inline #line 118 result_t HPLADCM$ADC$init(void); static inline #line 138 result_t HPLADCM$ADC$bindPort(uint8_t port, uint8_t adcPort); static #line 150 result_t HPLADCM$ADC$samplePort(uint8_t port); #line 175 void __attribute((interrupt)) __vector_21(void); static # 29 "c:/tinyos-1.x/tos/interfaces/PowerManagement.nc" uint8_t HPLSpiM$PowerManagement$adjustPower(void); static # 72 "c:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" result_t HPLSpiM$SpiByteFifo$dataReady(uint8_t arg_0xa359958); # 75 "c:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" uint8_t HPLSpiM$OutgoingByte; void __attribute((signal)) __vector_17(void); static inline result_t HPLSpiM$SpiByteFifo$writeByte(uint8_t data); static inline #line 98 result_t HPLSpiM$SpiByteFifo$enableIntr(void); static result_t HPLSpiM$SpiByteFifo$disableIntr(void); static inline result_t HPLSpiM$SpiByteFifo$initSlave(void); static inline #line 127 result_t HPLSpiM$SpiByteFifo$txMode(void); static inline result_t HPLSpiM$SpiByteFifo$rxMode(void); static # 206 "c:/tinyos-1.x/tos/interfaces/Clock.nc" result_t HPLClock$Clock$fire(void); # 77 "c:/tinyos-1.x/tos/platform/mica/HPLClock.nc" uint8_t HPLClock$set_flag; uint8_t HPLClock$mscale; #line 78 uint8_t HPLClock$nextScale; #line 78 uint8_t HPLClock$minterval; static inline result_t HPLClock$StdControl$init(void); static inline result_t HPLClock$StdControl$start(void); static inline #line 110 void HPLClock$Clock$setInterval(uint8_t value); static inline uint8_t HPLClock$Clock$getInterval(void); static inline #line 157 uint8_t HPLClock$Clock$readCounter(void); static #line 172 result_t HPLClock$Clock$setRate(char interval, char scale); #line 190 void __attribute((interrupt)) __vector_15(void); static # 66 "c:/tinyos-1.x/tos/interfaces/AbsoluteTimer.nc" result_t LogicalTimeM$AbsoluteTimer$fired( # 56 "c:/tinyos-1.x/tos/system/LogicalTimeM.nc" uint8_t arg_0xa46c4a8); static # 59 "c:/tinyos-1.x/tos/interfaces/TimeUtil.nc" tos_time_t LogicalTimeM$TimeUtil$addint32(tos_time_t arg_0xa437058, int32_t arg_0xa437198); static tos_time_t LogicalTimeM$TimeUtil$addUint32(tos_time_t arg_0xa4376d8, uint32_t arg_0xa437820); static #line 97 tos_time_t LogicalTimeM$TimeUtil$subtract(tos_time_t arg_0xa444fc8, tos_time_t arg_0xa445110); static #line 87 char LogicalTimeM$TimeUtil$compare(tos_time_t arg_0xa444450, tos_time_t arg_0xa444598); static # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t LogicalTimeM$ClockControl$init(void); static result_t LogicalTimeM$ClockControl$start(void); static # 131 "c:/tinyos-1.x/tos/interfaces/Clock.nc" void LogicalTimeM$Clock$setInterval(uint8_t arg_0xa456080); static #line 179 uint8_t LogicalTimeM$Clock$readCounter(void); static #line 147 uint8_t LogicalTimeM$Clock$getInterval(void); static # 104 "c:/tinyos-1.x/tos/interfaces/Timer.nc" result_t LogicalTimeM$Timer$fired( # 55 "c:/tinyos-1.x/tos/system/LogicalTimeM.nc" uint8_t arg_0xa46fe50); #line 69 tos_time_t LogicalTimeM$time; int16_t LogicalTimeM$adjustment; uint32_t LogicalTimeM$mState; uint8_t LogicalTimeM$setIntervalFlag; struct LogicalTimeM$timer_s { uint8_t type; int32_t ticks; int32_t ticksLeft; } LogicalTimeM$mTimerList[NUM_TIMERS + 1]; uint8_t LogicalTimeM$useBit; int8_t LogicalTimeM$baseTimerIndex; tos_time_t LogicalTimeM$aTimer[MAX_NUM_TIMERS]; static inline void LogicalTimeM$selectBaseTimer(void); static inline void LogicalTimeM$resetBaseTimer(void); static result_t LogicalTimeM$StdControl$init(void); static inline #line 106 result_t LogicalTimeM$StdControl$start(void); static inline #line 131 tos_time_t LogicalTimeM$Time$get(void); static inline #line 181 void LogicalTimeM$resetBaseTimer(void); static inline #line 246 void LogicalTimeM$selectBaseTimer(void); static inline #line 267 result_t LogicalTimeM$AbsoluteTimer$default$fired(uint8_t id); static inline void LogicalTimeM$timeout(void); #line 295 static void LogicalTimeM$adjustInterval(void); static #line 336 result_t LogicalTimeM$Timer$start(uint8_t id, char type, uint32_t interval); static inline #line 363 result_t LogicalTimeM$Timer$default$fired(uint8_t id); static inline void LogicalTimeM$timerHandlingTask(void); static inline #line 416 result_t LogicalTimeM$Clock$fire(void); static # 54 "c:/tinyos-1.x/tos/system/TimeUtilC.nc" char TimeUtilC$TimeUtil$compare(tos_time_t a, tos_time_t b); static inline tos_time_t TimeUtilC$TimeUtil$subtract(tos_time_t a, tos_time_t b); static inline #line 89 tos_time_t TimeUtilC$TimeUtil$addint32(tos_time_t a, int32_t ms); static tos_time_t TimeUtilC$TimeUtil$addUint32(tos_time_t a, uint32_t ms); # 37 "c:/tinyos-1.x/tos/platform/mica2/HPLPowerManagementM.nc" bool HPLPowerManagementM$disabled = TRUE; enum HPLPowerManagementM$__nesc_unnamed4272 { HPLPowerManagementM$IDLE = 0, HPLPowerManagementM$ADC_NR = 1 << 3, HPLPowerManagementM$POWER_DOWN = 1 << 4, HPLPowerManagementM$POWER_SAVE = (1 << 3) + (1 << 4), HPLPowerManagementM$STANDBY = (1 << 2) + (1 << 4), HPLPowerManagementM$EXT_STANDBY = (1 << 3) + (1 << 4) + (1 << 2) }; static inline uint8_t HPLPowerManagementM$getPowerLevel(void); static inline #line 70 void HPLPowerManagementM$doAdjustment(void); static #line 87 uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void); static # 94 "c:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" result_t NoCRCPacket$Send$sendDone(TOS_MsgPtr arg_0xa2f3d48, result_t arg_0xa2f3e90); static # 89 "c:/tinyos-1.x/tos/interfaces/SendVarLenPacket.nc" result_t NoCRCPacket$SendVarLenPacket$sendDone(uint8_t *arg_0xa2db638, result_t arg_0xa2db780); static # 106 "c:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" TOS_MsgPtr NoCRCPacket$Receive$receive(TOS_MsgPtr arg_0xa2e53e8); static # 82 "c:/tinyos-1.x/tos/interfaces/ByteComm.nc" result_t NoCRCPacket$ByteComm$txByte(uint8_t arg_0xa4cec28); static # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t NoCRCPacket$ByteControl$init(void); static result_t NoCRCPacket$ByteControl$start(void); # 89 "c:/tinyos-1.x/tos/system/NoCRCPacket.nc" uint8_t NoCRCPacket$rxCount; #line 89 uint8_t NoCRCPacket$rxLength; #line 89 uint8_t NoCRCPacket$txCount; #line 89 uint8_t NoCRCPacket$txLength; TOS_Msg NoCRCPacket$buffers[2]; TOS_Msg *NoCRCPacket$bufferPtrs[2]; uint8_t NoCRCPacket$bufferIndex; uint8_t *NoCRCPacket$recPtr; uint8_t *NoCRCPacket$sendPtr; enum NoCRCPacket$__nesc_unnamed4273 { NoCRCPacket$IDLE, NoCRCPacket$PACKET, NoCRCPacket$BYTES }; uint8_t NoCRCPacket$state; static inline #line 116 result_t NoCRCPacket$Control$init(void); static inline #line 133 result_t NoCRCPacket$Control$start(void); static inline #line 212 void NoCRCPacket$sendDoneFailTask(void); static inline void NoCRCPacket$sendDoneSuccessTask(void); static inline void NoCRCPacket$sendVarLenFailTask(void); static inline void NoCRCPacket$sendVarLenSuccessTask(void); static void NoCRCPacket$sendComplete(result_t success); static inline #line 293 result_t NoCRCPacket$SendVarLenPacket$default$sendDone(uint8_t *packet, result_t success); static inline result_t NoCRCPacket$ByteComm$txByteReady(bool success); static inline #line 331 result_t NoCRCPacket$ByteComm$txDone(void); static inline void NoCRCPacket$receiveTask(void); static #line 357 result_t NoCRCPacket$ByteComm$rxByteReady(uint8_t data, bool error, uint16_t strength); static # 89 "c:/tinyos-1.x/tos/interfaces/HPLUART.nc" result_t UARTM$HPLUART$init(void); static #line 107 result_t UARTM$HPLUART$put(uint8_t arg_0xa4fd038); static # 110 "c:/tinyos-1.x/tos/interfaces/ByteComm.nc" result_t UARTM$ByteComm$txDone(void); static #line 102 result_t UARTM$ByteComm$txByteReady(bool arg_0xa4cf858); static #line 93 result_t UARTM$ByteComm$rxByteReady(uint8_t arg_0xa4cf0a8, bool arg_0xa4cf1e8, uint16_t arg_0xa4cf338); # 81 "c:/tinyos-1.x/tos/system/UARTM.nc" bool UARTM$state; static inline result_t UARTM$Control$init(void); static inline result_t UARTM$Control$start(void); static inline result_t UARTM$HPLUART$get(uint8_t data); static result_t UARTM$HPLUART$putDone(void); static inline #line 133 result_t UARTM$ByteComm$txByte(uint8_t data); static # 115 "c:/tinyos-1.x/tos/interfaces/HPLUART.nc" result_t HPLUART0M$UART$get(uint8_t arg_0xa4fd528); static result_t HPLUART0M$UART$putDone(void); static # 86 "c:/tinyos-1.x/tos/interfaces/Interrupt.nc" result_t HPLUART0M$Interrupt$enable(void); static # 81 "c:/tinyos-1.x/tos/platform/mica2/HPLUART0M.nc" result_t HPLUART0M$UART$init(void); #line 111 void __attribute((signal)) __vector_18(void); void __attribute((interrupt)) __vector_20(void); static inline result_t HPLUART0M$UART$put(uint8_t data); static # 91 "c:/tinyos-1.x/tos/interfaces/IntOutput.nc" result_t IntToLedsM$IntOutput$outputComplete(result_t arg_0xa2cf458); static # 149 "c:/tinyos-1.x/tos/interfaces/Leds.nc" result_t IntToLedsM$Leds$yellowOff(void); static #line 141 result_t IntToLedsM$Leds$yellowOn(void); static #line 83 result_t IntToLedsM$Leds$init(void); static #line 124 result_t IntToLedsM$Leds$greenOff(void); static #line 99 result_t IntToLedsM$Leds$redOff(void); static #line 91 result_t IntToLedsM$Leds$redOn(void); static #line 116 result_t IntToLedsM$Leds$greenOn(void); static inline # 75 "c:/tinyos-1.x/tos/lib/IntToLedsM.nc" result_t IntToLedsM$StdControl$init(void); static inline result_t IntToLedsM$StdControl$start(void); static inline void IntToLedsM$outputDone(void); static inline result_t IntToLedsM$IntOutput$output(uint16_t value); # 73 "c:/tinyos-1.x/tos/system/LedsC.nc" uint8_t LedsC$ledsOn; enum LedsC$__nesc_unnamed4274 { LedsC$RED_BIT = 1, LedsC$GREEN_BIT = 2, LedsC$YELLOW_BIT = 4 }; static inline result_t LedsC$Leds$init(void); static inline result_t LedsC$Leds$redOn(void); static inline result_t LedsC$Leds$redOff(void); static inline #line 121 result_t LedsC$Leds$greenOn(void); static inline result_t LedsC$Leds$greenOff(void); static inline #line 150 result_t LedsC$Leds$yellowOn(void); static inline result_t LedsC$Leds$yellowOff(void); # 176 "c:/tinyos-1.x/tos/platform/avrmote/avrhardware.h" __inline __nesc_atomic_t __nesc_atomic_start(void ) { __nesc_atomic_t result = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x3F + 0x20); #line 179 __asm volatile ("cli"); return result; } __inline void __nesc_atomic_end(__nesc_atomic_t oldSreg) { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x3F + 0x20) = oldSreg; } static inline # 84 "c:/tinyos-1.x/tos/platform/avrmote/HPLInterrupt.nc" bool HPLInterrupt$Interrupt$disable(void) #line 84 { bool result = (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x3F + 0x20) & 0x80) != 0; #line 86 __asm volatile ("cli"); return result; } static inline bool TOSH_interrupt_disable(void) #line 94 { return HPLInterrupt$Interrupt$disable(); } static inline #line 79 result_t HPLInterrupt$Interrupt$enable(void) #line 79 { __asm volatile ("sei"); return SUCCESS; } static inline void TOSH_interrupt_enable(void) #line 90 { HPLInterrupt$Interrupt$enable(); } # 111 "c:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_GREEN_LED_PIN(void) #line 111 { #line 111 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 1; } #line 112 static __inline void TOSH_SET_YELLOW_LED_PIN(void) #line 112 { #line 112 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 0; } #line 110 static __inline void TOSH_SET_RED_LED_PIN(void) #line 110 { #line 110 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 2; } #line 125 static __inline void TOSH_SET_FLASH_SELECT_PIN(void) #line 125 { #line 125 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 3; } #line 126 static __inline void TOSH_MAKE_FLASH_CLK_OUTPUT(void) #line 126 { #line 126 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 5; } #line 127 static __inline void TOSH_MAKE_FLASH_OUT_OUTPUT(void) #line 127 { #line 127 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 3; } #line 125 static __inline void TOSH_MAKE_FLASH_SELECT_OUTPUT(void) #line 125 { #line 125 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 3; } #line 139 static __inline void TOSH_MAKE_SPI_OC1C_INPUT(void) #line 139 { #line 139 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 7); } #line 138 static __inline void TOSH_MAKE_MISO_INPUT(void) #line 138 { #line 138 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 3); } #line 121 static __inline void TOSH_MAKE_CC_PCLK_OUTPUT(void) #line 121 { #line 121 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 6; } #line 120 static __inline void TOSH_MAKE_CC_PDATA_OUTPUT(void) #line 120 { #line 120 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 7; } #line 122 static __inline void TOSH_MAKE_CC_PALE_OUTPUT(void) #line 122 { #line 122 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 4; } #line 143 static __inline void TOSH_MAKE_PW0_OUTPUT(void) #line 143 { #line 143 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 0; } #line 144 static __inline void TOSH_MAKE_PW1_OUTPUT(void) #line 144 { #line 144 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 1; } #line 145 static __inline void TOSH_MAKE_PW2_OUTPUT(void) #line 145 { #line 145 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 2; } #line 146 static __inline void TOSH_MAKE_PW3_OUTPUT(void) #line 146 { #line 146 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 3; } #line 147 static __inline void TOSH_MAKE_PW4_OUTPUT(void) #line 147 { #line 147 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 4; } #line 148 static __inline void TOSH_MAKE_PW5_OUTPUT(void) #line 148 { #line 148 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 5; } #line 149 static __inline void TOSH_MAKE_PW6_OUTPUT(void) #line 149 { #line 149 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 6; } #line 150 static __inline void TOSH_MAKE_PW7_OUTPUT(void) #line 150 { #line 150 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 7; } #line 119 static __inline void TOSH_MAKE_CC_CHP_OUT_INPUT(void) #line 119 { #line 119 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) &= ~(1 << 6); } #line 111 static __inline void TOSH_MAKE_GREEN_LED_OUTPUT(void) #line 111 { #line 111 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 1; } #line 112 static __inline void TOSH_MAKE_YELLOW_LED_OUTPUT(void) #line 112 { #line 112 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 0; } #line 110 static __inline void TOSH_MAKE_RED_LED_OUTPUT(void) #line 110 { #line 110 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 2; } static inline #line 165 void TOSH_SET_PIN_DIRECTIONS(void ) { TOSH_MAKE_RED_LED_OUTPUT(); TOSH_MAKE_YELLOW_LED_OUTPUT(); TOSH_MAKE_GREEN_LED_OUTPUT(); 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_FLASH_SELECT_OUTPUT(); TOSH_MAKE_FLASH_OUT_OUTPUT(); TOSH_MAKE_FLASH_CLK_OUTPUT(); TOSH_SET_FLASH_SELECT_PIN(); TOSH_SET_RED_LED_PIN(); TOSH_SET_YELLOW_LED_PIN(); TOSH_SET_GREEN_LED_PIN(); } static inline # 80 "c:/tinyos-1.x/tos/platform/avrmote/HPLInit.nc" result_t HPLInit$init(void) #line 80 { TOSH_SET_PIN_DIRECTIONS(); return SUCCESS; } # 70 "c:/tinyos-1.x/tos/system/RealMain.nc" inline static result_t RealMain$hardwareInit(void){ #line 70 unsigned char result; #line 70 #line 70 result = HPLInit$init(); #line 70 #line 70 return result; #line 70 } #line 70 static inline # 98 "c:/tinyos-1.x/tos/platform/mica2/HPLPotC.nc" result_t HPLPotC$Pot$finalise(void) #line 98 { return SUCCESS; } # 101 "c:/tinyos-1.x/tos/interfaces/HPLPot.nc" inline static result_t PotM$HPLPot$finalise(void){ #line 101 unsigned char result; #line 101 #line 101 result = HPLPotC$Pot$finalise(); #line 101 #line 101 return result; #line 101 } #line 101 static inline # 89 "c:/tinyos-1.x/tos/platform/mica2/HPLPotC.nc" result_t HPLPotC$Pot$increase(void) #line 89 { return SUCCESS; } # 94 "c:/tinyos-1.x/tos/interfaces/HPLPot.nc" inline static result_t PotM$HPLPot$increase(void){ #line 94 unsigned char result; #line 94 #line 94 result = HPLPotC$Pot$increase(); #line 94 #line 94 return result; #line 94 } #line 94 static inline # 80 "c:/tinyos-1.x/tos/platform/mica2/HPLPotC.nc" result_t HPLPotC$Pot$decrease(void) #line 80 { return SUCCESS; } # 86 "c:/tinyos-1.x/tos/interfaces/HPLPot.nc" inline static result_t PotM$HPLPot$decrease(void){ #line 86 unsigned char result; #line 86 #line 86 result = HPLPotC$Pot$decrease(); #line 86 #line 86 return result; #line 86 } #line 86 static inline # 116 "c:/tinyos-1.x/tos/system/PotM.nc" void PotM$setPot(uint8_t value) #line 116 { uint8_t i; #line 118 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 129 { PotM$setPot(initialSetting); return SUCCESS; } # 105 "c:/tinyos-1.x/tos/interfaces/Pot.nc" inline static result_t RealMain$Pot$init(uint8_t arg_0xa2b0ad8){ #line 105 unsigned char result; #line 105 #line 105 result = PotM$Pot$init(arg_0xa2b0ad8); #line 105 #line 105 return result; #line 105 } #line 105 static inline # 108 "c:/tinyos-1.x/tos/system/sched.c" void TOSH_sched_init(void ) { TOSH_sched_free = 0; TOSH_sched_full = 0; } static inline # 113 "c:/tinyos-1.x/tos/system/tos.h" result_t rcombine(result_t r1, result_t r2) { return r1 == FAIL ? FAIL : r2; } # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t CC1000RadioIntM$TimerControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = LogicalTimeM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 82 "c:/tinyos-1.x/tos/system/RandomLFSR.nc" result_t RandomLFSR$Random$init(void) #line 82 { { } #line 83 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 84 { RandomLFSR$shiftReg = 119 * 119 * (TOS_LOCAL_ADDRESS + 1); RandomLFSR$initSeed = RandomLFSR$shiftReg; RandomLFSR$mask = 137 * 29 * (TOS_LOCAL_ADDRESS + 1); } #line 88 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 80 "c:/tinyos-1.x/tos/interfaces/Random.nc" inline static result_t CC1000RadioIntM$Random$init(void){ #line 80 unsigned char result; #line 80 #line 80 result = RandomLFSR$Random$init(); #line 80 #line 80 return result; #line 80 } #line 80 static inline # 118 "c:/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" result_t HPLADCM$ADC$init(void) #line 118 { HPLADCM$init_portmap(); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 123 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) = ((1 << 7) | (1 << 3)) | (6 << 0); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x07 + 0x20) = 0; } #line 127 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 81 "c:/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t ADCM$HPLADC$init(void){ #line 81 unsigned char result; #line 81 #line 81 result = HPLADCM$ADC$init(); #line 81 #line 81 return result; #line 81 } #line 81 static inline # 102 "c:/tinyos-1.x/tos/platform/mica2/ADCM.nc" result_t ADCM$ADCControl$init(void) #line 102 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 103 { ADCM$ReqPort = 0; ADCM$ReqVector = ADCM$ContReqMask = 0; } #line 106 __nesc_atomic_end(__nesc_atomic); } { } #line 107 ; return ADCM$HPLADC$init(); } # 77 "c:/tinyos-1.x/tos/interfaces/ADCControl.nc" inline static result_t CC1000RadioIntM$ADCControl$init(void){ #line 77 unsigned char result; #line 77 #line 77 result = ADCM$ADCControl$init(); #line 77 #line 77 return result; #line 77 } #line 77 static inline # 138 "c:/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" result_t HPLADCM$ADC$bindPort(uint8_t port, uint8_t adcPort) #line 138 { if ( #line 139 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 143 HPLADCM$TOSH_adc_portmap[port] = adcPort; #line 143 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } else { return FAIL; } } # 97 "c:/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t ADCM$HPLADC$bindPort(uint8_t arg_0xa4146d8, uint8_t arg_0xa414818){ #line 97 unsigned char result; #line 97 #line 97 result = HPLADCM$ADC$bindPort(arg_0xa4146d8, arg_0xa414818); #line 97 #line 97 return result; #line 97 } #line 97 static inline # 116 "c:/tinyos-1.x/tos/platform/mica2/ADCM.nc" result_t ADCM$ADCControl$bindPort(uint8_t port, uint8_t adcPort) #line 116 { return ADCM$HPLADC$bindPort(port, adcPort); } # 116 "c:/tinyos-1.x/tos/interfaces/ADCControl.nc" inline static result_t CC1000RadioIntM$ADCControl$bindPort(uint8_t arg_0xa352e60, uint8_t arg_0xa352fa0){ #line 116 unsigned char result; #line 116 #line 116 result = ADCM$ADCControl$bindPort(arg_0xa352e60, arg_0xa352fa0); #line 116 #line 116 return result; #line 116 } #line 116 static inline # 289 "c:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" bool CC1000ControlM$CC1000Control$GetLOStatus(void) #line 289 { return ({ #line 291 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[CC1000ControlM$tunefreq][0x1e]; #line 291 unsigned char __result; #line 291 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); } # 175 "c:/tinyos-1.x/tos/platform/mica2/CC1000Control.nc" inline static bool CC1000RadioIntM$CC1000Control$GetLOStatus(void){ #line 175 unsigned char result; #line 175 #line 175 result = CC1000ControlM$CC1000Control$GetLOStatus(); #line 175 #line 175 return result; #line 175 } #line 175 # 81 "c:/tinyos-1.x/tos/platform/mica2/HPLCC1000.nc" inline static result_t CC1000ControlM$HPLChipcon$write(uint8_t arg_0xa3d8178, uint8_t arg_0xa3d82b8){ #line 81 unsigned char result; #line 81 #line 81 result = HPLCC1000M$HPLCC1000$write(arg_0xa3d8178, arg_0xa3d82b8); #line 81 #line 81 return result; #line 81 } #line 81 static inline # 278 "c:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$CC1000Control$SelectLock(uint8_t Value) #line 278 { CC1000ControlM$LockVal = Value; return CC1000ControlM$HPLChipcon$write(0x0D, CC1000ControlM$LockVal << 4); } # 155 "c:/tinyos-1.x/tos/platform/mica2/CC1000Control.nc" inline static result_t CC1000RadioIntM$CC1000Control$SelectLock(uint8_t arg_0xa32cd10){ #line 155 unsigned char result; #line 155 #line 155 result = CC1000ControlM$CC1000Control$SelectLock(arg_0xa32cd10); #line 155 #line 155 return result; #line 155 } #line 155 # 88 "c:/tinyos-1.x/tos/platform/mica2/HPLCC1000.nc" inline static uint8_t CC1000ControlM$HPLChipcon$read(uint8_t arg_0xa3d8700){ #line 88 unsigned char result; #line 88 #line 88 result = HPLCC1000M$HPLCC1000$read(arg_0xa3d8700); #line 88 #line 88 return result; #line 88 } #line 88 static inline # 96 "c:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$chipcon_cal(void) { int freq = CC1000ControlM$tunefreq; 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, ({ #line 129 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[freq][29]; #line 129 unsigned char __result; #line 129 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )); #line 130 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 #line 178 result_t CC1000ControlM$CC1000Control$Tune(uint8_t freq) #line 178 { int i; #line 180 CC1000ControlM$tunefreq = freq; CC1000ControlM$rfpower = ({ #line 181 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[freq][0xb]; #line 181 unsigned char __result; #line 181 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); #line 182 CC1000ControlM$LockVal = ({ #line 182 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[freq][0xd]; #line 182 unsigned char __result; #line 182 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); #line 184 for (i = 1; i < 0x14; i++) CC1000ControlM$HPLChipcon$write(i, ({ #line 185 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[freq][i]; #line 185 unsigned char __result; #line 185 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )); #line 187 CC1000ControlM$HPLChipcon$write(0x1C, ({ #line 187 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[freq][0x1c]; #line 187 unsigned char __result; #line 187 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )); #line 189 CC1000ControlM$chipcon_cal(); return SUCCESS; } static # 95 "c:/tinyos-1.x/tos/platform/mica2/hardware.h" void __inline TOSH_uwait(int u_sec) #line 95 { 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 121 static __inline void TOSH_SET_CC_PCLK_PIN(void) #line 121 { #line 121 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) |= 1 << 6; } #line 120 static __inline void TOSH_SET_CC_PDATA_PIN(void) #line 120 { #line 120 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) |= 1 << 7; } #line 122 static __inline void TOSH_SET_CC_PALE_PIN(void) #line 122 { #line 122 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) |= 1 << 4; } static inline # 79 "c:/tinyos-1.x/tos/platform/mica2/HPLCC1000M.nc" result_t HPLCC1000M$HPLCC1000$init(void) #line 79 { 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; } # 74 "c:/tinyos-1.x/tos/platform/mica2/HPLCC1000.nc" inline static result_t CC1000ControlM$HPLChipcon$init(void){ #line 74 unsigned char result; #line 74 #line 74 result = HPLCC1000M$HPLCC1000$init(); #line 74 #line 74 return result; #line 74 } #line 74 static inline # 156 "c:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$StdControl$init(void) #line 156 { 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$CC1000Control$Tune(0x00); return SUCCESS; } # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t CC1000RadioIntM$CC1000StdControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = CC1000ControlM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 # 137 "c:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_MOSI_INPUT(void) #line 137 { #line 137 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 2); } static __inline void TOSH_MAKE_SPI_SCK_INPUT(void) #line 140 { #line 140 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 1); } static inline # 114 "c:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" result_t HPLSpiM$SpiByteFifo$initSlave(void) #line 114 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 115 { 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 123 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 68 "c:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t CC1000RadioIntM$SpiByteFifo$initSlave(void){ #line 68 unsigned char result; #line 68 #line 68 result = HPLSpiM$SpiByteFifo$initSlave(); #line 68 #line 68 return result; #line 68 } #line 68 static inline # 210 "c:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" result_t CC1000RadioIntM$StdControl$init(void) #line 210 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 212 { CC1000RadioIntM$RadioState = CC1000RadioIntM$DISABLED_STATE; CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_PREAMBLE; CC1000RadioIntM$rxbufptr = &CC1000RadioIntM$RxBuf; CC1000RadioIntM$rxlength = MSG_DATA_SIZE - 2; CC1000RadioIntM$RxBitOffset = 0; CC1000RadioIntM$PreambleCount = 0; CC1000RadioIntM$RSSISampleFreq = 0; CC1000RadioIntM$RxShiftBuf.W = 0; CC1000RadioIntM$bTxPending = FALSE; CC1000RadioIntM$bTxBusy = FALSE; CC1000RadioIntM$bRSSIValid = FALSE; CC1000RadioIntM$sMacDelay = -1; CC1000RadioIntM$usRSSIVal = -1; CC1000RadioIntM$lplpower = CC1000RadioIntM$lplpowertx = 0; CC1000RadioIntM$usSquelchVal = ({ #line 228 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SquelchInit[CC1000RadioIntM$lplpower]; #line 228 unsigned char __result; #line 228 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); } #line 231 __nesc_atomic_end(__nesc_atomic); } #line 231 CC1000RadioIntM$SpiByteFifo$initSlave(); CC1000RadioIntM$CC1000StdControl$init(); CC1000RadioIntM$CC1000Control$SelectLock(0x9); CC1000RadioIntM$bInvertRxData = CC1000RadioIntM$CC1000Control$GetLOStatus(); CC1000RadioIntM$ADCControl$bindPort(TOS_ADC_CC_RSSI_PORT, TOSH_ACTUAL_CC_RSSI_PORT); CC1000RadioIntM$ADCControl$init(); CC1000RadioIntM$Random$init(); CC1000RadioIntM$TimerControl$init(); CC1000RadioIntM$LocalAddr = TOS_LOCAL_ADDRESS; return SUCCESS; } # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AMStandard$RadioControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = CC1000RadioIntM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 # 89 "c:/tinyos-1.x/tos/interfaces/HPLUART.nc" inline static result_t UARTM$HPLUART$init(void){ #line 89 unsigned char result; #line 89 #line 89 result = HPLUART0M$UART$init(); #line 89 #line 89 return result; #line 89 } #line 89 static inline # 83 "c:/tinyos-1.x/tos/system/UARTM.nc" result_t UARTM$Control$init(void) #line 83 { { } #line 84 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 85 { UARTM$state = FALSE; } #line 87 __nesc_atomic_end(__nesc_atomic); } return UARTM$HPLUART$init(); } # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t NoCRCPacket$ByteControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = UARTM$Control$init(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 116 "c:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$Control$init(void) #line 116 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 117 { NoCRCPacket$recPtr = (uint8_t *)&NoCRCPacket$buffers[0]; NoCRCPacket$bufferIndex = 0; NoCRCPacket$bufferPtrs[0] = &NoCRCPacket$buffers[0]; NoCRCPacket$bufferPtrs[1] = &NoCRCPacket$buffers[1]; NoCRCPacket$state = NoCRCPacket$IDLE; NoCRCPacket$txCount = NoCRCPacket$rxCount = 0; NoCRCPacket$rxLength = (size_t )& ((TOS_Msg *)0)->type + 1; { } #line 127 ; } #line 128 __nesc_atomic_end(__nesc_atomic); } return NoCRCPacket$ByteControl$init(); } # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AMStandard$UARTControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = NoCRCPacket$Control$init(); #line 52 #line 52 return result; #line 52 } #line 52 inline static result_t AMStandard$TimerControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = LogicalTimeM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 111 "c:/tinyos-1.x/tos/system/AMStandard.nc" bool AMStandard$Control$init(void) #line 111 { result_t ok1; #line 112 result_t ok2; #line 113 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 113 { AMStandard$TimerControl$init(); ok1 = AMStandard$UARTControl$init(); ok2 = AMStandard$RadioControl$init(); AMStandard$state = FALSE; AMStandard$lastCount = 0; AMStandard$counter = 0; { } #line 120 ; } #line 121 __nesc_atomic_end(__nesc_atomic); } return rcombine(ok1, ok2); } # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t RfmToIntM$CommControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = AMStandard$Control$init(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 79 "c:/tinyos-1.x/tos/lib/RfmToIntM.nc" result_t RfmToIntM$StdControl$init(void) #line 79 { return RfmToIntM$CommControl$init(); } static inline # 130 "c:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$greenOff(void) #line 130 { { } #line 131 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 132 { TOSH_SET_GREEN_LED_PIN(); LedsC$ledsOn &= ~LedsC$GREEN_BIT; } #line 135 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 124 "c:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t IntToLedsM$Leds$greenOff(void){ #line 124 unsigned char result; #line 124 #line 124 result = LedsC$Leds$greenOff(); #line 124 #line 124 return result; #line 124 } #line 124 static inline # 159 "c:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$yellowOff(void) #line 159 { { } #line 160 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 161 { TOSH_SET_YELLOW_LED_PIN(); LedsC$ledsOn &= ~LedsC$YELLOW_BIT; } #line 164 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 149 "c:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t IntToLedsM$Leds$yellowOff(void){ #line 149 unsigned char result; #line 149 #line 149 result = LedsC$Leds$yellowOff(); #line 149 #line 149 return result; #line 149 } #line 149 static inline # 101 "c:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$redOff(void) #line 101 { { } #line 102 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 103 { TOSH_SET_RED_LED_PIN(); LedsC$ledsOn &= ~LedsC$RED_BIT; } #line 106 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 99 "c:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t IntToLedsM$Leds$redOff(void){ #line 99 unsigned char result; #line 99 #line 99 result = LedsC$Leds$redOff(); #line 99 #line 99 return result; #line 99 } #line 99 static inline # 81 "c:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$init(void) #line 81 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 82 { LedsC$ledsOn = 0; { } #line 84 ; TOSH_SET_RED_LED_PIN(); TOSH_SET_YELLOW_LED_PIN(); TOSH_SET_GREEN_LED_PIN(); } #line 88 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 83 "c:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t IntToLedsM$Leds$init(void){ #line 83 unsigned char result; #line 83 #line 83 result = LedsC$Leds$init(); #line 83 #line 83 return result; #line 83 } #line 83 static inline # 75 "c:/tinyos-1.x/tos/lib/IntToLedsM.nc" result_t IntToLedsM$StdControl$init(void) { IntToLedsM$Leds$init(); IntToLedsM$Leds$redOff(); IntToLedsM$Leds$yellowOff(); IntToLedsM$Leds$greenOff(); return SUCCESS; } # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t RealMain$StdControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = IntToLedsM$StdControl$init(); #line 52 result = rcombine(result, RfmToIntM$StdControl$init()); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 80 "c:/tinyos-1.x/tos/platform/mica/HPLClock.nc" result_t HPLClock$StdControl$init(void) #line 80 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 81 { HPLClock$mscale = DEFAULT_SCALE; HPLClock$minterval = DEFAULT_INTERVAL; } #line 84 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t LogicalTimeM$ClockControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = HPLClock$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 # 86 "c:/tinyos-1.x/tos/interfaces/Interrupt.nc" inline static result_t HPLUART0M$Interrupt$enable(void){ #line 86 unsigned char result; #line 86 #line 86 result = HPLInterrupt$Interrupt$enable(); #line 86 #line 86 return result; #line 86 } #line 86 # 122 "c:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_CC_PALE_PIN(void) #line 122 { #line 122 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) &= ~(1 << 4); } #line 120 static __inline void TOSH_CLR_CC_PDATA_PIN(void) #line 120 { #line 120 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) &= ~(1 << 7); } #line 121 static __inline void TOSH_CLR_CC_PCLK_PIN(void) #line 121 { #line 121 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) &= ~(1 << 6); } #line 120 static __inline void TOSH_MAKE_CC_PDATA_INPUT(void) #line 120 { #line 120 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) &= ~(1 << 7); } #line 120 static __inline int TOSH_READ_CC_PDATA_PIN(void) #line 120 { #line 120 return (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x10 + 0x20) & (1 << 7)) != 0; } static inline # 126 "c:/tinyos-1.x/tos/system/tos.h" result_t rcombine4(result_t r1, result_t r2, result_t r3, result_t r4) { return rcombine(r1, rcombine(r2, rcombine(r3, r4))); } # 29 "c:/tinyos-1.x/tos/interfaces/PowerManagement.nc" inline static uint8_t AMStandard$PowerManagement$adjustPower(void){ #line 29 unsigned char result; #line 29 #line 29 result = HPLPowerManagementM$PowerManagement$adjustPower(); #line 29 #line 29 return result; #line 29 } #line 29 # 90 "c:/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t AMStandard$ActivityTimer$start(char arg_0xa3091d8, uint32_t arg_0xa309328){ #line 90 unsigned char result; #line 90 #line 90 result = LogicalTimeM$Timer$start(0, arg_0xa3091d8, arg_0xa309328); #line 90 #line 90 return result; #line 90 } #line 90 # 90 "c:/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t CC1000RadioIntM$WakeupTimer$start(char arg_0xa3091d8, uint32_t arg_0xa309328){ #line 90 unsigned char result; #line 90 #line 90 result = LogicalTimeM$Timer$start(1, arg_0xa3091d8, arg_0xa309328); #line 90 #line 90 return result; #line 90 } #line 90 static inline # 88 "c:/tinyos-1.x/tos/platform/mica/HPLClock.nc" result_t HPLClock$StdControl$start(void) #line 88 { uint8_t mi; #line 89 uint8_t ms; #line 90 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 90 { mi = HPLClock$minterval; ms = HPLClock$mscale; } #line 93 __nesc_atomic_end(__nesc_atomic); } HPLClock$Clock$setRate(mi, ms); return SUCCESS; } # 59 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t LogicalTimeM$ClockControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = HPLClock$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 106 "c:/tinyos-1.x/tos/system/LogicalTimeM.nc" result_t LogicalTimeM$StdControl$start(void) #line 106 { LogicalTimeM$ClockControl$start(); return SUCCESS; } # 59 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t CC1000RadioIntM$TimerControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = LogicalTimeM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 # 29 "c:/tinyos-1.x/tos/interfaces/PowerManagement.nc" inline static uint8_t HPLSpiM$PowerManagement$adjustPower(void){ #line 29 unsigned char result; #line 29 #line 29 result = HPLPowerManagementM$PowerManagement$adjustPower(); #line 29 #line 29 return result; #line 29 } #line 29 static inline # 98 "c:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" result_t HPLSpiM$SpiByteFifo$enableIntr(void) #line 98 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) = 0xC0; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 0); HPLSpiM$PowerManagement$adjustPower(); return SUCCESS; } # 66 "c:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t CC1000RadioIntM$SpiByteFifo$enableIntr(void){ #line 66 unsigned char result; #line 66 #line 66 result = HPLSpiM$SpiByteFifo$enableIntr(); #line 66 #line 66 return result; #line 66 } #line 66 # 101 "c:/tinyos-1.x/tos/platform/mica2/CC1000Control.nc" inline static result_t CC1000RadioIntM$CC1000Control$RxMode(void){ #line 101 unsigned char result; #line 101 #line 101 result = CC1000ControlM$CC1000Control$RxMode(); #line 101 #line 101 return result; #line 101 } #line 101 static inline # 133 "c:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" result_t HPLSpiM$SpiByteFifo$rxMode(void) #line 133 { TOSH_MAKE_MISO_INPUT(); TOSH_MAKE_MOSI_INPUT(); return SUCCESS; } # 70 "c:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t CC1000RadioIntM$SpiByteFifo$rxMode(void){ #line 70 unsigned char result; #line 70 #line 70 result = HPLSpiM$SpiByteFifo$rxMode(); #line 70 #line 70 return result; #line 70 } #line 70 static inline # 231 "c:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$CC1000Control$BIASOn(void) #line 231 { CC1000ControlM$HPLChipcon$write(0x00, ((( 1 << 5) | (1 << 4)) | ( 1 << 3)) | ( 1 << 0)); TOSH_uwait(200); return SUCCESS; } # 122 "c:/tinyos-1.x/tos/platform/mica2/CC1000Control.nc" inline static result_t CC1000RadioIntM$CC1000Control$BIASOn(void){ #line 122 unsigned char result; #line 122 #line 122 result = CC1000ControlM$CC1000Control$BIASOn(); #line 122 #line 122 return result; #line 122 } #line 122 static inline # 254 "c:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$StdControl$start(void) #line 254 { CC1000ControlM$HPLChipcon$write(0x00, (((( 1 << 5) | (1 << 4)) | ( 1 << 3)) | (1 << 1)) | ( 1 << 0)); TOSH_uwait(2000); return SUCCESS; } # 59 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t CC1000RadioIntM$CC1000StdControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = CC1000ControlM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 392 "c:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" result_t CC1000RadioIntM$StdControl$start(void) #line 392 { if (CC1000RadioIntM$RadioState == CC1000RadioIntM$DISABLED_STATE) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 395 { CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; CC1000RadioIntM$bTxPending = CC1000RadioIntM$bTxBusy = FALSE; CC1000RadioIntM$sMacDelay = -1; } #line 399 __nesc_atomic_end(__nesc_atomic); } CC1000RadioIntM$preamblelen = (({ #line 400 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_PreambleLength[CC1000RadioIntM$lplpowertx * 2]; #line 400 unsigned char __result; #line 400 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ) #line 400 << 8) | ({ #line 401 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_PreambleLength[CC1000RadioIntM$lplpowertx * 2 + 1]; #line 401 unsigned char __result; #line 401 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); #line 402 if (CC1000RadioIntM$lplpower == 0) { CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; CC1000RadioIntM$CC1000StdControl$start(); CC1000RadioIntM$CC1000Control$BIASOn(); CC1000RadioIntM$SpiByteFifo$rxMode(); CC1000RadioIntM$CC1000Control$RxMode(); CC1000RadioIntM$SpiByteFifo$enableIntr(); } else { uint16_t sleeptime = (({ #line 412 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SleepTime[CC1000RadioIntM$lplpower * 2]; #line 412 unsigned char __result; #line 412 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ) #line 412 << 8) | ({ #line 413 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SleepTime[CC1000RadioIntM$lplpower * 2 + 1]; #line 413 unsigned char __result; #line 413 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); #line 414 CC1000RadioIntM$RadioState = CC1000RadioIntM$POWER_DOWN_STATE; CC1000RadioIntM$TimerControl$start(); CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, sleeptime); } } return SUCCESS; } # 59 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AMStandard$RadioControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = CC1000RadioIntM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 91 "c:/tinyos-1.x/tos/system/UARTM.nc" result_t UARTM$Control$start(void) #line 91 { return UARTM$HPLUART$init(); } # 59 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t NoCRCPacket$ByteControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = UARTM$Control$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 133 "c:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$Control$start(void) #line 133 { return NoCRCPacket$ByteControl$start(); } # 59 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AMStandard$UARTControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = NoCRCPacket$Control$start(); #line 59 #line 59 return result; #line 59 } #line 59 inline static result_t AMStandard$TimerControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = LogicalTimeM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 126 "c:/tinyos-1.x/tos/system/AMStandard.nc" bool AMStandard$Control$start(void) #line 126 { result_t ok0 = AMStandard$TimerControl$start(); result_t ok1 = AMStandard$UARTControl$start(); result_t ok2 = AMStandard$RadioControl$start(); result_t ok3 = AMStandard$ActivityTimer$start(TIMER_REPEAT, 1000); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 134 { AMStandard$state = FALSE; } #line 136 __nesc_atomic_end(__nesc_atomic); } AMStandard$PowerManagement$adjustPower(); return rcombine4(ok0, ok1, ok2, ok3); } # 59 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t RfmToIntM$CommControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = AMStandard$Control$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 83 "c:/tinyos-1.x/tos/lib/RfmToIntM.nc" result_t RfmToIntM$StdControl$start(void) #line 83 { return RfmToIntM$CommControl$start(); } static inline # 84 "c:/tinyos-1.x/tos/lib/IntToLedsM.nc" result_t IntToLedsM$StdControl$start(void) #line 84 { return SUCCESS; } # 59 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t RealMain$StdControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = IntToLedsM$StdControl$start(); #line 59 result = rcombine(result, RfmToIntM$StdControl$start()); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 49 "c:/tinyos-1.x/tos/platform/mica2/HPLPowerManagementM.nc" uint8_t HPLPowerManagementM$getPowerLevel(void) #line 49 { uint8_t diff; #line 51 if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) & ~((1 << 1) | (1 << 0))) { return HPLPowerManagementM$IDLE; } else { #line 54 if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) & (1 << 7)) { return HPLPowerManagementM$IDLE; } else { if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) & (1 << 7)) { return HPLPowerManagementM$ADC_NR; } else { #line 60 if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) & ((1 << 1) | (1 << 0))) { diff = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20) - * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x32 + 0x20); if (diff < 16) { return HPLPowerManagementM$EXT_STANDBY; } #line 64 return HPLPowerManagementM$POWER_SAVE; } else #line 65 { return HPLPowerManagementM$POWER_DOWN; } } } } } static inline #line 70 void HPLPowerManagementM$doAdjustment(void) #line 70 { uint8_t foo; #line 71 uint8_t mcu; #line 72 foo = HPLPowerManagementM$getPowerLevel(); mcu = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20); mcu &= 0xe3; if (foo == HPLPowerManagementM$EXT_STANDBY || foo == HPLPowerManagementM$POWER_SAVE) { mcu |= HPLPowerManagementM$IDLE; while ((* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x30 + 0x20) & 0x7) != 0) { __asm volatile ("nop");} mcu &= 0xe3; } mcu |= foo; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) = mcu; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) |= 1 << 5; } # 86 "c:/tinyos-1.x/tos/interfaces/Interrupt.nc" inline static result_t RealMain$Interrupt$enable(void){ #line 86 unsigned char result; #line 86 #line 86 result = HPLInterrupt$Interrupt$enable(); #line 86 #line 86 return result; #line 86 } #line 86 static inline # 158 "c:/tinyos-1.x/tos/platform/avrmote/avrhardware.h" void TOSH_wait(void) { __asm volatile ("nop"); __asm volatile ("nop");} static inline void TOSH_sleep(void) { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) |= 1 << 5; __asm volatile ("sleep");} static inline # 170 "c:/tinyos-1.x/tos/system/sched.c" bool TOSH_run_next_task(void) #line 170 { uint8_t old_full; void (*func)(void ); if (TOSH_sched_full == TOSH_sched_free) { return 0; } else { old_full = TOSH_sched_full; TOSH_sched_full++; TOSH_sched_full &= TOSH_TASK_BITMASK; func = TOSH_queue[(int )old_full].tp; TOSH_queue[(int )old_full].tp = 0; func(); return 1; } } static inline void TOSH_run_task(void) #line 189 { while (TOSH_run_next_task()) ; TOSH_sleep(); TOSH_wait(); } static inline # 156 "c:/tinyos-1.x/tos/system/AMStandard.nc" void AMStandard$dbgPacket(TOS_MsgPtr data) #line 156 { uint8_t i; for (i = 0; i < sizeof(TOS_Msg ); i++) { { } #line 161 ; } { } #line 163 ; } static inline # 98 "c:/tinyos-1.x/tos/lib/RfmToIntM.nc" result_t RfmToIntM$IntOutput$outputComplete(result_t success) #line 98 { return SUCCESS; } # 91 "c:/tinyos-1.x/tos/interfaces/IntOutput.nc" inline static result_t IntToLedsM$IntOutput$outputComplete(result_t arg_0xa2cf458){ #line 91 unsigned char result; #line 91 #line 91 result = RfmToIntM$IntOutput$outputComplete(arg_0xa2cf458); #line 91 #line 91 return result; #line 91 } #line 91 static inline # 93 "c:/tinyos-1.x/tos/lib/IntToLedsM.nc" void IntToLedsM$outputDone(void) { IntToLedsM$IntOutput$outputComplete(1); } # 112 "c:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_YELLOW_LED_PIN(void) #line 112 { #line 112 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 0); } static inline # 150 "c:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$yellowOn(void) #line 150 { { } #line 151 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 152 { TOSH_CLR_YELLOW_LED_PIN(); LedsC$ledsOn |= LedsC$YELLOW_BIT; } #line 155 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 141 "c:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t IntToLedsM$Leds$yellowOn(void){ #line 141 unsigned char result; #line 141 #line 141 result = LedsC$Leds$yellowOn(); #line 141 #line 141 return result; #line 141 } #line 141 # 111 "c:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_GREEN_LED_PIN(void) #line 111 { #line 111 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 1); } static inline # 121 "c:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$greenOn(void) #line 121 { { } #line 122 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 123 { TOSH_CLR_GREEN_LED_PIN(); LedsC$ledsOn |= LedsC$GREEN_BIT; } #line 126 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 116 "c:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t IntToLedsM$Leds$greenOn(void){ #line 116 unsigned char result; #line 116 #line 116 result = LedsC$Leds$greenOn(); #line 116 #line 116 return result; #line 116 } #line 116 # 110 "c:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_RED_LED_PIN(void) #line 110 { #line 110 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 2); } static inline # 92 "c:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$redOn(void) #line 92 { { } #line 93 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 94 { TOSH_CLR_RED_LED_PIN(); LedsC$ledsOn |= LedsC$RED_BIT; } #line 97 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 91 "c:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t IntToLedsM$Leds$redOn(void){ #line 91 unsigned char result; #line 91 #line 91 result = LedsC$Leds$redOn(); #line 91 #line 91 return result; #line 91 } #line 91 static inline # 98 "c:/tinyos-1.x/tos/lib/IntToLedsM.nc" result_t IntToLedsM$IntOutput$output(uint16_t value) { if (value & 1) { #line 100 IntToLedsM$Leds$redOn(); } else { #line 101 IntToLedsM$Leds$redOff(); } #line 102 if (value & 2) { #line 102 IntToLedsM$Leds$greenOn(); } else { #line 103 IntToLedsM$Leds$greenOff(); } #line 104 if (value & 4) { #line 104 IntToLedsM$Leds$yellowOn(); } else { #line 105 IntToLedsM$Leds$yellowOff(); } TOS_post(IntToLedsM$outputDone); return SUCCESS; } # 82 "c:/tinyos-1.x/tos/interfaces/IntOutput.nc" inline static result_t RfmToIntM$IntOutput$output(uint16_t arg_0xa2cefd8){ #line 82 unsigned char result; #line 82 #line 82 result = IntToLedsM$IntOutput$output(arg_0xa2cefd8); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 91 "c:/tinyos-1.x/tos/lib/RfmToIntM.nc" TOS_MsgPtr RfmToIntM$ReceiveIntMsg$receive(TOS_MsgPtr m) #line 91 { IntMsg *message = (IntMsg *)m->data; #line 93 RfmToIntM$IntOutput$output(message->val); return m; } static inline # 282 "c:/tinyos-1.x/tos/system/AMStandard.nc" TOS_MsgPtr AMStandard$ReceiveMsg$default$receive(uint8_t id, TOS_MsgPtr msg) #line 282 { return msg; } # 106 "c:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" inline static TOS_MsgPtr AMStandard$ReceiveMsg$receive(uint8_t arg_0xa2ebdb8, TOS_MsgPtr arg_0xa2e53e8){ #line 106 struct TOS_Msg *result; #line 106 #line 106 switch (arg_0xa2ebdb8) { #line 106 case AM_INTMSG: #line 106 result = RfmToIntM$ReceiveIntMsg$receive(arg_0xa2e53e8); #line 106 break; #line 106 default: #line 106 result = AMStandard$ReceiveMsg$default$receive(arg_0xa2ebdb8, arg_0xa2e53e8); #line 106 } #line 106 #line 106 return result; #line 106 } #line 106 static inline # 757 "c:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" result_t CC1000RadioIntM$RSSIADC$dataReady(uint16_t data) #line 757 { CC1000RadioIntM$usRSSIVal = data; CC1000RadioIntM$bRSSIValid = TRUE; return SUCCESS; } static inline # 120 "c:/tinyos-1.x/tos/platform/mica2/ADCM.nc" result_t ADCM$ADC$default$dataReady(uint8_t port, uint16_t data) #line 120 { return FAIL; } # 100 "c:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t ADCM$ADC$dataReady(uint8_t arg_0xa3f69b8, uint16_t arg_0xa374d98){ #line 100 unsigned char result; #line 100 #line 100 switch (arg_0xa3f69b8) { #line 100 case TOS_ADC_CC_RSSI_PORT: #line 100 result = CC1000RadioIntM$RSSIADC$dataReady(arg_0xa374d98); #line 100 break; #line 100 default: #line 100 result = ADCM$ADC$default$dataReady(arg_0xa3f69b8, arg_0xa374d98); #line 100 } #line 100 #line 100 return result; #line 100 } #line 100 # 104 "c:/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t ADCM$HPLADC$samplePort(uint8_t arg_0xa414cf0){ #line 104 unsigned char result; #line 104 #line 104 result = HPLADCM$ADC$samplePort(arg_0xa414cf0); #line 104 #line 104 return result; #line 104 } #line 104 static inline # 124 "c:/tinyos-1.x/tos/platform/mica2/ADCM.nc" result_t ADCM$HPLADC$dataReady(uint16_t data) #line 124 { uint16_t doneValue = data; uint8_t donePort; uint8_t nextPort = 0xff; result_t Result; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 131 { donePort = ADCM$ReqPort; if (((1 << donePort) & ADCM$ContReqMask) == 0) { ADCM$ReqVector ^= 1 << donePort; } if (ADCM$ReqVector) { do { ADCM$ReqPort++; ADCM$ReqPort %= TOSH_ADC_PORTMAPSIZE; } while ((( #line 142 1 << ADCM$ReqPort) & ADCM$ReqVector) == 0); nextPort = ADCM$ReqPort; } } #line 145 __nesc_atomic_end(__nesc_atomic); } if (nextPort != 0xff) { ADCM$HPLADC$samplePort(nextPort); } { } #line 152 ; Result = ADCM$ADC$dataReady(donePort, doneValue); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 155 { if (Result == FAIL && ADCM$ContReqMask & (1 << donePort)) { ADCM$ContReqMask ^= 1 << donePort; } } #line 159 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 126 "c:/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t HPLADCM$ADC$dataReady(uint16_t arg_0xa4157f8){ #line 126 unsigned char result; #line 126 #line 126 result = ADCM$HPLADC$dataReady(arg_0xa4157f8); #line 126 #line 126 return result; #line 126 } #line 126 # 72 "c:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t HPLSpiM$SpiByteFifo$dataReady(uint8_t arg_0xa359958){ #line 72 unsigned char result; #line 72 #line 72 result = CC1000RadioIntM$SpiByteFifo$dataReady(arg_0xa359958); #line 72 #line 72 return result; #line 72 } #line 72 # 77 "c:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" void __attribute((signal)) __vector_17(void) #line 77 { register uint8_t temp = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0F + 0x20); #line 79 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0F + 0x20) = HPLSpiM$OutgoingByte; HPLSpiM$SpiByteFifo$dataReady(temp); } static inline result_t HPLSpiM$SpiByteFifo$writeByte(uint8_t data) #line 83 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 86 HPLSpiM$OutgoingByte = data; #line 86 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 63 "c:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t CC1000RadioIntM$SpiByteFifo$writeByte(uint8_t arg_0xa3581e8){ #line 63 unsigned char result; #line 63 #line 63 result = HPLSpiM$SpiByteFifo$writeByte(arg_0xa3581e8); #line 63 #line 63 return result; #line 63 } #line 63 static inline # 766 "c:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" void CC1000RadioIntM$RadioSendCoordinator$default$startSymbol(void) #line 766 { } # 29 "c:/tinyos-1.x/tos/interfaces/RadioCoordinator.nc" inline static void CC1000RadioIntM$RadioSendCoordinator$startSymbol(void){ #line 29 CC1000RadioIntM$RadioSendCoordinator$default$startSymbol(); #line 29 } #line 29 static inline # 36 "c:/tinyos-1.x/tos/platform/avrmote/crc.h" uint16_t crcByte(uint16_t oldCrc, uint8_t byte) { uint16_t *table = crcTable; uint16_t newCrc; __asm ("eor %1,%B3\n" "\tlsl %1\n" "\tadc %B2, __zero_reg__\n" "\tadd %A2, %1\n" "\tadc %B2, __zero_reg__\n" "\tlpm\n" "\tmov %B0, %A3\n" "\tmov %A0, r0\n" "\tadiw r30,1\n" "\tlpm\n" "\teor %B0, r0" : "=r"(newCrc), "+r"(byte), "+z"(table) : "r"(oldCrc)); return newCrc; } static inline # 767 "c:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" void CC1000RadioIntM$RadioSendCoordinator$default$byte(TOS_MsgPtr msg, uint8_t byteCount) #line 767 { } # 32 "c:/tinyos-1.x/tos/interfaces/RadioCoordinator.nc" inline static void CC1000RadioIntM$RadioSendCoordinator$byte(TOS_MsgPtr arg_0xa34c780, uint8_t arg_0xa34c8c8){ #line 32 CC1000RadioIntM$RadioSendCoordinator$default$byte(arg_0xa34c780, arg_0xa34c8c8); #line 32 } #line 32 static inline # 248 "c:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$RadioSend$sendDone(TOS_MsgPtr msg, result_t success) #line 248 { return AMStandard$reportSendDone(msg, success); } # 94 "c:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" inline static result_t CC1000RadioIntM$Send$sendDone(TOS_MsgPtr arg_0xa2f3d48, result_t arg_0xa2f3e90){ #line 94 unsigned char result; #line 94 #line 94 result = AMStandard$RadioSend$sendDone(arg_0xa2f3d48, arg_0xa2f3e90); #line 94 #line 94 return result; #line 94 } #line 94 static inline # 196 "c:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" void CC1000RadioIntM$PacketSent(void) #line 196 { TOS_MsgPtr pBuf; #line 198 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 198 { CC1000RadioIntM$txbufptr->time = 0; pBuf = CC1000RadioIntM$txbufptr; } #line 201 __nesc_atomic_end(__nesc_atomic); } CC1000RadioIntM$Send$sendDone((TOS_MsgPtr )pBuf, SUCCESS); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 203 CC1000RadioIntM$bTxBusy = FALSE; #line 203 __nesc_atomic_end(__nesc_atomic); } } static inline # 185 "c:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$SendMsg$default$sendDone(uint8_t id, TOS_MsgPtr msg, result_t success) #line 185 { return SUCCESS; } # 73 "c:/tinyos-1.x/tos/interfaces/SendMsg.nc" inline static result_t AMStandard$SendMsg$sendDone(uint8_t arg_0xa2eb820, TOS_MsgPtr arg_0xa2d9288, result_t arg_0xa2d93d0){ #line 73 unsigned char result; #line 73 #line 73 result = AMStandard$SendMsg$default$sendDone(arg_0xa2eb820, arg_0xa2d9288, arg_0xa2d93d0); #line 73 #line 73 return result; #line 73 } #line 73 static inline # 188 "c:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$default$sendDone(void) #line 188 { return SUCCESS; } #line 88 inline static result_t AMStandard$sendDone(void){ #line 88 unsigned char result; #line 88 #line 88 result = AMStandard$default$sendDone(); #line 88 #line 88 return result; #line 88 } #line 88 static inline # 200 "c:/tinyos-1.x/tos/platform/mica2/ADCM.nc" result_t ADCM$ADC$getData(uint8_t port) #line 200 { return ADCM$startGet(ADCM$SINGLE_CONVERSION, port); } # 82 "c:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t CC1000RadioIntM$RSSIADC$getData(void){ #line 82 unsigned char result; #line 82 #line 82 result = ADCM$ADC$getData(TOS_ADC_CC_RSSI_PORT); #line 82 #line 82 return result; #line 82 } #line 82 # 86 "c:/tinyos-1.x/tos/interfaces/Random.nc" inline static uint16_t CC1000RadioIntM$Random$rand(void){ #line 86 unsigned int result; #line 86 #line 86 result = RandomLFSR$Random$rand(); #line 86 #line 86 return result; #line 86 } #line 86 static inline # 196 "c:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$CC1000Control$TxMode(void) #line 196 { CC1000ControlM$HPLChipcon$write(0x00, ((( 1 << 7) | (1 << 6)) | (1 << 5)) | ( 1 << 0)); CC1000ControlM$HPLChipcon$write(0x09, ({ #line 202 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[CC1000ControlM$tunefreq][29]; #line 202 unsigned char __result; #line 202 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )); #line 203 TOSH_uwait(250); CC1000ControlM$HPLChipcon$write(0x0B, CC1000ControlM$rfpower); TOSH_uwait(20); return SUCCESS; } # 93 "c:/tinyos-1.x/tos/platform/mica2/CC1000Control.nc" inline static result_t CC1000RadioIntM$CC1000Control$TxMode(void){ #line 93 unsigned char result; #line 93 #line 93 result = CC1000ControlM$CC1000Control$TxMode(); #line 93 #line 93 return result; #line 93 } #line 93 # 137 "c:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_MOSI_OUTPUT(void) #line 137 { #line 137 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) |= 1 << 2; } #line 138 static __inline void TOSH_MAKE_MISO_OUTPUT(void) #line 138 { #line 138 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) |= 1 << 3; } static inline # 127 "c:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" result_t HPLSpiM$SpiByteFifo$txMode(void) #line 127 { TOSH_MAKE_MISO_OUTPUT(); TOSH_MAKE_MOSI_OUTPUT(); return SUCCESS; } # 69 "c:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t CC1000RadioIntM$SpiByteFifo$txMode(void){ #line 69 unsigned char result; #line 69 #line 69 result = HPLSpiM$SpiByteFifo$txMode(); #line 69 #line 69 return result; #line 69 } #line 69 static inline # 768 "c:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" void CC1000RadioIntM$RadioReceiveCoordinator$default$startSymbol(void) #line 768 { } # 29 "c:/tinyos-1.x/tos/interfaces/RadioCoordinator.nc" inline static void CC1000RadioIntM$RadioReceiveCoordinator$startSymbol(void){ #line 29 CC1000RadioIntM$RadioReceiveCoordinator$default$startSymbol(); #line 29 } #line 29 static inline # 769 "c:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" void CC1000RadioIntM$RadioReceiveCoordinator$default$byte(TOS_MsgPtr msg, uint8_t byteCount) #line 769 { } # 32 "c:/tinyos-1.x/tos/interfaces/RadioCoordinator.nc" inline static void CC1000RadioIntM$RadioReceiveCoordinator$byte(TOS_MsgPtr arg_0xa34c780, uint8_t arg_0xa34c8c8){ #line 32 CC1000RadioIntM$RadioReceiveCoordinator$default$byte(arg_0xa34c780, arg_0xa34c8c8); #line 32 } #line 32 static inline # 289 "c:/tinyos-1.x/tos/system/AMStandard.nc" TOS_MsgPtr AMStandard$RadioReceive$receive(TOS_MsgPtr packet) #line 289 { return received(packet); } # 106 "c:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" inline static TOS_MsgPtr CC1000RadioIntM$Receive$receive(TOS_MsgPtr arg_0xa2e53e8){ #line 106 struct TOS_Msg *result; #line 106 #line 106 result = AMStandard$RadioReceive$receive(arg_0xa2e53e8); #line 106 #line 106 return result; #line 106 } #line 106 static inline # 178 "c:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" void CC1000RadioIntM$PacketRcvd(void) #line 178 { TOS_MsgPtr pBuf; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 181 { CC1000RadioIntM$rxbufptr->time = 0; pBuf = CC1000RadioIntM$rxbufptr; CC1000RadioIntM$usSquelchVal = (5 * CC1000RadioIntM$rxbufptr->strength + 3 * CC1000RadioIntM$usSquelchVal) >> 3; } #line 186 __nesc_atomic_end(__nesc_atomic); } pBuf = CC1000RadioIntM$Receive$receive((TOS_MsgPtr )pBuf); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 188 { if (pBuf) { CC1000RadioIntM$rxbufptr = pBuf; } #line 191 CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; } #line 192 __nesc_atomic_end(__nesc_atomic); } CC1000RadioIntM$SpiByteFifo$enableIntr(); } static inline # 110 "c:/tinyos-1.x/tos/platform/mica/HPLClock.nc" void HPLClock$Clock$setInterval(uint8_t value) #line 110 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20) = value; } # 131 "c:/tinyos-1.x/tos/interfaces/Clock.nc" inline static void LogicalTimeM$Clock$setInterval(uint8_t arg_0xa456080){ #line 131 HPLClock$Clock$setInterval(arg_0xa456080); #line 131 } #line 131 static inline # 120 "c:/tinyos-1.x/tos/platform/mica/HPLClock.nc" uint8_t HPLClock$Clock$getInterval(void) #line 120 { return * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20); } # 147 "c:/tinyos-1.x/tos/interfaces/Clock.nc" inline static uint8_t LogicalTimeM$Clock$getInterval(void){ #line 147 unsigned char result; #line 147 #line 147 result = HPLClock$Clock$getInterval(); #line 147 #line 147 return result; #line 147 } #line 147 # 295 "c:/tinyos-1.x/tos/system/LogicalTimeM.nc" static void LogicalTimeM$adjustInterval(void) #line 295 { uint8_t i; #line 296 uint8_t val; #line 296 uint8_t mInterval; #line 297 val = mInterval = LogicalTimeM$Clock$getInterval(); { } #line 298 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 299 { if (LogicalTimeM$mState) { for (i = 0; i < NUM_TIMERS; i++) { if (LogicalTimeM$mState & (0x1 << i) && LogicalTimeM$mTimerList[i].ticksLeft < (int32_t )val) { val = LogicalTimeM$mTimerList[i].ticksLeft; } } if (val < mInterval) { LogicalTimeM$Clock$setInterval(val); { } #line 308 ; } } else #line 310 { LogicalTimeM$Clock$setInterval(255); { } #line 312 ; } LogicalTimeM$setIntervalFlag = 0; } #line 315 __nesc_atomic_end(__nesc_atomic); } } static inline # 177 "c:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$ActivityTimer$fired(void) #line 177 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 178 { AMStandard$lastCount = AMStandard$counter; AMStandard$counter = 0; } #line 181 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 67 "c:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t CC1000RadioIntM$SpiByteFifo$disableIntr(void){ #line 67 unsigned char result; #line 67 #line 67 result = HPLSpiM$SpiByteFifo$disableIntr(); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 243 "c:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$StdControl$stop(void) #line 243 { CC1000ControlM$HPLChipcon$write(0x0B, 0x00); CC1000ControlM$HPLChipcon$write(0x00, ((((( 1 << 5) | (1 << 4)) | ( 1 << 3)) | (1 << 2)) | (1 << 1)) | ( 1 << 0)); return SUCCESS; } # 67 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t CC1000RadioIntM$CC1000StdControl$stop(void){ #line 67 unsigned char result; #line 67 #line 67 result = CC1000ControlM$StdControl$stop(); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 346 "c:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" result_t CC1000RadioIntM$WakeupTimer$fired(void) #line 346 { uint16_t sleeptime; #line 348 if (CC1000RadioIntM$lplpower == 0) { return SUCCESS; } switch (CC1000RadioIntM$RadioState) { case CC1000RadioIntM$IDLE_STATE: sleeptime = (({ #line 353 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SleepTime[CC1000RadioIntM$lplpower * 2]; #line 353 unsigned char __result; #line 353 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ) #line 353 << 8) | ({ #line 354 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SleepTime[CC1000RadioIntM$lplpower * 2 + 1]; #line 354 unsigned char __result; #line 354 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); #line 355 if (!CC1000RadioIntM$bTxPending) { CC1000RadioIntM$RadioState = CC1000RadioIntM$POWER_DOWN_STATE; CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, sleeptime); CC1000RadioIntM$CC1000StdControl$stop(); CC1000RadioIntM$SpiByteFifo$disableIntr(); } else { CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, 16 * 2); } break; case CC1000RadioIntM$POWER_DOWN_STATE: sleeptime = ({ #line 367 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SleepPreamble[CC1000RadioIntM$lplpower]; #line 367 unsigned char __result; #line 367 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); #line 368 CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; CC1000RadioIntM$CC1000StdControl$start(); CC1000RadioIntM$CC1000Control$BIASOn(); CC1000RadioIntM$SpiByteFifo$rxMode(); CC1000RadioIntM$CC1000Control$RxMode(); CC1000RadioIntM$SpiByteFifo$enableIntr(); CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, sleeptime); break; default: CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, 16 * 2); } return SUCCESS; } static inline # 363 "c:/tinyos-1.x/tos/system/LogicalTimeM.nc" result_t LogicalTimeM$Timer$default$fired(uint8_t id) #line 363 { return SUCCESS; } # 104 "c:/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t LogicalTimeM$Timer$fired(uint8_t arg_0xa46fe50){ #line 104 unsigned char result; #line 104 #line 104 switch (arg_0xa46fe50) { #line 104 case 0: #line 104 result = AMStandard$ActivityTimer$fired(); #line 104 break; #line 104 case 1: #line 104 result = CC1000RadioIntM$WakeupTimer$fired(); #line 104 break; #line 104 default: #line 104 result = LogicalTimeM$Timer$default$fired(arg_0xa46fe50); #line 104 } #line 104 #line 104 return result; #line 104 } #line 104 static inline # 63 "c:/tinyos-1.x/tos/system/TimeUtilC.nc" tos_time_t TimeUtilC$TimeUtil$subtract(tos_time_t a, tos_time_t b) #line 63 { tos_time_t result; result.low32 = a.low32 - b.low32; result.high32 = a.high32 - b.high32; if (b.low32 > a.low32) { result.high32--; } return result; } # 97 "c:/tinyos-1.x/tos/interfaces/TimeUtil.nc" inline static tos_time_t LogicalTimeM$TimeUtil$subtract(tos_time_t arg_0xa444fc8, tos_time_t arg_0xa445110){ #line 97 struct __nesc_unnamed4263 result; #line 97 #line 97 result = TimeUtilC$TimeUtil$subtract(arg_0xa444fc8, arg_0xa445110); #line 97 #line 97 return result; #line 97 } #line 97 static inline # 157 "c:/tinyos-1.x/tos/platform/mica/HPLClock.nc" uint8_t HPLClock$Clock$readCounter(void) #line 157 { return * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x32 + 0x20); } # 179 "c:/tinyos-1.x/tos/interfaces/Clock.nc" inline static uint8_t LogicalTimeM$Clock$readCounter(void){ #line 179 unsigned char result; #line 179 #line 179 result = HPLClock$Clock$readCounter(); #line 179 #line 179 return result; #line 179 } #line 179 # 70 "c:/tinyos-1.x/tos/interfaces/TimeUtil.nc" inline static tos_time_t LogicalTimeM$TimeUtil$addUint32(tos_time_t arg_0xa4376d8, uint32_t arg_0xa437820){ #line 70 struct __nesc_unnamed4263 result; #line 70 #line 70 result = TimeUtilC$TimeUtil$addUint32(arg_0xa4376d8, arg_0xa437820); #line 70 #line 70 return result; #line 70 } #line 70 static inline # 131 "c:/tinyos-1.x/tos/system/LogicalTimeM.nc" tos_time_t LogicalTimeM$Time$get(void) #line 131 { tos_time_t rval; #line 133 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 133 { rval = LogicalTimeM$TimeUtil$addUint32(LogicalTimeM$time, LogicalTimeM$Clock$readCounter()); } #line 135 __nesc_atomic_end(__nesc_atomic); } return rval; } static inline #line 181 void LogicalTimeM$resetBaseTimer(void) #line 181 { tos_time_t td = LogicalTimeM$Time$get(); #line 183 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 183 { td = LogicalTimeM$TimeUtil$subtract(LogicalTimeM$aTimer[LogicalTimeM$baseTimerIndex], td); } #line 185 __nesc_atomic_end(__nesc_atomic); } LogicalTimeM$Timer$start(NUM_TIMERS, TIMER_ONE_SHOT, td.low32); { } #line 187 ; } # 87 "c:/tinyos-1.x/tos/interfaces/TimeUtil.nc" inline static char LogicalTimeM$TimeUtil$compare(tos_time_t arg_0xa444450, tos_time_t arg_0xa444598){ #line 87 char result; #line 87 #line 87 result = TimeUtilC$TimeUtil$compare(arg_0xa444450, arg_0xa444598); #line 87 #line 87 return result; #line 87 } #line 87 static inline # 246 "c:/tinyos-1.x/tos/system/LogicalTimeM.nc" void LogicalTimeM$selectBaseTimer(void) #line 246 { uint8_t i; #line 247 uint8_t Index = 0xff; #line 248 if (LogicalTimeM$useBit) { for (i = 0; i < MAX_NUM_TIMERS; i++) { if (LogicalTimeM$useBit & (0x1 << i)) { #line 251 Index = i; #line 251 break; } } { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 254 { while (++i < MAX_NUM_TIMERS) { if (LogicalTimeM$useBit & (0x1 << i)) { if (LogicalTimeM$TimeUtil$compare(LogicalTimeM$aTimer[Index], LogicalTimeM$aTimer[i]) == 1) { Index = i; } } } } #line 262 __nesc_atomic_end(__nesc_atomic); } #line 261 LogicalTimeM$baseTimerIndex = Index; { } #line 262 ; LogicalTimeM$resetBaseTimer(); } } static inline result_t LogicalTimeM$AbsoluteTimer$default$fired(uint8_t id) #line 267 { return SUCCESS; } # 66 "c:/tinyos-1.x/tos/interfaces/AbsoluteTimer.nc" inline static result_t LogicalTimeM$AbsoluteTimer$fired(uint8_t arg_0xa46c4a8){ #line 66 unsigned char result; #line 66 #line 66 result = LogicalTimeM$AbsoluteTimer$default$fired(arg_0xa46c4a8); #line 66 #line 66 return result; #line 66 } #line 66 static inline #line 272 void LogicalTimeM$timeout(void) #line 272 { int i = 0; bool doSignal; tos_time_t now = LogicalTimeM$Time$get(); #line 276 for (i = 0; i < MAX_NUM_TIMERS; i++) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 278 { doSignal = LogicalTimeM$useBit & (0x1 << i) && LogicalTimeM$TimeUtil$compare(now, LogicalTimeM$aTimer[i]) >= 0; } #line 280 __nesc_atomic_end(__nesc_atomic); } if (doSignal) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 282 { LogicalTimeM$useBit &= ~(0x1 << i); } #line 284 __nesc_atomic_end(__nesc_atomic); } LogicalTimeM$AbsoluteTimer$fired(i); } } if (LogicalTimeM$useBit) { LogicalTimeM$selectBaseTimer(); } { } #line 292 ; } static inline #line 367 void LogicalTimeM$timerHandlingTask(void) #line 367 { int i; bool fireTimer; uint32_t mStateCopy; uint8_t mInterval = LogicalTimeM$Clock$getInterval(); #line 372 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 372 { mStateCopy = LogicalTimeM$mState; } #line 374 __nesc_atomic_end(__nesc_atomic); } if (mStateCopy) { for (i = NUM_TIMERS; i >= 0; i--) { if (mStateCopy & (0x1 << i)) { fireTimer = FALSE; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 382 { LogicalTimeM$mTimerList[i].ticksLeft -= mInterval + 1; if (LogicalTimeM$mTimerList[i].ticksLeft <= 0) { if (LogicalTimeM$mTimerList[i].type == TIMER_REPEAT) { LogicalTimeM$mTimerList[i].ticksLeft = LogicalTimeM$mTimerList[i].ticks; if (LogicalTimeM$mTimerList[i].ticksLeft < (int32_t )mInterval) { LogicalTimeM$setIntervalFlag = 1; } } else #line 389 { LogicalTimeM$mState &= ~(0x1 << i); if (!LogicalTimeM$mState) { LogicalTimeM$Clock$setInterval(255); { } #line 393 ; } else #line 394 { LogicalTimeM$setIntervalFlag = 1; } } { } #line 398 ; if (i == NUM_TIMERS) { #line 399 LogicalTimeM$timeout(); } else { #line 400 fireTimer = TRUE; } } } #line 403 __nesc_atomic_end(__nesc_atomic); } #line 403 if (fireTimer) { LogicalTimeM$Timer$fired(i); } } } } if (LogicalTimeM$setIntervalFlag) { LogicalTimeM$adjustInterval(); } return; } static inline # 89 "c:/tinyos-1.x/tos/system/TimeUtilC.nc" tos_time_t TimeUtilC$TimeUtil$addint32(tos_time_t a, int32_t ms) #line 89 { if (ms > 0) { return TimeUtilC$TimeUtil$addUint32(a, ms); } else { return TimeUtilC$TimeUtil$addUint32(a, (uint32_t )-ms); } } # 59 "c:/tinyos-1.x/tos/interfaces/TimeUtil.nc" inline static tos_time_t LogicalTimeM$TimeUtil$addint32(tos_time_t arg_0xa437058, int32_t arg_0xa437198){ #line 59 struct __nesc_unnamed4263 result; #line 59 #line 59 result = TimeUtilC$TimeUtil$addint32(arg_0xa437058, arg_0xa437198); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 416 "c:/tinyos-1.x/tos/system/LogicalTimeM.nc" result_t LogicalTimeM$Clock$fire(void) #line 416 { int32_t delta; uint8_t mInterval = LogicalTimeM$Clock$getInterval(); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 421 { delta = mInterval + 1 + LogicalTimeM$adjustment; LogicalTimeM$time = LogicalTimeM$TimeUtil$addint32(LogicalTimeM$time, delta); if (LogicalTimeM$adjustment != 0) { LogicalTimeM$mTimerList[NUM_TIMERS].ticksLeft += LogicalTimeM$adjustment; LogicalTimeM$adjustment = 0; } } #line 429 __nesc_atomic_end(__nesc_atomic); } TOS_post(LogicalTimeM$timerHandlingTask); return SUCCESS; } # 206 "c:/tinyos-1.x/tos/interfaces/Clock.nc" inline static result_t HPLClock$Clock$fire(void){ #line 206 unsigned char result; #line 206 #line 206 result = LogicalTimeM$Clock$fire(); #line 206 #line 206 return result; #line 206 } #line 206 # 93 "c:/tinyos-1.x/tos/interfaces/ByteComm.nc" inline static result_t UARTM$ByteComm$rxByteReady(uint8_t arg_0xa4cf0a8, bool arg_0xa4cf1e8, uint16_t arg_0xa4cf338){ #line 93 unsigned char result; #line 93 #line 93 result = NoCRCPacket$ByteComm$rxByteReady(arg_0xa4cf0a8, arg_0xa4cf1e8, arg_0xa4cf338); #line 93 #line 93 return result; #line 93 } #line 93 static inline # 100 "c:/tinyos-1.x/tos/system/UARTM.nc" result_t UARTM$HPLUART$get(uint8_t data) #line 100 { UARTM$ByteComm$rxByteReady(data, FALSE, 0); { } #line 106 ; return SUCCESS; } # 115 "c:/tinyos-1.x/tos/interfaces/HPLUART.nc" inline static result_t HPLUART0M$UART$get(uint8_t arg_0xa4fd528){ #line 115 unsigned char result; #line 115 #line 115 result = UARTM$HPLUART$get(arg_0xa4fd528); #line 115 #line 115 return result; #line 115 } #line 115 # 111 "c:/tinyos-1.x/tos/platform/mica2/HPLUART0M.nc" void __attribute((signal)) __vector_18(void) #line 111 { if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0B + 0x20) & (1 << 7)) { HPLUART0M$UART$get(* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0C + 0x20)); } } static inline # 160 "c:/tinyos-1.x/tos/system/AM.h" uint8_t TOS_MsgLength(uint8_t type) { return (size_t )& ((TOS_Msg *)0)->strength; } static inline # 286 "c:/tinyos-1.x/tos/system/AMStandard.nc" TOS_MsgPtr AMStandard$UARTReceive$receive(TOS_MsgPtr packet) #line 286 { return received(packet); } # 106 "c:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" inline static TOS_MsgPtr NoCRCPacket$Receive$receive(TOS_MsgPtr arg_0xa2e53e8){ #line 106 struct TOS_Msg *result; #line 106 #line 106 result = AMStandard$UARTReceive$receive(arg_0xa2e53e8); #line 106 #line 106 return result; #line 106 } #line 106 static inline # 342 "c:/tinyos-1.x/tos/system/NoCRCPacket.nc" void NoCRCPacket$receiveTask(void) #line 342 { TOS_MsgPtr tmp; #line 344 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 344 { tmp = NoCRCPacket$bufferPtrs[NoCRCPacket$bufferIndex ^ 1]; } #line 346 __nesc_atomic_end(__nesc_atomic); } tmp = NoCRCPacket$Receive$receive(tmp); if (tmp) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 349 { NoCRCPacket$bufferPtrs[NoCRCPacket$bufferIndex ^ 1] = tmp; } #line 351 __nesc_atomic_end(__nesc_atomic); } } } # 123 "c:/tinyos-1.x/tos/interfaces/HPLUART.nc" inline static result_t HPLUART0M$UART$putDone(void){ #line 123 unsigned char result; #line 123 #line 123 result = UARTM$HPLUART$putDone(); #line 123 #line 123 return result; #line 123 } #line 123 # 118 "c:/tinyos-1.x/tos/platform/mica2/HPLUART0M.nc" void __attribute((interrupt)) __vector_20(void) #line 118 { HPLUART0M$UART$putDone(); } static inline # 331 "c:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$ByteComm$txDone(void) #line 331 { bool complete; #line 333 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 333 { complete = NoCRCPacket$txCount == NoCRCPacket$txLength; } #line 335 __nesc_atomic_end(__nesc_atomic); } if (complete) { NoCRCPacket$sendComplete(TRUE); } #line 338 return SUCCESS; } # 110 "c:/tinyos-1.x/tos/interfaces/ByteComm.nc" inline static result_t UARTM$ByteComm$txDone(void){ #line 110 unsigned char result; #line 110 #line 110 result = NoCRCPacket$ByteComm$txDone(); #line 110 #line 110 return result; #line 110 } #line 110 static inline # 245 "c:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$UARTSend$sendDone(TOS_MsgPtr msg, result_t success) #line 245 { return AMStandard$reportSendDone(msg, success); } # 94 "c:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" inline static result_t NoCRCPacket$Send$sendDone(TOS_MsgPtr arg_0xa2f3d48, result_t arg_0xa2f3e90){ #line 94 unsigned char result; #line 94 #line 94 result = AMStandard$UARTSend$sendDone(arg_0xa2f3d48, arg_0xa2f3e90); #line 94 #line 94 return result; #line 94 } #line 94 static inline # 222 "c:/tinyos-1.x/tos/system/NoCRCPacket.nc" void NoCRCPacket$sendDoneSuccessTask(void) #line 222 { TOS_MsgPtr msg; #line 224 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 224 { NoCRCPacket$txCount = 0; NoCRCPacket$state = NoCRCPacket$IDLE; msg = (TOS_MsgPtr )NoCRCPacket$sendPtr; } #line 228 __nesc_atomic_end(__nesc_atomic); } NoCRCPacket$Send$sendDone(msg, SUCCESS); } static inline #line 212 void NoCRCPacket$sendDoneFailTask(void) #line 212 { TOS_MsgPtr msg; #line 214 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 214 { NoCRCPacket$txCount = 0; NoCRCPacket$state = NoCRCPacket$IDLE; msg = (TOS_MsgPtr )NoCRCPacket$sendPtr; } #line 218 __nesc_atomic_end(__nesc_atomic); } NoCRCPacket$Send$sendDone(msg, FAIL); } static inline #line 293 result_t NoCRCPacket$SendVarLenPacket$default$sendDone(uint8_t *packet, result_t success) #line 293 { return success; } # 89 "c:/tinyos-1.x/tos/interfaces/SendVarLenPacket.nc" inline static result_t NoCRCPacket$SendVarLenPacket$sendDone(uint8_t *arg_0xa2db638, result_t arg_0xa2db780){ #line 89 unsigned char result; #line 89 #line 89 result = NoCRCPacket$SendVarLenPacket$default$sendDone(arg_0xa2db638, arg_0xa2db780); #line 89 #line 89 return result; #line 89 } #line 89 static inline # 242 "c:/tinyos-1.x/tos/system/NoCRCPacket.nc" void NoCRCPacket$sendVarLenSuccessTask(void) #line 242 { uint8_t *buf; #line 244 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 244 { NoCRCPacket$txCount = 0; NoCRCPacket$state = NoCRCPacket$IDLE; buf = NoCRCPacket$sendPtr; } #line 248 __nesc_atomic_end(__nesc_atomic); } NoCRCPacket$SendVarLenPacket$sendDone(buf, SUCCESS); } static inline #line 232 void NoCRCPacket$sendVarLenFailTask(void) #line 232 { uint8_t *buf; #line 234 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 234 { NoCRCPacket$txCount = 0; NoCRCPacket$state = NoCRCPacket$IDLE; buf = NoCRCPacket$sendPtr; } #line 238 __nesc_atomic_end(__nesc_atomic); } NoCRCPacket$SendVarLenPacket$sendDone(buf, FAIL); } static inline # 122 "c:/tinyos-1.x/tos/platform/mica2/HPLUART0M.nc" result_t HPLUART0M$UART$put(uint8_t data) #line 122 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0C + 0x20) = data; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0B + 0x20) |= 1 << 6; return SUCCESS; } # 107 "c:/tinyos-1.x/tos/interfaces/HPLUART.nc" inline static result_t UARTM$HPLUART$put(uint8_t arg_0xa4fd038){ #line 107 unsigned char result; #line 107 #line 107 result = HPLUART0M$UART$put(arg_0xa4fd038); #line 107 #line 107 return result; #line 107 } #line 107 static inline # 133 "c:/tinyos-1.x/tos/system/UARTM.nc" result_t UARTM$ByteComm$txByte(uint8_t data) #line 133 { bool oldState; { } #line 136 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 138 { oldState = UARTM$state; UARTM$state = TRUE; } #line 141 __nesc_atomic_end(__nesc_atomic); } if (oldState) { return FAIL; } UARTM$HPLUART$put(data); return SUCCESS; } # 82 "c:/tinyos-1.x/tos/interfaces/ByteComm.nc" inline static result_t NoCRCPacket$ByteComm$txByte(uint8_t arg_0xa4cec28){ #line 82 unsigned char result; #line 82 #line 82 result = UARTM$ByteComm$txByte(arg_0xa4cec28); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 304 "c:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$ByteComm$txByteReady(bool success) #line 304 { uint8_t txC; uint8_t txL; #line 307 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 307 { txC = NoCRCPacket$txCount; txL = NoCRCPacket$txLength; } #line 310 __nesc_atomic_end(__nesc_atomic); } if (txC > 0) { if (!success) { { } #line 313 ; NoCRCPacket$sendComplete(FAIL); } else { #line 316 if (txC < txL) { uint8_t byteToSend; #line 318 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 318 { byteToSend = NoCRCPacket$sendPtr[txC]; NoCRCPacket$txCount++; } #line 321 __nesc_atomic_end(__nesc_atomic); } { } #line 322 ; if (!NoCRCPacket$ByteComm$txByte(byteToSend)) { NoCRCPacket$sendComplete(FAIL); } } } } #line 328 return SUCCESS; } # 102 "c:/tinyos-1.x/tos/interfaces/ByteComm.nc" inline static result_t UARTM$ByteComm$txByteReady(bool arg_0xa4cf858){ #line 102 unsigned char result; #line 102 #line 102 result = NoCRCPacket$ByteComm$txByteReady(arg_0xa4cf858); #line 102 #line 102 return result; #line 102 } #line 102 # 130 "c:/tinyos-1.x/tos/system/sched.c" bool TOS_post(void (*tp)(void)) #line 130 { uint8_t tmp; bool fprev; fprev = TOSH_interrupt_disable(); tmp = TOSH_sched_free; TOSH_sched_free++; TOSH_sched_free &= TOSH_TASK_BITMASK; if (TOSH_sched_free != TOSH_sched_full) { if (fprev) { TOSH_interrupt_enable(); } #line 144 TOSH_queue[tmp].tp = tp; return TRUE; } else { TOSH_sched_free = tmp; if (fprev) { TOSH_interrupt_enable(); } #line 151 return FALSE; } } # 78 "c:/tinyos-1.x/tos/system/RealMain.nc" int main(void) #line 78 { RealMain$hardwareInit(); RealMain$Pot$init(10); TOSH_sched_init(); RealMain$StdControl$init(); RealMain$StdControl$start(); RealMain$Interrupt$enable(); while (1) { TOSH_run_task(); } } static # 91 "c:/tinyos-1.x/tos/system/LogicalTimeM.nc" result_t LogicalTimeM$StdControl$init(void) #line 91 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 93 { LogicalTimeM$time.high32 = 0; LogicalTimeM$time.low32 = 0; LogicalTimeM$setIntervalFlag = 0; LogicalTimeM$useBit = 0; #line 98 LogicalTimeM$mState = 0; LogicalTimeM$baseTimerIndex = -1; LogicalTimeM$ClockControl$init(); LogicalTimeM$adjustment = 0; } #line 102 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } static # 81 "c:/tinyos-1.x/tos/platform/mica2/HPLUART0M.nc" result_t HPLUART0M$UART$init(void) #line 81 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)0x90 = 0; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x09 + 0x20) = 15; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0B + 0x20) = 1 << 1; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)0x95 = (1 << 2) | (1 << 1); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0A + 0x20) = (((1 << 7) | (1 << 6)) | (1 << 4)) | (1 << 3); HPLUART0M$Interrupt$enable(); return SUCCESS; } static # 103 "c:/tinyos-1.x/tos/platform/mica2/HPLCC1000M.nc" result_t HPLCC1000M$HPLCC1000$write(uint8_t addr, uint8_t data) #line 103 { char cnt = 0; addr <<= 1; TOSH_CLR_CC_PALE_PIN(); for (cnt = 0; cnt < 7; cnt++) { if (addr & 0x80) { TOSH_SET_CC_PDATA_PIN(); } else { #line 114 TOSH_CLR_CC_PDATA_PIN(); } #line 115 TOSH_CLR_CC_PCLK_PIN(); TOSH_SET_CC_PCLK_PIN(); addr <<= 1; } TOSH_SET_CC_PDATA_PIN(); TOSH_CLR_CC_PCLK_PIN(); TOSH_SET_CC_PCLK_PIN(); TOSH_SET_CC_PALE_PIN(); for (cnt = 0; cnt < 8; cnt++) { if (data & 0x80) { TOSH_SET_CC_PDATA_PIN(); } else { #line 131 TOSH_CLR_CC_PDATA_PIN(); } #line 132 TOSH_CLR_CC_PCLK_PIN(); TOSH_SET_CC_PCLK_PIN(); data <<= 1; } TOSH_SET_CC_PALE_PIN(); TOSH_SET_CC_PDATA_PIN(); TOSH_SET_CC_PCLK_PIN(); return SUCCESS; } static #line 156 uint8_t HPLCC1000M$HPLCC1000$read(uint8_t addr) #line 156 { int cnt; uint8_t din; uint8_t data = 0; addr <<= 1; TOSH_CLR_CC_PALE_PIN(); for (cnt = 0; cnt < 7; cnt++) { if (addr & 0x80) { TOSH_SET_CC_PDATA_PIN(); } else { #line 169 TOSH_CLR_CC_PDATA_PIN(); } #line 170 TOSH_CLR_CC_PCLK_PIN(); TOSH_SET_CC_PCLK_PIN(); addr <<= 1; } TOSH_CLR_CC_PDATA_PIN(); TOSH_CLR_CC_PCLK_PIN(); TOSH_SET_CC_PCLK_PIN(); TOSH_MAKE_CC_PDATA_INPUT(); TOSH_SET_CC_PALE_PIN(); for (cnt = 7; cnt >= 0; cnt--) { TOSH_CLR_CC_PCLK_PIN(); din = TOSH_READ_CC_PDATA_PIN(); if (din) { data = (data << 1) | 0x01; } else { #line 189 data = (data << 1) & 0xfe; } #line 190 TOSH_SET_CC_PCLK_PIN(); } TOSH_SET_CC_PALE_PIN(); TOSH_MAKE_CC_PDATA_OUTPUT(); TOSH_SET_CC_PDATA_PIN(); return data; } static # 89 "c:/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" void HPLADCM$init_portmap(void) #line 89 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 91 { if (HPLADCM$init_portmap_done == FALSE) { int i; #line 94 for (i = 0; i < TOSH_ADC_PORTMAPSIZE; i++) HPLADCM$TOSH_adc_portmap[i] = i; HPLADCM$TOSH_adc_portmap[TOS_ADC_BANDGAP_PORT] = TOSH_ACTUAL_BANDGAP_PORT; HPLADCM$TOSH_adc_portmap[TOS_ADC_GND_PORT] = TOSH_ACTUAL_GND_PORT; HPLADCM$init_portmap_done = TRUE; } } #line 102 __nesc_atomic_end(__nesc_atomic); } } static # 172 "c:/tinyos-1.x/tos/platform/mica/HPLClock.nc" result_t HPLClock$Clock$setRate(char interval, char scale) #line 172 { scale &= 0x7; scale |= 0x8; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 175 { * (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 185 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } static # 209 "c:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$CC1000Control$RxMode(void) #line 209 { CC1000ControlM$HPLChipcon$write(0x00, ( 1 << 4) | (1 << 0)); CC1000ControlM$HPLChipcon$write(0x09, ({ #line 215 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[CC1000ControlM$tunefreq][0x09]; #line 215 unsigned char __result; #line 215 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )); #line 216 CC1000ControlM$HPLChipcon$write(0x0B, 0x00); TOSH_uwait(250); return SUCCESS; } static # 87 "c:/tinyos-1.x/tos/platform/mica2/HPLPowerManagementM.nc" uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void) #line 87 { uint8_t mcu; #line 89 if (!HPLPowerManagementM$disabled) { TOS_post(HPLPowerManagementM$doAdjustment); } else #line 91 { mcu = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20); mcu &= 0xe3; mcu |= HPLPowerManagementM$IDLE; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) = mcu; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) |= 1 << 5; } return 0; } static # 336 "c:/tinyos-1.x/tos/system/LogicalTimeM.nc" result_t LogicalTimeM$Timer$start(uint8_t id, char type, uint32_t interval) #line 337 { uint8_t mInterval = LogicalTimeM$Clock$getInterval(); #line 339 { } #line 339 ; if (id > NUM_TIMERS) { { } #line 341 ; return FAIL; } if (type > 1) { { } #line 345 ; return FAIL; } { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 348 { LogicalTimeM$mTimerList[id].ticksLeft = --interval; LogicalTimeM$mTimerList[id].ticks = interval; LogicalTimeM$mTimerList[id].type = type; LogicalTimeM$mState |= 0x1 << id; if (interval < mInterval) { LogicalTimeM$Clock$setInterval(interval); { } #line 356 ; } } #line 358 __nesc_atomic_end(__nesc_atomic); } { } #line 359 ; return SUCCESS; } # 253 "c:/tinyos-1.x/tos/system/AMStandard.nc" TOS_MsgPtr received(TOS_MsgPtr packet) #line 253 { uint16_t addr = TOS_LOCAL_ADDRESS; #line 255 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 255 { AMStandard$counter++; } #line 257 __nesc_atomic_end(__nesc_atomic); } { } #line 258 ; if (packet->group == TOS_AM_GROUP && ( packet->addr == TOS_BCAST_ADDR || packet->addr == addr)) { uint8_t type = packet->type; TOS_MsgPtr tmp; { } #line 269 ; AMStandard$dbgPacket(packet); { } #line 271 ; tmp = AMStandard$ReceiveMsg$receive(type, packet); if (tmp) { packet = tmp; } } #line 278 return packet; } # 175 "c:/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" void __attribute((interrupt)) __vector_21(void) #line 175 { uint16_t data = * (volatile unsigned int *)(unsigned int )& * (volatile unsigned char *)(0x04 + 0x20); #line 177 data &= 0x3ff; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) |= 1 << 4; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) &= ~(1 << 7); HPLADCM$ADC$dataReady(data); } static #line 150 result_t HPLADCM$ADC$samplePort(uint8_t port) #line 150 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 151 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x07 + 0x20) = HPLADCM$TOSH_adc_portmap[port] & 0x1F; } #line 153 __nesc_atomic_end(__nesc_atomic); } * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) |= 1 << 7; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) |= 1 << 3; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) |= 1 << 6; return SUCCESS; } static # 472 "c:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" result_t CC1000RadioIntM$SpiByteFifo$dataReady(uint8_t data_in) #line 472 { if (CC1000RadioIntM$bInvertRxData) { data_in = ~data_in; } switch (CC1000RadioIntM$RadioState) { case CC1000RadioIntM$TX_STATE: { CC1000RadioIntM$SpiByteFifo$writeByte(CC1000RadioIntM$NextTxByte); CC1000RadioIntM$TxByteCnt++; switch (CC1000RadioIntM$RadioTxState) { case CC1000RadioIntM$TXSTATE_PREAMBLE: if (!(CC1000RadioIntM$TxByteCnt < CC1000RadioIntM$preamblelen)) { CC1000RadioIntM$NextTxByte = CC1000RadioIntM$SYNC_BYTE; CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_SYNC; } break; case CC1000RadioIntM$TXSTATE_SYNC: CC1000RadioIntM$NextTxByte = CC1000RadioIntM$NSYNC_BYTE; CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_DATA; CC1000RadioIntM$TxByteCnt = -1; CC1000RadioIntM$RadioSendCoordinator$startSymbol(); break; case CC1000RadioIntM$TXSTATE_DATA: if ((uint8_t )CC1000RadioIntM$TxByteCnt < CC1000RadioIntM$txlength) { CC1000RadioIntM$NextTxByte = ((uint8_t *)CC1000RadioIntM$txbufptr)[CC1000RadioIntM$TxByteCnt]; CC1000RadioIntM$usRunningCRC = crcByte(CC1000RadioIntM$usRunningCRC, CC1000RadioIntM$NextTxByte); CC1000RadioIntM$RadioSendCoordinator$byte(CC1000RadioIntM$txbufptr, (uint8_t )CC1000RadioIntM$TxByteCnt); } else { CC1000RadioIntM$NextTxByte = (uint8_t )CC1000RadioIntM$usRunningCRC; CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_CRC; } break; case CC1000RadioIntM$TXSTATE_CRC: CC1000RadioIntM$NextTxByte = (uint8_t )(CC1000RadioIntM$usRunningCRC >> 8); CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_FLUSH; CC1000RadioIntM$TxByteCnt = 0; break; case CC1000RadioIntM$TXSTATE_FLUSH: if (CC1000RadioIntM$TxByteCnt > 3) { CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_DONE; } break; case CC1000RadioIntM$TXSTATE_DONE: default: CC1000RadioIntM$SpiByteFifo$rxMode(); CC1000RadioIntM$CC1000Control$RxMode(); CC1000RadioIntM$bTxPending = FALSE; if (TOS_post(CC1000RadioIntM$PacketSent)) { CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; } break; } } break; case CC1000RadioIntM$DISABLED_STATE: break; case CC1000RadioIntM$IDLE_STATE: { if (data_in == 0xaa || data_in == 0x55) { CC1000RadioIntM$PreambleCount++; if (CC1000RadioIntM$PreambleCount > ({ #line 547 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_ValidPrecursor[CC1000RadioIntM$lplpower]; #line 547 unsigned char __result; #line 547 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )) #line 547 { CC1000RadioIntM$PreambleCount = CC1000RadioIntM$SOFCount = 0; CC1000RadioIntM$RxBitOffset = CC1000RadioIntM$RxByteCnt = 0; CC1000RadioIntM$usRunningCRC = 0; CC1000RadioIntM$rxlength = MSG_DATA_SIZE - 2; CC1000RadioIntM$RadioState = CC1000RadioIntM$SYNC_STATE; } } else { #line 555 if (CC1000RadioIntM$bTxPending && --CC1000RadioIntM$sMacDelay <= 0) { CC1000RadioIntM$bRSSIValid = FALSE; CC1000RadioIntM$RSSIADC$getData(); CC1000RadioIntM$PreambleCount = 0; CC1000RadioIntM$RadioState = CC1000RadioIntM$PRETX_STATE; } } } break; case CC1000RadioIntM$PRETX_STATE: { if (data_in == 0xaa || data_in == 0x55) { CC1000RadioIntM$sMacDelay = ((CC1000RadioIntM$Random$rand() & 0xf) + 1) * MSG_DATA_SIZE; CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; } else { #line 581 if (CC1000RadioIntM$bRSSIValid) { if (CC1000RadioIntM$usRSSIVal > ({ #line 582 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SquelchInit[CC1000RadioIntM$lplpower]; #line 582 unsigned char __result; #line 582 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )) #line 582 { CC1000RadioIntM$CC1000Control$TxMode(); CC1000RadioIntM$SpiByteFifo$txMode(); CC1000RadioIntM$TxByteCnt = 0; CC1000RadioIntM$usRunningCRC = 0; CC1000RadioIntM$RadioState = CC1000RadioIntM$TX_STATE; CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_PREAMBLE; CC1000RadioIntM$NextTxByte = 0xaa; CC1000RadioIntM$SpiByteFifo$writeByte(0xaa); } else { CC1000RadioIntM$sMacDelay = ((CC1000RadioIntM$Random$rand() & 0xf) + 1) * MSG_DATA_SIZE; CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; } } } } #line 600 break; case CC1000RadioIntM$SYNC_STATE: { uint8_t i; if (data_in == 0xaa || data_in == 0x55) { CC1000RadioIntM$RxShiftBuf.MSB = data_in; } else { uint16_t usTmp; #line 623 switch (CC1000RadioIntM$SOFCount) { case 0: CC1000RadioIntM$RxShiftBuf.LSB = data_in; break; case 1: case 2: usTmp = CC1000RadioIntM$RxShiftBuf.W; CC1000RadioIntM$RxShiftBuf.W <<= 8; CC1000RadioIntM$RxShiftBuf.LSB = data_in; for (i = 0; i < 8; i++) { usTmp <<= 1; if (data_in & 0x80) { usTmp |= 0x1; } #line 639 data_in <<= 1; if (usTmp == CC1000RadioIntM$SYNC_WORD) { CC1000RadioIntM$RadioState = CC1000RadioIntM$RX_STATE; CC1000RadioIntM$RSSIADC$getData(); CC1000RadioIntM$RxBitOffset = 7 - i; CC1000RadioIntM$RadioReceiveCoordinator$startSymbol(); break; } } break; default: CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; break; } CC1000RadioIntM$SOFCount++; } } break; case CC1000RadioIntM$RX_STATE: { char Byte; CC1000RadioIntM$RxShiftBuf.W <<= 8; CC1000RadioIntM$RxShiftBuf.LSB = data_in; Byte = CC1000RadioIntM$RxShiftBuf.W >> CC1000RadioIntM$RxBitOffset; ((char *)CC1000RadioIntM$rxbufptr)[(int )CC1000RadioIntM$RxByteCnt] = Byte; CC1000RadioIntM$RxByteCnt++; CC1000RadioIntM$RadioReceiveCoordinator$byte(CC1000RadioIntM$rxbufptr, (uint8_t )CC1000RadioIntM$RxByteCnt); if (CC1000RadioIntM$RxByteCnt < CC1000RadioIntM$rxlength) { CC1000RadioIntM$usRunningCRC = crcByte(CC1000RadioIntM$usRunningCRC, Byte); if (CC1000RadioIntM$RxByteCnt == (size_t )& ((struct TOS_Msg *)0)->length + sizeof ((struct TOS_Msg *)0)->length) { CC1000RadioIntM$rxlength = CC1000RadioIntM$rxbufptr->length; if (CC1000RadioIntM$rxlength > 29) { CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; return SUCCESS; } CC1000RadioIntM$rxlength += (size_t )& ((struct TOS_Msg *)0)->data; } } else { #line 703 if (CC1000RadioIntM$RxByteCnt == CC1000RadioIntM$rxlength) { CC1000RadioIntM$usRunningCRC = crcByte(CC1000RadioIntM$usRunningCRC, Byte); CC1000RadioIntM$RxByteCnt = (size_t )& ((struct TOS_Msg *)0)->crc; } else { #line 708 if (CC1000RadioIntM$RxByteCnt >= MSG_DATA_SIZE) { if (CC1000RadioIntM$rxbufptr->crc == CC1000RadioIntM$usRunningCRC) { CC1000RadioIntM$rxbufptr->crc = 1; } else { CC1000RadioIntM$rxbufptr->crc = 0; } CC1000RadioIntM$SpiByteFifo$disableIntr(); CC1000RadioIntM$RadioState = CC1000RadioIntM$DISABLED_STATE; CC1000RadioIntM$rxbufptr->strength = CC1000RadioIntM$usRSSIVal; if (!TOS_post(CC1000RadioIntM$PacketRcvd)) { CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; CC1000RadioIntM$SpiByteFifo$enableIntr(); } } } } } break; default: break; } #line 754 return SUCCESS; } static # 167 "c:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$reportSendDone(TOS_MsgPtr msg, result_t success) #line 167 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 168 { AMStandard$state = FALSE; } #line 170 __nesc_atomic_end(__nesc_atomic); } AMStandard$SendMsg$sendDone(msg->type, msg, success); AMStandard$sendDone(); return SUCCESS; } static # 164 "c:/tinyos-1.x/tos/platform/mica2/ADCM.nc" result_t ADCM$startGet(uint8_t newState, uint8_t port) #line 164 { uint16_t PortMask; #line 165 uint16_t oldReqVector = 1; result_t Result = SUCCESS; if (port > TOSH_ADC_PORTMAPSIZE) { return FAIL; } PortMask = 1 << port; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 174 { if ((PortMask & ADCM$ReqVector) != 0) { Result = FAIL; } else { oldReqVector = ADCM$ReqVector; ADCM$ReqVector |= PortMask; if (newState == ADCM$CONTINUOUS_CONVERSION) { ADCM$ContReqMask |= PortMask; } if (oldReqVector == 0) { ADCM$ReqPort = port; } } } #line 190 __nesc_atomic_end(__nesc_atomic); } if (oldReqVector == 0) { Result = ADCM$HPLADC$samplePort(port); } return Result; } static # 93 "c:/tinyos-1.x/tos/system/RandomLFSR.nc" uint16_t RandomLFSR$Random$rand(void) #line 93 { bool endbit; uint16_t tmpShiftReg; #line 96 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 96 { tmpShiftReg = RandomLFSR$shiftReg; endbit = (tmpShiftReg & 0x8000) != 0; tmpShiftReg <<= 1; if (endbit) { tmpShiftReg ^= 0x100b; } #line 102 tmpShiftReg++; RandomLFSR$shiftReg = tmpShiftReg; tmpShiftReg = tmpShiftReg ^ RandomLFSR$mask; } #line 105 __nesc_atomic_end(__nesc_atomic); } return tmpShiftReg; } static # 106 "c:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" result_t HPLSpiM$SpiByteFifo$disableIntr(void) #line 106 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) &= ~(1 << 7); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) |= 1 << 0; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x18 + 0x20) &= ~(1 << 0); HPLSpiM$PowerManagement$adjustPower(); return SUCCESS; } # 190 "c:/tinyos-1.x/tos/platform/mica/HPLClock.nc" void __attribute((interrupt)) __vector_15(void) #line 190 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 191 { if (HPLClock$set_flag) { HPLClock$mscale = HPLClock$nextScale; HPLClock$nextScale |= 0x8; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x33 + 0x20) = HPLClock$nextScale; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20) = HPLClock$minterval; HPLClock$set_flag = 0; } } #line 200 __nesc_atomic_end(__nesc_atomic); } HPLClock$Clock$fire(); } static # 100 "c:/tinyos-1.x/tos/system/TimeUtilC.nc" tos_time_t TimeUtilC$TimeUtil$addUint32(tos_time_t a, uint32_t ms) #line 100 { tos_time_t result = a; #line 102 result.low32 += ms; if (result.low32 < a.low32) { result.high32++; } return result; } static #line 54 char TimeUtilC$TimeUtil$compare(tos_time_t a, tos_time_t b) #line 54 { if (a.high32 > b.high32) { #line 55 return 1; } #line 56 if (a.high32 < b.high32) { #line 56 return -1; } #line 57 if (a.low32 > b.low32) { #line 57 return 1; } #line 58 if (a.low32 < b.low32) { #line 58 return -1; } #line 59 return 0; } static # 357 "c:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$ByteComm$rxByteReady(uint8_t data, bool error, uint16_t strength) #line 358 { bool rxDone; { } #line 361 ; if (error) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 364 { NoCRCPacket$rxCount = 0; } #line 366 __nesc_atomic_end(__nesc_atomic); } return FAIL; } { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 369 { if (NoCRCPacket$rxCount == 0) { ((TOS_MsgPtr )NoCRCPacket$recPtr)->strength = strength; } if (NoCRCPacket$rxCount == (size_t )& ((TOS_Msg *)0)->type) { NoCRCPacket$rxLength = TOS_MsgLength(data); } NoCRCPacket$recPtr[NoCRCPacket$rxCount++] = data; rxDone = NoCRCPacket$rxCount == NoCRCPacket$rxLength; } #line 379 __nesc_atomic_end(__nesc_atomic); } if (rxDone) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 383 { NoCRCPacket$bufferIndex = NoCRCPacket$bufferIndex ^ 1; NoCRCPacket$recPtr = (uint8_t *)NoCRCPacket$bufferPtrs[NoCRCPacket$bufferIndex]; { } #line 386 ; NoCRCPacket$rxCount = 0; } #line 388 __nesc_atomic_end(__nesc_atomic); } TOS_post(NoCRCPacket$receiveTask); return FAIL; } return SUCCESS; } static # 110 "c:/tinyos-1.x/tos/system/UARTM.nc" result_t UARTM$HPLUART$putDone(void) #line 110 { bool oldState; #line 112 { } #line 112 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 114 { oldState = UARTM$state; UARTM$state = FALSE; } #line 117 __nesc_atomic_end(__nesc_atomic); } if (oldState) { UARTM$ByteComm$txDone(); UARTM$ByteComm$txByteReady(SUCCESS); } return SUCCESS; } static # 252 "c:/tinyos-1.x/tos/system/NoCRCPacket.nc" void NoCRCPacket$sendComplete(result_t success) #line 252 { uint8_t stateCopy; #line 254 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 254 { stateCopy = NoCRCPacket$state; } #line 256 __nesc_atomic_end(__nesc_atomic); } if (stateCopy == NoCRCPacket$PACKET) { if (success) { TOS_MsgPtr msg; #line 266 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 266 { msg = (TOS_MsgPtr )NoCRCPacket$sendPtr; msg->ack = TRUE; } #line 269 __nesc_atomic_end(__nesc_atomic); } TOS_post(NoCRCPacket$sendDoneSuccessTask); } else { TOS_post(NoCRCPacket$sendDoneFailTask); } } else { #line 276 if (stateCopy == NoCRCPacket$BYTES) { if (success) { TOS_post(NoCRCPacket$sendVarLenSuccessTask); } else { TOS_post(NoCRCPacket$sendVarLenFailTask); } } else { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 285 { NoCRCPacket$txCount = 0; NoCRCPacket$state = NoCRCPacket$IDLE; } #line 288 __nesc_atomic_end(__nesc_atomic); } } } }