#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); # 110 "c:/tinyos-1.x/tos/platform/mica2/hardware.h" 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_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_MAKE_CC_PDATA_OUTPUT(void); static __inline void TOSH_MAKE_CC_PCLK_OUTPUT(void); 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_MISO_INPUT(void); static __inline void TOSH_MAKE_SPI_OC1C_INPUT(void); static __inline void TOSH_MAKE_PW0_OUTPUT(void); static __inline void TOSH_SET_PW1_PIN(void); #line 144 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); # 68 "c:/tinyos-1.x/tos/lib/OscopeMsg.h" enum __nesc_unnamed4254 { BUFFER_SIZE = 10 }; struct OscopeMsg { uint16_t sourceMoteID; uint16_t lastSampleNumber; uint16_t channel; uint16_t data[BUFFER_SIZE]; }; struct OscopeResetMsg { }; enum __nesc_unnamed4255 { AM_OSCOPEMSG = 10, AM_OSCOPERESETMSG = 32 }; # 63 "c:/tinyos-1.x/tos/platform/mica128/Clock.h" enum __nesc_unnamed4256 { 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_unnamed4257 { DEFAULT_SCALE = 3, DEFAULT_INTERVAL = 127 }; # 65 "c:/tinyos-1.x/tos/interfaces/ADC.h" enum __nesc_unnamed4258 { TOS_ADCSample3750ns = 0, TOS_ADCSample7500ns = 1, TOS_ADCSample15us = 2, TOS_ADCSample30us = 3, TOS_ADCSample60us = 4, TOS_ADCSample120us = 5, TOS_ADCSample240us = 6, TOS_ADCSample480us = 7 }; # 70 "c:/tinyos-1.x/tos/sensorboards/basicsb/sensorboard.h" static __inline void TOSH_SET_PHOTO_CTL_PIN(void); #line 70 static __inline void TOSH_MAKE_PHOTO_CTL_OUTPUT(void); #line 84 enum __nesc_unnamed4259 { TOSH_ACTUAL_PHOTO_PORT = 6, TOSH_ACTUAL_TEMP_PORT = 5 }; enum __nesc_unnamed4260 { TOS_ADC_PHOTO_PORT = 1, TOS_ADC_TEMP_PORT = 2 }; # 71 "c:/tinyos-1.x/tos/system/AM.h" enum __nesc_unnamed4261 { TOS_BCAST_ADDR = 0xffff, TOS_UART_ADDR = 0x007e }; enum __nesc_unnamed4262 { 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_unnamed4263 { 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_unnamed4264 { TIMER_REPEAT = 0, TIMER_ONE_SHOT = 1, NUM_TIMERS = 1 }; # 3 "c:/tinyos-1.x/tos/interfaces/TosTime.h" typedef struct __nesc_unnamed4265 { uint32_t high32; uint32_t low32; } tos_time_t; # 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_0xa2ae930); 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 result_t OscilloscopeM$DataMsg$sendDone(TOS_MsgPtr arg_0xa2ea4b0, result_t arg_0xa2ea5f8); static result_t OscilloscopeM$Clock$fire(void); static TOS_MsgPtr OscilloscopeM$ResetCounterMsg$receive(TOS_MsgPtr arg_0xa2eb718); static result_t OscilloscopeM$ADC$dataReady(uint16_t arg_0xa2f92b0); static result_t OscilloscopeM$StdControl$init(void); static result_t OscilloscopeM$StdControl$start(void); static void HPLClock$Clock$setInterval(uint8_t arg_0xa2e1818); static uint8_t HPLClock$Clock$readCounter(void); static result_t HPLClock$Clock$setRate(char arg_0xa2e0d30, char arg_0xa2e0e68); static uint8_t HPLClock$Clock$getInterval(void); static result_t HPLClock$StdControl$init(void); static result_t HPLClock$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$yellowToggle(void); static result_t LedsC$Leds$redOn(void); static result_t PhotoM$StdControl$init(void); static result_t PhotoM$StdControl$start(void); static result_t ADCM$HPLADC$dataReady(uint16_t arg_0xa35ebf0); static result_t ADCM$ADCControl$bindPort(uint8_t arg_0xa34ab30, uint8_t arg_0xa34ac70); static result_t ADCM$ADCControl$init(void); static result_t ADCM$ADC$getData(uint8_t arg_0xa34de40); static result_t ADCM$ADC$default$dataReady(uint8_t arg_0xa34de40, uint16_t arg_0xa2f92b0); static result_t HPLADCM$ADC$bindPort(uint8_t arg_0xa353a80, uint8_t arg_0xa353bc0); static result_t HPLADCM$ADC$init(void); static result_t HPLADCM$ADC$samplePort(uint8_t arg_0xa35e0e8); static TOS_MsgPtr AMStandard$ReceiveMsg$default$receive(uint8_t arg_0xa38ecc0, TOS_MsgPtr arg_0xa2eb718); static result_t AMStandard$ActivityTimer$fired(void); static result_t AMStandard$UARTSend$sendDone(TOS_MsgPtr arg_0xa392b48, result_t arg_0xa392c90); 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$SendMsg$send(uint8_t arg_0xa38e728, uint16_t arg_0xa2fddf8, uint8_t arg_0xa2fdf38, TOS_MsgPtr arg_0xa2ea0a0); static result_t AMStandard$SendMsg$default$sendDone(uint8_t arg_0xa38e728, TOS_MsgPtr arg_0xa2ea4b0, result_t arg_0xa2ea5f8); static TOS_MsgPtr AMStandard$UARTReceive$receive(TOS_MsgPtr arg_0xa2eb718); static result_t LogicalTimeM$AbsoluteTimer$default$fired(uint8_t arg_0xa3da178); 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_0xa3d7b20); static result_t LogicalTimeM$Timer$start(uint8_t arg_0xa3d7b20, char arg_0xa39ec80, uint32_t arg_0xa39edd0); static tos_time_t TimeUtilC$TimeUtil$addint32(tos_time_t arg_0xa3cbdf8, int32_t arg_0xa3cbf38); static tos_time_t TimeUtilC$TimeUtil$addUint32(tos_time_t arg_0xa3c84a8, uint32_t arg_0xa3c85f0); static tos_time_t TimeUtilC$TimeUtil$subtract(tos_time_t arg_0xa3c9d48, tos_time_t arg_0xa3c9e90); static char TimeUtilC$TimeUtil$compare(tos_time_t arg_0xa3c91d0, tos_time_t arg_0xa3c9318); static result_t PacketSink$Send$send(TOS_MsgPtr arg_0xa392640); static result_t PacketSink$Control$init(void); static result_t PacketSink$Control$start(void); static result_t NoCRCPacket$Send$send(TOS_MsgPtr arg_0xa392640); static result_t NoCRCPacket$SendVarLenPacket$default$sendDone(uint8_t *arg_0xa428810, result_t arg_0xa428958); static result_t NoCRCPacket$ByteComm$txDone(void); static result_t NoCRCPacket$ByteComm$txByteReady(bool arg_0xa426d88); static result_t NoCRCPacket$ByteComm$rxByteReady(uint8_t arg_0xa4265d8, bool arg_0xa426718, uint16_t arg_0xa426868); static result_t NoCRCPacket$Control$init(void); static result_t NoCRCPacket$Control$start(void); static result_t NoCRCPacket$txBytes(uint8_t *arg_0xa429130, uint8_t arg_0xa429278); static result_t UARTM$HPLUART$get(uint8_t arg_0xa452968); static result_t UARTM$HPLUART$putDone(void); static result_t UARTM$ByteComm$txByte(uint8_t arg_0xa426158); 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_0xa452478); static uint8_t HPLPowerManagementM$PowerManagement$adjustPower(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_0xa2ae930); 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 # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t OscilloscopeM$SensorControl$init(void); static result_t OscilloscopeM$SensorControl$start(void); static # 72 "c:/tinyos-1.x/tos/interfaces/SendMsg.nc" result_t OscilloscopeM$DataMsg$send(uint16_t arg_0xa2fddf8, uint8_t arg_0xa2fdf38, TOS_MsgPtr arg_0xa2ea0a0); static # 122 "c:/tinyos-1.x/tos/interfaces/Clock.nc" result_t OscilloscopeM$Clock$setRate(char arg_0xa2e0d30, char arg_0xa2e0e68); static # 149 "c:/tinyos-1.x/tos/interfaces/Leds.nc" result_t OscilloscopeM$Leds$yellowOff(void); static #line 83 result_t OscilloscopeM$Leds$init(void); static #line 124 result_t OscilloscopeM$Leds$greenOff(void); static #line 99 result_t OscilloscopeM$Leds$redOff(void); static #line 158 result_t OscilloscopeM$Leds$yellowToggle(void); static #line 91 result_t OscilloscopeM$Leds$redOn(void); static # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t OscilloscopeM$CommControl$init(void); static result_t OscilloscopeM$CommControl$start(void); static # 82 "c:/tinyos-1.x/tos/interfaces/ADC.nc" result_t OscilloscopeM$ADC$getData(void); # 91 "OscilloscopeM.nc" uint8_t OscilloscopeM$packetReadingNumber; uint16_t OscilloscopeM$readingNumber; TOS_Msg OscilloscopeM$msg[2]; uint8_t OscilloscopeM$currentMsg; static inline result_t OscilloscopeM$StdControl$init(void); static inline #line 121 result_t OscilloscopeM$StdControl$start(void); static inline #line 145 result_t OscilloscopeM$ADC$dataReady(uint16_t data); static inline #line 184 result_t OscilloscopeM$DataMsg$sendDone(TOS_MsgPtr sent, result_t success); static inline result_t OscilloscopeM$Clock$fire(void); static inline TOS_MsgPtr OscilloscopeM$ResetCounterMsg$receive(TOS_MsgPtr m); 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); # 73 "c:/tinyos-1.x/tos/system/LedsC.nc" uint8_t LedsC$ledsOn; enum LedsC$__nesc_unnamed4267 { 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 130 result_t LedsC$Leds$greenOff(void); static inline #line 150 result_t LedsC$Leds$yellowOn(void); static inline result_t LedsC$Leds$yellowOff(void); static inline result_t LedsC$Leds$yellowToggle(void); static # 116 "c:/tinyos-1.x/tos/interfaces/ADCControl.nc" result_t PhotoM$ADCControl$bindPort(uint8_t arg_0xa34ab30, uint8_t arg_0xa34ac70); static #line 77 result_t PhotoM$ADCControl$init(void); static inline # 89 "c:/tinyos-1.x/tos/sensorboards/basicsb/PhotoM.nc" result_t PhotoM$StdControl$init(void); static inline result_t PhotoM$StdControl$start(void); static # 97 "c:/tinyos-1.x/tos/interfaces/HPLADC.nc" result_t ADCM$HPLADC$bindPort(uint8_t arg_0xa353a80, uint8_t arg_0xa353bc0); static #line 81 result_t ADCM$HPLADC$init(void); static #line 104 result_t ADCM$HPLADC$samplePort(uint8_t arg_0xa35e0e8); 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_0xa34de40, # 100 "c:/tinyos-1.x/tos/interfaces/ADC.nc" uint16_t arg_0xa2f92b0); # 92 "c:/tinyos-1.x/tos/platform/mica2/ADCM.nc" enum ADCM$__nesc_unnamed4268 { 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 inline #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_0xa35ebf0); # 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 # 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_0xa38ecc0, # 106 "c:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" TOS_MsgPtr arg_0xa2eb718); static # 90 "c:/tinyos-1.x/tos/interfaces/Timer.nc" result_t AMStandard$ActivityTimer$start(char arg_0xa39ec80, uint32_t arg_0xa39edd0); static # 85 "c:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" result_t AMStandard$UARTSend$send(TOS_MsgPtr arg_0xa392640); 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 # 85 "c:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" result_t AMStandard$RadioSend$send(TOS_MsgPtr arg_0xa392640); 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_0xa38e728, # 73 "c:/tinyos-1.x/tos/interfaces/SendMsg.nc" TOS_MsgPtr arg_0xa2ea4b0, result_t arg_0xa2ea5f8); # 105 "c:/tinyos-1.x/tos/system/AMStandard.nc" bool AMStandard$state; TOS_MsgPtr AMStandard$buffer; 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 void AMStandard$sendTask(void); static inline #line 209 result_t AMStandard$SendMsg$send(uint8_t id, uint16_t addr, uint8_t length, TOS_MsgPtr data); static inline #line 245 result_t AMStandard$UARTSend$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 # 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_0xa3da178); static # 59 "c:/tinyos-1.x/tos/interfaces/TimeUtil.nc" tos_time_t LogicalTimeM$TimeUtil$addint32(tos_time_t arg_0xa3cbdf8, int32_t arg_0xa3cbf38); static tos_time_t LogicalTimeM$TimeUtil$addUint32(tos_time_t arg_0xa3c84a8, uint32_t arg_0xa3c85f0); static #line 97 tos_time_t LogicalTimeM$TimeUtil$subtract(tos_time_t arg_0xa3c9d48, tos_time_t arg_0xa3c9e90); static #line 87 char LogicalTimeM$TimeUtil$compare(tos_time_t arg_0xa3c91d0, tos_time_t arg_0xa3c9318); 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_0xa2e1818); 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_0xa3d7b20); #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 inline 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); static inline # 84 "c:/tinyos-1.x/tos/system/PacketSink.nc" result_t PacketSink$Control$init(void); static inline result_t PacketSink$Control$start(void); static inline #line 101 result_t PacketSink$Send$send(TOS_MsgPtr msg); static # 94 "c:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" result_t NoCRCPacket$Send$sendDone(TOS_MsgPtr arg_0xa392b48, result_t arg_0xa392c90); static # 89 "c:/tinyos-1.x/tos/interfaces/SendVarLenPacket.nc" result_t NoCRCPacket$SendVarLenPacket$sendDone(uint8_t *arg_0xa428810, result_t arg_0xa428958); static # 106 "c:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" TOS_MsgPtr NoCRCPacket$Receive$receive(TOS_MsgPtr arg_0xa2eb718); static # 82 "c:/tinyos-1.x/tos/interfaces/ByteComm.nc" result_t NoCRCPacket$ByteComm$txByte(uint8_t arg_0xa426158); 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_unnamed4269 { 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 result_t NoCRCPacket$txBytes(uint8_t *bytes, uint8_t numBytes); static inline #line 171 result_t NoCRCPacket$Send$send(TOS_MsgPtr msg); 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_0xa452478); 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_0xa426d88); static #line 93 result_t UARTM$ByteComm$rxByteReady(uint8_t arg_0xa4265d8, bool arg_0xa426718, uint16_t arg_0xa426868); # 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 #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_0xa452968); 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); # 37 "c:/tinyos-1.x/tos/platform/mica2/HPLPowerManagementM.nc" bool HPLPowerManagementM$disabled = TRUE; enum HPLPowerManagementM$__nesc_unnamed4270 { 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 inline #line 87 uint8_t HPLPowerManagementM$PowerManagement$adjustPower(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_0xa2ae930){ #line 105 unsigned char result; #line 105 #line 105 result = PotM$Pot$init(arg_0xa2ae930); #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; } # 122 "c:/tinyos-1.x/tos/interfaces/Clock.nc" inline static result_t OscilloscopeM$Clock$setRate(char arg_0xa2e0d30, char arg_0xa2e0e68){ #line 122 unsigned char result; #line 122 #line 122 result = HPLClock$Clock$setRate(arg_0xa2e0d30, arg_0xa2e0e68); #line 122 #line 122 return result; #line 122 } #line 122 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; } static inline # 84 "c:/tinyos-1.x/tos/system/PacketSink.nc" result_t PacketSink$Control$init(void) #line 84 { 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 = PacketSink$Control$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 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 static inline # 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; } # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" 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 OscilloscopeM$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 # 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 PhotoM$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 # 144 "c:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_PW1_PIN(void) #line 144 { #line 144 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x15 + 0x20) |= 1 << 1; } # 70 "c:/tinyos-1.x/tos/sensorboards/basicsb/sensorboard.h" static __inline void TOSH_SET_PHOTO_CTL_PIN(void) #line 70 { #line 70 TOSH_SET_PW1_PIN(); } #line 70 static __inline void TOSH_MAKE_PHOTO_CTL_OUTPUT(void) #line 70 { } 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_0xa353a80, uint8_t arg_0xa353bc0){ #line 97 unsigned char result; #line 97 #line 97 result = HPLADCM$ADC$bindPort(arg_0xa353a80, arg_0xa353bc0); #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 PhotoM$ADCControl$bindPort(uint8_t arg_0xa34ab30, uint8_t arg_0xa34ac70){ #line 116 unsigned char result; #line 116 #line 116 result = ADCM$ADCControl$bindPort(arg_0xa34ab30, arg_0xa34ac70); #line 116 #line 116 return result; #line 116 } #line 116 static inline # 89 "c:/tinyos-1.x/tos/sensorboards/basicsb/PhotoM.nc" result_t PhotoM$StdControl$init(void) #line 89 { PhotoM$ADCControl$bindPort(TOS_ADC_PHOTO_PORT, TOSH_ACTUAL_PHOTO_PORT); TOSH_MAKE_PHOTO_CTL_OUTPUT(); TOSH_SET_PHOTO_CTL_PIN(); { } #line 93 ; return PhotoM$ADCControl$init(); } # 52 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t OscilloscopeM$SensorControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = PhotoM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 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 OscilloscopeM$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 # 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 OscilloscopeM$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 # 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 OscilloscopeM$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 # 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 OscilloscopeM$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 # 99 "OscilloscopeM.nc" result_t OscilloscopeM$StdControl$init(void) #line 99 { OscilloscopeM$Leds$init(); OscilloscopeM$Leds$yellowOff(); #line 101 OscilloscopeM$Leds$redOff(); #line 101 OscilloscopeM$Leds$greenOff(); OscilloscopeM$SensorControl$init(); OscilloscopeM$CommControl$init(); OscilloscopeM$Clock$setRate(TOS_I8PS, TOS_S8PS); OscilloscopeM$currentMsg = 0; OscilloscopeM$packetReadingNumber = 0; OscilloscopeM$readingNumber = 0; { } #line 113 ; 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 = OscilloscopeM$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 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))); } 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; } static inline 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; } # 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_0xa39ec80, uint32_t arg_0xa39edd0){ #line 90 unsigned char result; #line 90 #line 90 result = LogicalTimeM$Timer$start(0, arg_0xa39ec80, arg_0xa39edd0); #line 90 #line 90 return result; #line 90 } #line 90 static inline # 88 "c:/tinyos-1.x/tos/system/PacketSink.nc" result_t PacketSink$Control$start(void) #line 88 { 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 = PacketSink$Control$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 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 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 OscilloscopeM$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 # 97 "c:/tinyos-1.x/tos/sensorboards/basicsb/PhotoM.nc" result_t PhotoM$StdControl$start(void) #line 97 { TOSH_MAKE_PHOTO_CTL_OUTPUT(); TOSH_SET_PHOTO_CTL_PIN(); return SUCCESS; } # 59 "c:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t OscilloscopeM$SensorControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = PhotoM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 121 "OscilloscopeM.nc" result_t OscilloscopeM$StdControl$start(void) #line 121 { OscilloscopeM$SensorControl$start(); OscilloscopeM$CommControl$start(); 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 = OscilloscopeM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 # 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(); } # 104 "c:/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t ADCM$HPLADC$samplePort(uint8_t arg_0xa35e0e8){ #line 104 unsigned char result; #line 104 #line 104 result = HPLADCM$ADC$samplePort(arg_0xa35e0e8); #line 104 #line 104 return result; #line 104 } #line 104 static inline # 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 inline 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 OscilloscopeM$ADC$getData(void){ #line 82 unsigned char result; #line 82 #line 82 result = ADCM$ADC$getData(TOS_ADC_PHOTO_PORT); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 192 "OscilloscopeM.nc" result_t OscilloscopeM$Clock$fire(void) #line 192 { return OscilloscopeM$ADC$getData(); } 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_0xa2e1818){ #line 131 HPLClock$Clock$setInterval(arg_0xa2e1818); #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; } 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_0xa3d7b20){ #line 104 unsigned char result; #line 104 #line 104 switch (arg_0xa3d7b20) { #line 104 case 0: #line 104 result = AMStandard$ActivityTimer$fired(); #line 104 break; #line 104 default: #line 104 result = LogicalTimeM$Timer$default$fired(arg_0xa3d7b20); #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_0xa3c9d48, tos_time_t arg_0xa3c9e90){ #line 97 struct __nesc_unnamed4265 result; #line 97 #line 97 result = TimeUtilC$TimeUtil$subtract(arg_0xa3c9d48, arg_0xa3c9e90); #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_0xa3c84a8, uint32_t arg_0xa3c85f0){ #line 70 struct __nesc_unnamed4265 result; #line 70 #line 70 result = TimeUtilC$TimeUtil$addUint32(arg_0xa3c84a8, arg_0xa3c85f0); #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_0xa3c91d0, tos_time_t arg_0xa3c9318){ #line 87 char result; #line 87 #line 87 result = TimeUtilC$TimeUtil$compare(arg_0xa3c91d0, arg_0xa3c9318); #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_0xa3da178){ #line 66 unsigned char result; #line 66 #line 66 result = LogicalTimeM$AbsoluteTimer$default$fired(arg_0xa3da178); #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_0xa3cbdf8, int32_t arg_0xa3cbf38){ #line 59 struct __nesc_unnamed4265 result; #line 59 #line 59 result = TimeUtilC$TimeUtil$addint32(arg_0xa3cbdf8, arg_0xa3cbf38); #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 result = OscilloscopeM$Clock$fire(); #line 206 #line 206 return result; #line 206 } #line 206 # 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 OscilloscopeM$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 # 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; } static inline result_t LedsC$Leds$yellowToggle(void) #line 168 { result_t rval; #line 170 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 170 { if (LedsC$ledsOn & LedsC$YELLOW_BIT) { rval = LedsC$Leds$yellowOff(); } else { #line 174 rval = LedsC$Leds$yellowOn(); } } #line 176 __nesc_atomic_end(__nesc_atomic); } #line 176 return rval; } # 158 "c:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t OscilloscopeM$Leds$yellowToggle(void){ #line 158 unsigned char result; #line 158 #line 158 result = LedsC$Leds$yellowToggle(); #line 158 #line 158 return result; #line 158 } #line 158 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 # 101 "c:/tinyos-1.x/tos/system/PacketSink.nc" result_t PacketSink$Send$send(TOS_MsgPtr msg) #line 101 { return FAIL; } # 85 "c:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" inline static result_t AMStandard$RadioSend$send(TOS_MsgPtr arg_0xa392640){ #line 85 unsigned char result; #line 85 #line 85 result = PacketSink$Send$send(arg_0xa392640); #line 85 #line 85 return result; #line 85 } #line 85 # 82 "c:/tinyos-1.x/tos/interfaces/ByteComm.nc" inline static result_t NoCRCPacket$ByteComm$txByte(uint8_t arg_0xa426158){ #line 82 unsigned char result; #line 82 #line 82 result = UARTM$ByteComm$txByte(arg_0xa426158); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 144 "c:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$txBytes(uint8_t *bytes, uint8_t numBytes) #line 144 { uint8_t byteToSend = 0; bool send = FALSE; #line 147 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 147 { if (NoCRCPacket$txCount == 0) { NoCRCPacket$txCount = 1; NoCRCPacket$txLength = numBytes; NoCRCPacket$sendPtr = bytes; byteToSend = NoCRCPacket$sendPtr[0]; send = TRUE; } } #line 156 __nesc_atomic_end(__nesc_atomic); } if (send) { if (NoCRCPacket$ByteComm$txByte(byteToSend)) { return SUCCESS; } else #line 161 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 162 { NoCRCPacket$txCount = 0; } #line 164 __nesc_atomic_end(__nesc_atomic); } } } return FAIL; } 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 # 171 "c:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$Send$send(TOS_MsgPtr msg) #line 171 { uint8_t oldState; uint8_t *packet; uint8_t sendNum; result_t rval = FAIL; #line 176 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 176 { oldState = NoCRCPacket$state; if (NoCRCPacket$state == NoCRCPacket$IDLE) { NoCRCPacket$state = NoCRCPacket$PACKET; } packet = (uint8_t *)msg; sendNum = TOS_MsgLength(msg->type); } #line 183 __nesc_atomic_end(__nesc_atomic); } if (oldState == NoCRCPacket$IDLE) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 185 { msg->crc = 1; rval = NoCRCPacket$txBytes(packet, sendNum); } #line 188 __nesc_atomic_end(__nesc_atomic); } } return rval; } # 85 "c:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" inline static result_t AMStandard$UARTSend$send(TOS_MsgPtr arg_0xa392640){ #line 85 unsigned char result; #line 85 #line 85 result = NoCRCPacket$Send$send(arg_0xa392640); #line 85 #line 85 return result; #line 85 } #line 85 static inline # 193 "c:/tinyos-1.x/tos/system/AMStandard.nc" void AMStandard$sendTask(void) #line 193 { result_t ok; TOS_MsgPtr buf; #line 196 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 196 { buf = AMStandard$buffer; } #line 198 __nesc_atomic_end(__nesc_atomic); } if (buf->addr == TOS_UART_ADDR) { ok = AMStandard$UARTSend$send(buf); } else { #line 202 ok = AMStandard$RadioSend$send(buf); } if (ok == FAIL) { AMStandard$reportSendDone(AMStandard$buffer, FAIL); } } static inline result_t AMStandard$SendMsg$send(uint8_t id, uint16_t addr, uint8_t length, TOS_MsgPtr data) #line 209 { bool oldState; #line 211 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 211 { oldState = AMStandard$state; AMStandard$state = TRUE; } #line 214 __nesc_atomic_end(__nesc_atomic); } if (!oldState) { if (length > DATA_LENGTH) { { } #line 218 ; return FAIL; } if (!TOS_post(AMStandard$sendTask)) { { } #line 222 ; return FAIL; } else { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 226 { AMStandard$state = TRUE; } #line 228 __nesc_atomic_end(__nesc_atomic); } } { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 230 { AMStandard$buffer = data; data->length = length; data->addr = addr; data->type = id; AMStandard$buffer->group = TOS_AM_GROUP; { } #line 236 ; AMStandard$dbgPacket(data); } #line 238 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } return FAIL; } # 72 "c:/tinyos-1.x/tos/interfaces/SendMsg.nc" inline static result_t OscilloscopeM$DataMsg$send(uint16_t arg_0xa2fddf8, uint8_t arg_0xa2fdf38, TOS_MsgPtr arg_0xa2ea0a0){ #line 72 unsigned char result; #line 72 #line 72 result = AMStandard$SendMsg$send(AM_OSCOPEMSG, arg_0xa2fddf8, arg_0xa2fdf38, arg_0xa2ea0a0); #line 72 #line 72 return result; #line 72 } #line 72 static inline # 145 "OscilloscopeM.nc" result_t OscilloscopeM$ADC$dataReady(uint16_t data) #line 145 { struct OscopeMsg *pack = (struct OscopeMsg *)OscilloscopeM$msg[OscilloscopeM$currentMsg].data; { } #line 148 ; pack->data[OscilloscopeM$packetReadingNumber++] = data; OscilloscopeM$readingNumber++; if (OscilloscopeM$packetReadingNumber == BUFFER_SIZE) { OscilloscopeM$packetReadingNumber = 0; pack->channel = 1; pack->lastSampleNumber = OscilloscopeM$readingNumber; pack->sourceMoteID = TOS_LOCAL_ADDRESS; if (OscilloscopeM$DataMsg$send(TOS_UART_ADDR, sizeof(struct OscopeMsg ), &OscilloscopeM$msg[OscilloscopeM$currentMsg])) { OscilloscopeM$currentMsg ^= 0x1; OscilloscopeM$Leds$yellowToggle(); } } if (data > 0x0300) { OscilloscopeM$Leds$redOn(); } else { #line 175 OscilloscopeM$Leds$redOff(); } 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_0xa34de40, uint16_t arg_0xa2f92b0){ #line 100 unsigned char result; #line 100 #line 100 switch (arg_0xa34de40) { #line 100 case TOS_ADC_PHOTO_PORT: #line 100 result = OscilloscopeM$ADC$dataReady(arg_0xa2f92b0); #line 100 break; #line 100 default: #line 100 result = ADCM$ADC$default$dataReady(arg_0xa34de40, arg_0xa2f92b0); #line 100 } #line 100 #line 100 return result; #line 100 } #line 100 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_0xa35ebf0){ #line 126 unsigned char result; #line 126 #line 126 result = ADCM$HPLADC$dataReady(arg_0xa35ebf0); #line 126 #line 126 return result; #line 126 } #line 126 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_0xa452478){ #line 107 unsigned char result; #line 107 #line 107 result = HPLUART0M$UART$put(arg_0xa452478); #line 107 #line 107 return result; #line 107 } #line 107 static inline # 184 "OscilloscopeM.nc" result_t OscilloscopeM$DataMsg$sendDone(TOS_MsgPtr sent, result_t success) #line 184 { return SUCCESS; } 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_0xa38e728, TOS_MsgPtr arg_0xa2ea4b0, result_t arg_0xa2ea5f8){ #line 73 unsigned char result; #line 73 #line 73 switch (arg_0xa38e728) { #line 73 case AM_OSCOPEMSG: #line 73 result = OscilloscopeM$DataMsg$sendDone(arg_0xa2ea4b0, arg_0xa2ea5f8); #line 73 break; #line 73 default: #line 73 result = AMStandard$SendMsg$default$sendDone(arg_0xa38e728, arg_0xa2ea4b0, arg_0xa2ea5f8); #line 73 } #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 # 93 "c:/tinyos-1.x/tos/interfaces/ByteComm.nc" inline static result_t UARTM$ByteComm$rxByteReady(uint8_t arg_0xa4265d8, bool arg_0xa426718, uint16_t arg_0xa426868){ #line 93 unsigned char result; #line 93 #line 93 result = NoCRCPacket$ByteComm$rxByteReady(arg_0xa4265d8, arg_0xa426718, arg_0xa426868); #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_0xa452968){ #line 115 unsigned char result; #line 115 #line 115 result = UARTM$HPLUART$get(arg_0xa452968); #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 # 200 "OscilloscopeM.nc" TOS_MsgPtr OscilloscopeM$ResetCounterMsg$receive(TOS_MsgPtr m) #line 200 { OscilloscopeM$readingNumber = 0; 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_0xa38ecc0, TOS_MsgPtr arg_0xa2eb718){ #line 106 struct TOS_Msg *result; #line 106 #line 106 switch (arg_0xa38ecc0) { #line 106 case AM_OSCOPERESETMSG: #line 106 result = OscilloscopeM$ResetCounterMsg$receive(arg_0xa2eb718); #line 106 break; #line 106 default: #line 106 result = AMStandard$ReceiveMsg$default$receive(arg_0xa38ecc0, arg_0xa2eb718); #line 106 } #line 106 #line 106 return result; #line 106 } #line 106 # 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; } static inline 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_0xa2eb718){ #line 106 struct TOS_Msg *result; #line 106 #line 106 result = AMStandard$UARTReceive$receive(arg_0xa2eb718); #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_0xa392b48, result_t arg_0xa392c90){ #line 94 unsigned char result; #line 94 #line 94 result = AMStandard$UARTSend$sendDone(arg_0xa392b48, arg_0xa392c90); #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_0xa428810, result_t arg_0xa428958){ #line 89 unsigned char result; #line 89 #line 89 result = NoCRCPacket$SendVarLenPacket$default$sendDone(arg_0xa428810, arg_0xa428958); #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 #line 304 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_0xa426d88){ #line 102 unsigned char result; #line 102 #line 102 result = NoCRCPacket$ByteComm$txByteReady(arg_0xa426d88); #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 # 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 # 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 # 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 # 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; } # 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 # 150 "c:/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" 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; } #line 175 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 # 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; } 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 # 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); } } } }