#define dbg(mode, format, ...) ((void)0) #define dbg_clear(mode, format, ...) ((void)0) #define dbg_active(mode) 0 # 60 "/usr/local/avr/include/inttypes.h" typedef signed char int8_t; typedef unsigned char uint8_t; # 83 "/usr/local/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 "/usr/local/lib/gcc-lib/avr/3.3-tinyos/include/stddef.h" 3 typedef unsigned int size_t; #line 325 typedef int wchar_t; # 60 "/usr/local/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 "/usr/local/lib/gcc-lib/avr/3.3-tinyos/include/stddef.h" 3 typedef int ptrdiff_t; # 85 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/tos.h" typedef unsigned char bool; enum __nesc_unnamed4244 { FALSE = 0, TRUE = 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); #line 128 enum __nesc_unnamed4246 { NULL = 0x0 }; # 81 "/usr/local/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; # 124 "C:/tinyos/cygwin/opt/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); static __inline void __nesc_enable_interrupt(void); # 116 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_RED_LED_PIN(void); #line 116 static __inline void TOSH_CLR_RED_LED_PIN(void); #line 116 static __inline void TOSH_MAKE_RED_LED_OUTPUT(void); static __inline void TOSH_SET_GREEN_LED_PIN(void); #line 117 static __inline void TOSH_CLR_GREEN_LED_PIN(void); #line 117 static __inline void TOSH_MAKE_GREEN_LED_OUTPUT(void); static __inline void TOSH_SET_YELLOW_LED_PIN(void); #line 118 static __inline void TOSH_CLR_YELLOW_LED_PIN(void); #line 118 static __inline void TOSH_MAKE_YELLOW_LED_OUTPUT(void); static __inline void TOSH_CLR_SERIAL_ID_PIN(void); #line 120 static __inline void TOSH_MAKE_SERIAL_ID_INPUT(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 131 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_SET_INT1_PIN(void); #line 138 static __inline void TOSH_MAKE_INT1_OUTPUT(void); static __inline void TOSH_CLR_INT2_PIN(void); #line 139 static __inline void TOSH_MAKE_INT2_INPUT(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_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 171 void TOSH_SET_PIN_DIRECTIONS(void ); #line 215 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 }; # 54 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/types/dbg_modes.h" typedef long long TOS_dbg_mode; 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 }; # 59 "C:/tinyos/cygwin/opt/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_wait(void ); static inline void TOSH_sleep(void ); static inline void TOSH_sched_init(void ); #line 98 bool TOS_post(void (*tp)(void)); static inline #line 139 bool TOSH_run_next_task(void); static inline #line 162 void TOSH_run_task(void); # 39 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Timer.h" enum __nesc_unnamed4254 { TIMER_REPEAT = 0, TIMER_ONE_SHOT = 1, NUM_TIMERS = 1 }; # 35 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADC.h" enum __nesc_unnamed4255 { TOS_ADCSample3750ns = 0, TOS_ADCSample7500ns = 1, TOS_ADCSample15us = 2, TOS_ADCSample30us = 3, TOS_ADCSample60us = 4, TOS_ADCSample120us = 5, TOS_ADCSample240us = 6, TOS_ADCSample480us = 7 }; # 45 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" enum __nesc_unnamed4256 { TOSH_ACTUAL_PHOTO_PORT = 1, TOSH_ACTUAL_TEMP_PORT = 1, TOSH_ACTUAL_MIC_PORT = 2, TOSH_ACTUAL_ACCEL_X_PORT = 3, TOSH_ACTUAL_ACCEL_Y_PORT = 4, TOSH_ACTUAL_MAG_X_PORT = 6, TOSH_ACTUAL_MAG_Y_PORT = 5 }; enum __nesc_unnamed4257 { TOS_ADC_PHOTO_PORT = 1, TOS_ADC_TEMP_PORT = 2, TOS_ADC_MIC_PORT = 3, TOS_ADC_ACCEL_X_PORT = 4, TOS_ADC_ACCEL_Y_PORT = 5, TOS_ADC_MAG_X_PORT = 6, TOS_ADC_MAG_Y_PORT = 8 }; enum __nesc_unnamed4258 { TOS_MAG_POT_ADDR = 0, TOS_MIC_POT_ADDR = 1 }; static __inline void TOSH_SET_PHOTO_CTL_PIN(void); #line 71 static __inline void TOSH_MAKE_PHOTO_CTL_OUTPUT(void); static __inline void TOSH_CLR_TEMP_CTL_PIN(void); #line 72 static __inline void TOSH_MAKE_TEMP_CTL_INPUT(void); # 33 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica128/Clock.h" enum __nesc_unnamed4259 { 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_unnamed4260 { DEFAULT_SCALE = 3, DEFAULT_INTERVAL = 127 }; static result_t PotM$Pot$init(uint8_t arg_0xa2c2240); 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 result_t SenseM$ADC$dataReady(uint16_t arg_0xa30c310); static result_t SenseM$StdControl$init(void); static result_t SenseM$StdControl$start(void); static result_t SenseM$Timer$fired(void); static result_t LedsC$Leds$yellowOff(void); static result_t LedsC$Leds$yellowOn(void); static result_t LedsC$Leds$init(void); static result_t LedsC$Leds$greenOff(void); static result_t LedsC$Leds$redOff(void); static result_t LedsC$Leds$redOn(void); static result_t LedsC$Leds$greenOn(void); static result_t TimerM$Clock$fire(void); static result_t TimerM$StdControl$init(void); static result_t TimerM$StdControl$start(void); static result_t TimerM$Timer$default$fired(uint8_t arg_0xa35a3d8); static result_t TimerM$Timer$start(uint8_t arg_0xa35a3d8, char arg_0xa2fb620, uint32_t arg_0xa2fb778); static void HPLClock$Clock$setInterval(uint8_t arg_0xa36c8c8); static result_t HPLClock$Clock$setRate(char arg_0xa373c38, char arg_0xa373d78); static uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void); static result_t PhotoTempM$PhotoStdControl$init(void); static result_t PhotoTempM$InternalTempADC$dataReady(uint16_t arg_0xa30c310); static result_t PhotoTempM$ExternalTempADC$default$dataReady(uint16_t arg_0xa30c310); static result_t PhotoTempM$ExternalPhotoADC$getData(void); static result_t PhotoTempM$InternalPhotoADC$dataReady(uint16_t arg_0xa30c310); static result_t ADCM$HPLADC$dataReady(uint16_t arg_0xa41b540); static result_t ADCM$ADCControl$bindPort(uint8_t arg_0xa3f1700, uint8_t arg_0xa3f1848); static result_t ADCM$ADCControl$init(void); static result_t ADCM$ADC$getData(uint8_t arg_0xa408560); static result_t ADCM$ADC$default$dataReady(uint8_t arg_0xa408560, uint16_t arg_0xa30c310); static result_t HPLADCM$ADC$bindPort(uint8_t arg_0xa41a3e8, uint8_t arg_0xa41a530); static result_t HPLADCM$ADC$sampleStop(void); static result_t HPLADCM$ADC$init(void); static result_t HPLADCM$ADC$samplePort(uint8_t arg_0xa41aa18); static # 47 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/RealMain.nc" result_t RealMain$hardwareInit(void); static # 78 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Pot.nc" result_t RealMain$Pot$init(uint8_t arg_0xa2c2240); static # 63 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc" result_t RealMain$StdControl$init(void); static result_t RealMain$StdControl$start(void); # 54 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/RealMain.nc" int main(void); static # 74 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLPot.nc" result_t PotM$HPLPot$finalise(void); static #line 59 result_t PotM$HPLPot$decrease(void); static result_t PotM$HPLPot$increase(void); # 91 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/PotM.nc" uint8_t PotM$potSetting; static inline void PotM$setPot(uint8_t value); static inline #line 106 result_t PotM$Pot$init(uint8_t initialSetting); static inline # 57 "C:/tinyos/cygwin/opt/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 # 57 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/avrmote/HPLInit.nc" result_t HPLInit$init(void); static # 63 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc" result_t SenseM$ADCControl$init(void); static # 122 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc" result_t SenseM$Leds$yellowOff(void); static #line 114 result_t SenseM$Leds$yellowOn(void); static #line 56 result_t SenseM$Leds$init(void); static #line 97 result_t SenseM$Leds$greenOff(void); static #line 72 result_t SenseM$Leds$redOff(void); static #line 64 result_t SenseM$Leds$redOn(void); static #line 89 result_t SenseM$Leds$greenOn(void); static # 52 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADC.nc" result_t SenseM$ADC$getData(void); static # 59 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Timer.nc" result_t SenseM$Timer$start(char arg_0xa2fb620, uint32_t arg_0xa2fb778); static # 70 "SenseM.nc" result_t SenseM$display(uint16_t value); static inline #line 86 result_t SenseM$StdControl$init(void); static inline result_t SenseM$StdControl$start(void); static inline #line 112 result_t SenseM$Timer$fired(void); static inline result_t SenseM$ADC$dataReady(uint16_t data); # 50 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/LedsC.nc" uint8_t LedsC$ledsOn; enum LedsC$__nesc_unnamed4261 { 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 98 result_t LedsC$Leds$greenOn(void); static inline result_t LedsC$Leds$greenOff(void); static inline #line 127 result_t LedsC$Leds$yellowOn(void); static inline result_t LedsC$Leds$yellowOff(void); static # 41 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/PowerManagement.nc" uint8_t TimerM$PowerManagement$adjustPower(void); static # 105 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.nc" void TimerM$Clock$setInterval(uint8_t arg_0xa36c8c8); static #line 96 result_t TimerM$Clock$setRate(char arg_0xa373c38, char arg_0xa373d78); static # 73 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Timer.nc" result_t TimerM$Timer$fired( # 45 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/TimerM.nc" uint8_t arg_0xa35a3d8); uint32_t TimerM$mState; uint8_t TimerM$setIntervalFlag; uint8_t TimerM$mScale; #line 57 uint8_t TimerM$mInterval; int8_t TimerM$queue_head; int8_t TimerM$queue_tail; uint8_t TimerM$queue_size; uint8_t TimerM$queue[NUM_TIMERS]; struct TimerM$timer_s { uint8_t type; int32_t ticks; int32_t ticksLeft; } TimerM$mTimerList[NUM_TIMERS]; enum TimerM$__nesc_unnamed4262 { TimerM$maxTimerInterval = 230 }; static inline result_t TimerM$StdControl$init(void); static inline result_t TimerM$StdControl$start(void); static inline result_t TimerM$Timer$start(uint8_t id, char type, uint32_t interval); #line 116 static void TimerM$adjustInterval(void); static inline #line 154 result_t TimerM$Timer$default$fired(uint8_t id); static inline void TimerM$enqueue(uint8_t value); static inline uint8_t TimerM$dequeue(void); static inline void TimerM$signalOneTimer(void); static inline void TimerM$HandleFire(void); static inline #line 204 result_t TimerM$Clock$fire(void); static # 180 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.nc" result_t HPLClock$Clock$fire(void); # 54 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica/HPLClock.nc" uint8_t HPLClock$set_flag; uint8_t HPLClock$mscale; #line 55 uint8_t HPLClock$nextScale; #line 55 uint8_t HPLClock$minterval; static inline #line 87 void HPLClock$Clock$setInterval(uint8_t value); static inline #line 149 result_t HPLClock$Clock$setRate(char interval, char scale); #line 167 void __attribute((interrupt)) __vector_15(void); # 51 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLPowerManagementM.nc" bool HPLPowerManagementM$disabled = TRUE; enum HPLPowerManagementM$__nesc_unnamed4263 { 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 84 void HPLPowerManagementM$doAdjustment(void); static #line 101 uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void); static # 89 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADCControl.nc" result_t PhotoTempM$ADCControl$bindPort(uint8_t arg_0xa3f1700, uint8_t arg_0xa3f1848); static #line 50 result_t PhotoTempM$ADCControl$init(void); static # 70 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADC.nc" result_t PhotoTempM$ExternalTempADC$dataReady(uint16_t arg_0xa30c310); static #line 70 result_t PhotoTempM$ExternalPhotoADC$dataReady(uint16_t arg_0xa30c310); static #line 52 result_t PhotoTempM$InternalPhotoADC$getData(void); # 71 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" enum PhotoTempM$__nesc_unnamed4264 { PhotoTempM$IDLE = 1, PhotoTempM$BUSY = 2, PhotoTempM$CONTINUOUS = 3 }; int PhotoTempM$state; static inline result_t PhotoTempM$PhotoStdControl$init(void); static inline #line 146 result_t PhotoTempM$ExternalPhotoADC$getData(void); static inline #line 204 result_t PhotoTempM$InternalPhotoADC$dataReady(uint16_t data); static inline #line 231 result_t PhotoTempM$ExternalTempADC$default$dataReady(uint16_t data); static inline result_t PhotoTempM$InternalTempADC$dataReady(uint16_t data); static # 70 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLADC.nc" result_t ADCM$HPLADC$bindPort(uint8_t arg_0xa41a3e8, uint8_t arg_0xa41a530); static #line 91 result_t ADCM$HPLADC$sampleStop(void); static #line 54 result_t ADCM$HPLADC$init(void); static #line 77 result_t ADCM$HPLADC$samplePort(uint8_t arg_0xa41aa18); static # 70 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADC.nc" result_t ADCM$ADC$dataReady( # 54 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/ADCM.nc" uint8_t arg_0xa408560, # 70 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADC.nc" uint16_t arg_0xa30c310); # 63 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/ADCM.nc" enum ADCM$__nesc_unnamed4265 { 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 87 result_t ADCM$ADCControl$bindPort(uint8_t port, uint8_t adcPort); static inline result_t ADCM$ADC$default$dataReady(uint8_t port, uint16_t data); static inline result_t ADCM$HPLADC$dataReady(uint16_t data); static #line 132 __inline result_t ADCM$startGet(uint8_t newState, uint8_t port); static inline #line 165 result_t ADCM$ADC$getData(uint8_t port); static # 99 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLADC.nc" result_t HPLADCM$ADC$dataReady(uint16_t arg_0xa41b540); # 60 "C:/tinyos/cygwin/opt/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 90 result_t HPLADCM$ADC$init(void); static inline #line 110 result_t HPLADCM$ADC$bindPort(uint8_t port, uint8_t adcPort); static #line 122 result_t HPLADCM$ADC$samplePort(uint8_t port); static inline #line 137 result_t HPLADCM$ADC$sampleStop(void); void __attribute((signal)) __vector_21(void); # 117 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_GREEN_LED_PIN(void) #line 117 { #line 117 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 1; } #line 118 static __inline void TOSH_SET_YELLOW_LED_PIN(void) #line 118 { #line 118 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 0; } #line 116 static __inline void TOSH_SET_RED_LED_PIN(void) #line 116 { #line 116 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 2; } #line 131 static __inline void TOSH_SET_FLASH_SELECT_PIN(void) #line 131 { #line 131 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 3; } #line 132 static __inline void TOSH_MAKE_FLASH_CLK_OUTPUT(void) #line 132 { #line 132 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 5; } #line 133 static __inline void TOSH_MAKE_FLASH_OUT_OUTPUT(void) #line 133 { #line 133 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 3; } #line 131 static __inline void TOSH_MAKE_FLASH_SELECT_OUTPUT(void) #line 131 { #line 131 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 3; } #line 120 static __inline void TOSH_CLR_SERIAL_ID_PIN(void) #line 120 { #line 120 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 4); } #line 120 static __inline void TOSH_MAKE_SERIAL_ID_INPUT(void) #line 120 { #line 120 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) &= ~(1 << 4); } #line 145 static __inline void TOSH_MAKE_SPI_OC1C_INPUT(void) #line 145 { #line 145 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 7); } #line 144 static __inline void TOSH_MAKE_MISO_INPUT(void) #line 144 { #line 144 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 3); } #line 127 static __inline void TOSH_MAKE_CC_PCLK_OUTPUT(void) #line 127 { #line 127 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 6; } #line 126 static __inline void TOSH_MAKE_CC_PDATA_OUTPUT(void) #line 126 { #line 126 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 7; } #line 128 static __inline void TOSH_MAKE_CC_PALE_OUTPUT(void) #line 128 { #line 128 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 4; } #line 149 static __inline void TOSH_MAKE_PW0_OUTPUT(void) #line 149 { #line 149 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 0; } #line 150 static __inline void TOSH_MAKE_PW1_OUTPUT(void) #line 150 { #line 150 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 1; } #line 151 static __inline void TOSH_MAKE_PW2_OUTPUT(void) #line 151 { #line 151 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 2; } #line 152 static __inline void TOSH_MAKE_PW3_OUTPUT(void) #line 152 { #line 152 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 3; } #line 153 static __inline void TOSH_MAKE_PW4_OUTPUT(void) #line 153 { #line 153 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 4; } #line 154 static __inline void TOSH_MAKE_PW5_OUTPUT(void) #line 154 { #line 154 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 5; } #line 155 static __inline void TOSH_MAKE_PW6_OUTPUT(void) #line 155 { #line 155 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 6; } #line 156 static __inline void TOSH_MAKE_PW7_OUTPUT(void) #line 156 { #line 156 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 7; } #line 125 static __inline void TOSH_MAKE_CC_CHP_OUT_INPUT(void) #line 125 { #line 125 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) &= ~(1 << 6); } #line 117 static __inline void TOSH_MAKE_GREEN_LED_OUTPUT(void) #line 117 { #line 117 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 1; } #line 118 static __inline void TOSH_MAKE_YELLOW_LED_OUTPUT(void) #line 118 { #line 118 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 0; } #line 116 static __inline void TOSH_MAKE_RED_LED_OUTPUT(void) #line 116 { #line 116 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 2; } static inline #line 171 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_SERIAL_ID_INPUT(); TOSH_CLR_SERIAL_ID_PIN(); 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 # 57 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/avrmote/HPLInit.nc" result_t HPLInit$init(void) #line 57 { TOSH_SET_PIN_DIRECTIONS(); return SUCCESS; } # 47 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/RealMain.nc" inline static result_t RealMain$hardwareInit(void){ #line 47 unsigned char result; #line 47 #line 47 result = HPLInit$init(); #line 47 #line 47 return result; #line 47 } #line 47 static inline # 75 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLPotC.nc" result_t HPLPotC$Pot$finalise(void) #line 75 { return SUCCESS; } # 74 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLPot.nc" inline static result_t PotM$HPLPot$finalise(void){ #line 74 unsigned char result; #line 74 #line 74 result = HPLPotC$Pot$finalise(); #line 74 #line 74 return result; #line 74 } #line 74 static inline # 66 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLPotC.nc" result_t HPLPotC$Pot$increase(void) #line 66 { return SUCCESS; } # 67 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLPot.nc" inline static result_t PotM$HPLPot$increase(void){ #line 67 unsigned char result; #line 67 #line 67 result = HPLPotC$Pot$increase(); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 57 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLPotC.nc" result_t HPLPotC$Pot$decrease(void) #line 57 { return SUCCESS; } # 59 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLPot.nc" inline static result_t PotM$HPLPot$decrease(void){ #line 59 unsigned char result; #line 59 #line 59 result = HPLPotC$Pot$decrease(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 93 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/PotM.nc" void PotM$setPot(uint8_t value) #line 93 { uint8_t i; #line 95 for (i = 0; i < 151; i++) PotM$HPLPot$decrease(); for (i = 0; i < value; i++) PotM$HPLPot$increase(); PotM$HPLPot$finalise(); PotM$potSetting = value; } static inline result_t PotM$Pot$init(uint8_t initialSetting) #line 106 { PotM$setPot(initialSetting); return SUCCESS; } # 78 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Pot.nc" inline static result_t RealMain$Pot$init(uint8_t arg_0xa2c2240){ #line 78 unsigned char result; #line 78 #line 78 result = PotM$Pot$init(arg_0xa2c2240); #line 78 #line 78 return result; #line 78 } #line 78 static inline # 76 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/sched.c" void TOSH_sched_init(void ) { TOSH_sched_free = 0; TOSH_sched_full = 0; } static inline # 108 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/tos.h" result_t rcombine(result_t r1, result_t r2) { return r1 == FAIL ? FAIL : r2; } static inline # 149 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica/HPLClock.nc" result_t HPLClock$Clock$setRate(char interval, char scale) #line 149 { scale &= 0x7; scale |= 0x8; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 152 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) &= ~(1 << 0); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) &= ~(1 << 1); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x30 + 0x20) |= 1 << 3; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x33 + 0x20) = scale; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x32 + 0x20) = 0; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20) = interval; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) |= 1 << 1; } #line 162 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 96 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.nc" inline static result_t TimerM$Clock$setRate(char arg_0xa373c38, char arg_0xa373d78){ #line 96 unsigned char result; #line 96 #line 96 result = HPLClock$Clock$setRate(arg_0xa373c38, arg_0xa373d78); #line 96 #line 96 return result; #line 96 } #line 96 static inline # 72 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/TimerM.nc" result_t TimerM$StdControl$init(void) #line 72 { TimerM$mState = 0; TimerM$setIntervalFlag = 0; TimerM$queue_head = TimerM$queue_tail = -1; TimerM$queue_size = 0; TimerM$mScale = 3; TimerM$mInterval = TimerM$maxTimerInterval; return TimerM$Clock$setRate(TimerM$mInterval, TimerM$mScale); } static inline # 58 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$init(void) #line 58 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 59 { LedsC$ledsOn = 0; { } #line 61 ; TOSH_SET_RED_LED_PIN(); TOSH_SET_YELLOW_LED_PIN(); TOSH_SET_GREEN_LED_PIN(); } #line 65 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 56 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t SenseM$Leds$init(void){ #line 56 unsigned char result; #line 56 #line 56 result = LedsC$Leds$init(); #line 56 #line 56 return result; #line 56 } #line 56 static inline # 90 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" result_t HPLADCM$ADC$init(void) #line 90 { HPLADCM$init_portmap(); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 95 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) = (1 << 3) | (6 << 0); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x07 + 0x20) = 0; } #line 99 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 54 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t ADCM$HPLADC$init(void){ #line 54 unsigned char result; #line 54 #line 54 result = HPLADCM$ADC$init(); #line 54 #line 54 return result; #line 54 } #line 54 static inline # 73 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/ADCM.nc" result_t ADCM$ADCControl$init(void) #line 73 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 74 { ADCM$ReqPort = 0; ADCM$ReqVector = ADCM$ContReqMask = 0; } #line 77 __nesc_atomic_end(__nesc_atomic); } { } #line 78 ; return ADCM$HPLADC$init(); } # 50 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADCControl.nc" inline static result_t PhotoTempM$ADCControl$init(void){ #line 50 unsigned char result; #line 50 #line 50 result = ADCM$ADCControl$init(); #line 50 #line 50 return result; #line 50 } #line 50 static inline # 110 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" result_t HPLADCM$ADC$bindPort(uint8_t port, uint8_t adcPort) #line 110 { if ( #line 111 port < TOSH_ADC_PORTMAPSIZE && port != TOS_ADC_BANDGAP_PORT && port != TOS_ADC_GND_PORT) { HPLADCM$init_portmap(); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 115 HPLADCM$TOSH_adc_portmap[port] = adcPort; #line 115 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } else { return FAIL; } } # 70 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t ADCM$HPLADC$bindPort(uint8_t arg_0xa41a3e8, uint8_t arg_0xa41a530){ #line 70 unsigned char result; #line 70 #line 70 result = HPLADCM$ADC$bindPort(arg_0xa41a3e8, arg_0xa41a530); #line 70 #line 70 return result; #line 70 } #line 70 static inline # 87 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/ADCM.nc" result_t ADCM$ADCControl$bindPort(uint8_t port, uint8_t adcPort) #line 87 { return ADCM$HPLADC$bindPort(port, adcPort); } # 89 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADCControl.nc" inline static result_t PhotoTempM$ADCControl$bindPort(uint8_t arg_0xa3f1700, uint8_t arg_0xa3f1848){ #line 89 unsigned char result; #line 89 #line 89 result = ADCM$ADCControl$bindPort(arg_0xa3f1700, arg_0xa3f1848); #line 89 #line 89 return result; #line 89 } #line 89 static inline # 78 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$PhotoStdControl$init(void) #line 78 { PhotoTempM$ADCControl$bindPort(TOS_ADC_PHOTO_PORT, TOSH_ACTUAL_PHOTO_PORT); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 80 { PhotoTempM$state = PhotoTempM$IDLE; } #line 82 __nesc_atomic_end(__nesc_atomic); } { } #line 83 ; return PhotoTempM$ADCControl$init(); } # 63 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t SenseM$ADCControl$init(void){ #line 63 unsigned char result; #line 63 #line 63 result = PhotoTempM$PhotoStdControl$init(); #line 63 #line 63 return result; #line 63 } #line 63 static inline # 86 "SenseM.nc" result_t SenseM$StdControl$init(void) #line 86 { return rcombine(SenseM$ADCControl$init(), SenseM$Leds$init()); } # 63 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t RealMain$StdControl$init(void){ #line 63 unsigned char result; #line 63 #line 63 result = SenseM$StdControl$init(); #line 63 result = rcombine(result, TimerM$StdControl$init()); #line 63 #line 63 return result; #line 63 } #line 63 static inline # 82 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/TimerM.nc" result_t TimerM$StdControl$start(void) #line 82 { return SUCCESS; } # 41 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/PowerManagement.nc" inline static uint8_t TimerM$PowerManagement$adjustPower(void){ #line 41 unsigned char result; #line 41 #line 41 result = HPLPowerManagementM$PowerManagement$adjustPower(); #line 41 #line 41 return result; #line 41 } #line 41 static inline # 87 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica/HPLClock.nc" void HPLClock$Clock$setInterval(uint8_t value) #line 87 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20) = value; } # 105 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.nc" inline static void TimerM$Clock$setInterval(uint8_t arg_0xa36c8c8){ #line 105 HPLClock$Clock$setInterval(arg_0xa36c8c8); #line 105 } #line 105 static inline # 93 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/TimerM.nc" result_t TimerM$Timer$start(uint8_t id, char type, uint32_t interval) #line 94 { uint8_t diff; #line 96 if (id >= NUM_TIMERS) { #line 96 return FAIL; } #line 97 if (type > 1) { #line 97 return FAIL; } #line 98 TimerM$mTimerList[id].ticks = interval; TimerM$mTimerList[id].type = type; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 101 { diff = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x32 + 0x20); interval += diff; TimerM$mTimerList[id].ticksLeft = interval; TimerM$mState |= 0x1 << id; if (interval < TimerM$mInterval) { TimerM$mInterval = interval; TimerM$Clock$setInterval(TimerM$mInterval); TimerM$setIntervalFlag = 0; TimerM$PowerManagement$adjustPower(); } } #line 112 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 59 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t SenseM$Timer$start(char arg_0xa2fb620, uint32_t arg_0xa2fb778){ #line 59 unsigned char result; #line 59 #line 59 result = TimerM$Timer$start(0, arg_0xa2fb620, arg_0xa2fb778); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 94 "SenseM.nc" result_t SenseM$StdControl$start(void) #line 94 { return SenseM$Timer$start(TIMER_REPEAT, 500); } # 70 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t RealMain$StdControl$start(void){ #line 70 unsigned char result; #line 70 #line 70 result = SenseM$StdControl$start(); #line 70 result = rcombine(result, TimerM$StdControl$start()); #line 70 #line 70 return result; #line 70 } #line 70 static inline # 63 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLPowerManagementM.nc" uint8_t HPLPowerManagementM$getPowerLevel(void) #line 63 { uint8_t diff; #line 65 if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) & ~((1 << 1) | (1 << 0))) { return HPLPowerManagementM$IDLE; } else { #line 68 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 74 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 78 return HPLPowerManagementM$POWER_SAVE; } else #line 79 { return HPLPowerManagementM$POWER_DOWN; } } } } } static inline #line 84 void HPLPowerManagementM$doAdjustment(void) #line 84 { uint8_t foo; #line 85 uint8_t mcu; #line 86 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 # 165 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/avrmote/avrhardware.h" __inline void __nesc_enable_interrupt(void) #line 165 { __asm volatile ("sei");} static inline #line 135 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");} #line 160 __inline void __nesc_atomic_end(__nesc_atomic_t oldSreg) { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x3F + 0x20) = oldSreg; } #line 153 __inline __nesc_atomic_t __nesc_atomic_start(void ) { __nesc_atomic_t result = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x3F + 0x20); #line 156 __asm volatile ("cli"); return result; } static inline # 139 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/sched.c" bool TOSH_run_next_task(void) #line 139 { __nesc_atomic_t fInterruptFlags; uint8_t old_full; void (*func)(void ); if (TOSH_sched_full == TOSH_sched_free) { return 0; } else { fInterruptFlags = __nesc_atomic_start(); 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; __nesc_atomic_end(fInterruptFlags); func(); return 1; } } static inline void TOSH_run_task(void) #line 162 { while (TOSH_run_next_task()) ; TOSH_sleep(); TOSH_wait(); } # 116 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/TimerM.nc" static void TimerM$adjustInterval(void) #line 116 { uint8_t i; #line 117 uint8_t val = TimerM$maxTimerInterval; #line 118 if (TimerM$mState) { for (i = 0; i < NUM_TIMERS; i++) { if (TimerM$mState & (0x1 << i) && TimerM$mTimerList[i].ticksLeft < val) { val = TimerM$mTimerList[i].ticksLeft; } } { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 124 { TimerM$mInterval = val; TimerM$Clock$setInterval(TimerM$mInterval); TimerM$setIntervalFlag = 0; } #line 128 __nesc_atomic_end(__nesc_atomic); } } else { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 131 { TimerM$mInterval = TimerM$maxTimerInterval; TimerM$Clock$setInterval(TimerM$mInterval); TimerM$setIntervalFlag = 0; } #line 135 __nesc_atomic_end(__nesc_atomic); } } TimerM$PowerManagement$adjustPower(); } # 77 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t ADCM$HPLADC$samplePort(uint8_t arg_0xa41aa18){ #line 77 unsigned char result; #line 77 #line 77 result = HPLADCM$ADC$samplePort(arg_0xa41aa18); #line 77 #line 77 return result; #line 77 } #line 77 static # 132 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/ADCM.nc" __inline result_t ADCM$startGet(uint8_t newState, uint8_t port) #line 132 { uint16_t PortMask; #line 133 uint16_t oldReqVector; result_t Result = SUCCESS; if (port > TOSH_ADC_PORTMAPSIZE) { return FAIL; } PortMask = 1 << port; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 142 { 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; Result = ADCM$HPLADC$samplePort(port); } } } #line 159 __nesc_atomic_end(__nesc_atomic); } return Result; } static inline result_t ADCM$ADC$getData(uint8_t port) #line 165 { return ADCM$startGet(ADCM$SINGLE_CONVERSION, port); } # 52 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t PhotoTempM$InternalPhotoADC$getData(void){ #line 52 unsigned char result; #line 52 #line 52 result = ADCM$ADC$getData(TOS_ADC_PHOTO_PORT); #line 52 #line 52 return result; #line 52 } #line 52 # 138 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_INT1_OUTPUT(void) #line 138 { #line 138 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x02 + 0x20) |= 1 << 5; } # 71 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_MAKE_PHOTO_CTL_OUTPUT(void) #line 71 { #line 71 TOSH_MAKE_INT1_OUTPUT(); } # 138 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_INT1_PIN(void) #line 138 { #line 138 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x03 + 0x20) |= 1 << 5; } # 71 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_SET_PHOTO_CTL_PIN(void) #line 71 { #line 71 TOSH_SET_INT1_PIN(); } # 139 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_INT2_INPUT(void) #line 139 { #line 139 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x02 + 0x20) &= ~(1 << 6); } # 72 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_MAKE_TEMP_CTL_INPUT(void) #line 72 { #line 72 TOSH_MAKE_INT2_INPUT(); } # 139 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_INT2_PIN(void) #line 139 { #line 139 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x03 + 0x20) &= ~(1 << 6); } # 72 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_CLR_TEMP_CTL_PIN(void) #line 72 { #line 72 TOSH_CLR_INT2_PIN(); } static inline # 146 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$ExternalPhotoADC$getData(void) #line 146 { uint8_t oldState; #line 148 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 148 { oldState = PhotoTempM$state; if (PhotoTempM$state == PhotoTempM$IDLE) { PhotoTempM$state = PhotoTempM$BUSY; } } #line 153 __nesc_atomic_end(__nesc_atomic); } if (oldState == PhotoTempM$IDLE) { TOSH_CLR_TEMP_CTL_PIN(); TOSH_MAKE_TEMP_CTL_INPUT(); TOSH_SET_PHOTO_CTL_PIN(); TOSH_MAKE_PHOTO_CTL_OUTPUT(); return PhotoTempM$InternalPhotoADC$getData(); } return FAIL; } # 52 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t SenseM$ADC$getData(void){ #line 52 unsigned char result; #line 52 #line 52 result = PhotoTempM$ExternalPhotoADC$getData(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 112 "SenseM.nc" result_t SenseM$Timer$fired(void) #line 112 { return SenseM$ADC$getData(); } static inline # 154 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/TimerM.nc" result_t TimerM$Timer$default$fired(uint8_t id) #line 154 { return SUCCESS; } # 73 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t TimerM$Timer$fired(uint8_t arg_0xa35a3d8){ #line 73 unsigned char result; #line 73 #line 73 switch (arg_0xa35a3d8) { #line 73 case 0: #line 73 result = SenseM$Timer$fired(); #line 73 break; #line 73 default: #line 73 result = TimerM$Timer$default$fired(arg_0xa35a3d8); #line 73 } #line 73 #line 73 return result; #line 73 } #line 73 static inline # 166 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/TimerM.nc" uint8_t TimerM$dequeue(void) #line 166 { if (TimerM$queue_size == 0) { return NUM_TIMERS; } #line 169 if (TimerM$queue_head == NUM_TIMERS - 1) { TimerM$queue_head = -1; } #line 171 TimerM$queue_head++; TimerM$queue_size--; return TimerM$queue[(uint8_t )TimerM$queue_head]; } static inline void TimerM$signalOneTimer(void) #line 176 { uint8_t itimer = TimerM$dequeue(); #line 178 if (itimer < NUM_TIMERS) { TimerM$Timer$fired(itimer); } } static inline #line 158 void TimerM$enqueue(uint8_t value) #line 158 { if (TimerM$queue_tail == NUM_TIMERS - 1) { TimerM$queue_tail = -1; } #line 161 TimerM$queue_tail++; TimerM$queue_size++; TimerM$queue[(uint8_t )TimerM$queue_tail] = value; } static inline #line 182 void TimerM$HandleFire(void) #line 182 { uint8_t i; #line 184 TimerM$setIntervalFlag = 1; if (TimerM$mState) { for (i = 0; i < NUM_TIMERS; i++) { if (TimerM$mState & (0x1 << i)) { TimerM$mTimerList[i].ticksLeft -= TimerM$mInterval + 1; if (TimerM$mTimerList[i].ticksLeft <= 2) { if (TimerM$mTimerList[i].type == TIMER_REPEAT) { TimerM$mTimerList[i].ticksLeft += TimerM$mTimerList[i].ticks; } else #line 192 { TimerM$mState &= ~(0x1 << i); } TimerM$enqueue(i); TOS_post(TimerM$signalOneTimer); } } } } TimerM$adjustInterval(); } static inline result_t TimerM$Clock$fire(void) #line 204 { TOS_post(TimerM$HandleFire); return SUCCESS; } # 180 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.nc" inline static result_t HPLClock$Clock$fire(void){ #line 180 unsigned char result; #line 180 #line 180 result = TimerM$Clock$fire(); #line 180 #line 180 return result; #line 180 } #line 180 static inline # 137 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" result_t HPLADCM$ADC$sampleStop(void) #line 137 { return SUCCESS; } # 91 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t ADCM$HPLADC$sampleStop(void){ #line 91 unsigned char result; #line 91 #line 91 result = HPLADCM$ADC$sampleStop(); #line 91 #line 91 return result; #line 91 } #line 91 static inline # 231 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$ExternalTempADC$default$dataReady(uint16_t data) #line 231 { return SUCCESS; } # 70 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t PhotoTempM$ExternalTempADC$dataReady(uint16_t arg_0xa30c310){ #line 70 unsigned char result; #line 70 #line 70 result = PhotoTempM$ExternalTempADC$default$dataReady(arg_0xa30c310); #line 70 #line 70 return result; #line 70 } #line 70 static inline # 235 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$InternalTempADC$dataReady(uint16_t data) #line 235 { uint8_t oldState; #line 237 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 237 { oldState = PhotoTempM$state; if (PhotoTempM$state == PhotoTempM$BUSY) { PhotoTempM$state = PhotoTempM$IDLE; } } #line 242 __nesc_atomic_end(__nesc_atomic); } if (oldState == PhotoTempM$BUSY) { return PhotoTempM$ExternalTempADC$dataReady(data); } else { #line 247 if (oldState == PhotoTempM$CONTINUOUS) { int ret; #line 249 ret = PhotoTempM$ExternalTempADC$dataReady(data); if (ret == FAIL) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 253 { PhotoTempM$state = PhotoTempM$IDLE; } #line 255 __nesc_atomic_end(__nesc_atomic); } } return ret; } } #line 259 return FAIL; } static inline # 122 "SenseM.nc" result_t SenseM$ADC$dataReady(uint16_t data) #line 122 { SenseM$display(7 - ((data >> 7) & 0x7)); return SUCCESS; } # 70 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t PhotoTempM$ExternalPhotoADC$dataReady(uint16_t arg_0xa30c310){ #line 70 unsigned char result; #line 70 #line 70 result = SenseM$ADC$dataReady(arg_0xa30c310); #line 70 #line 70 return result; #line 70 } #line 70 static inline # 204 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$InternalPhotoADC$dataReady(uint16_t data) #line 204 { uint8_t oldState; #line 206 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 206 { oldState = PhotoTempM$state; if (PhotoTempM$state == PhotoTempM$BUSY) { PhotoTempM$state = PhotoTempM$IDLE; } } #line 211 __nesc_atomic_end(__nesc_atomic); } if (oldState == PhotoTempM$BUSY) { return PhotoTempM$ExternalPhotoADC$dataReady(data); } else { #line 216 if (oldState == PhotoTempM$CONTINUOUS) { int ret; #line 218 ret = PhotoTempM$ExternalPhotoADC$dataReady(data); if (ret == FAIL) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 222 { PhotoTempM$state = PhotoTempM$IDLE; } #line 224 __nesc_atomic_end(__nesc_atomic); } } return ret; } } #line 228 return FAIL; } static inline # 91 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/ADCM.nc" result_t ADCM$ADC$default$dataReady(uint8_t port, uint16_t data) #line 91 { return FAIL; } # 70 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t ADCM$ADC$dataReady(uint8_t arg_0xa408560, uint16_t arg_0xa30c310){ #line 70 unsigned char result; #line 70 #line 70 switch (arg_0xa408560) { #line 70 case TOS_ADC_PHOTO_PORT: #line 70 result = PhotoTempM$InternalPhotoADC$dataReady(arg_0xa30c310); #line 70 break; #line 70 case TOS_ADC_TEMP_PORT: #line 70 result = PhotoTempM$InternalTempADC$dataReady(arg_0xa30c310); #line 70 break; #line 70 default: #line 70 result = ADCM$ADC$default$dataReady(arg_0xa408560, arg_0xa30c310); #line 70 } #line 70 #line 70 return result; #line 70 } #line 70 static inline # 95 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/ADCM.nc" result_t ADCM$HPLADC$dataReady(uint16_t data) #line 95 { uint16_t doneValue = data; uint8_t donePort; result_t Result; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 101 { donePort = ADCM$ReqPort; if (((1 << donePort) & ADCM$ContReqMask) == 0) { ADCM$HPLADC$sampleStop(); ADCM$ReqVector &= ~(1 << donePort); } if (ADCM$ReqVector) { do { ADCM$ReqPort++; ADCM$ReqPort = ADCM$ReqPort == TOSH_ADC_PORTMAPSIZE ? 0 : ADCM$ReqPort; } while ((( #line 113 1 << ADCM$ReqPort) & ADCM$ReqVector) == 0); ADCM$HPLADC$samplePort(ADCM$ReqPort); } } #line 116 __nesc_atomic_end(__nesc_atomic); } { } #line 119 ; Result = ADCM$ADC$dataReady(donePort, doneValue); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 122 { if (Result == FAIL && ADCM$ContReqMask & (1 << donePort)) { ADCM$HPLADC$sampleStop(); ADCM$ContReqMask &= ~(1 << donePort); } } #line 127 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 99 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t HPLADCM$ADC$dataReady(uint16_t arg_0xa41b540){ #line 99 unsigned char result; #line 99 #line 99 result = ADCM$HPLADC$dataReady(arg_0xa41b540); #line 99 #line 99 return result; #line 99 } #line 99 # 118 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_YELLOW_LED_PIN(void) #line 118 { #line 118 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 0); } static inline # 127 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$yellowOn(void) #line 127 { { } #line 128 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 129 { TOSH_CLR_YELLOW_LED_PIN(); LedsC$ledsOn |= LedsC$YELLOW_BIT; } #line 132 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 114 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t SenseM$Leds$yellowOn(void){ #line 114 unsigned char result; #line 114 #line 114 result = LedsC$Leds$yellowOn(); #line 114 #line 114 return result; #line 114 } #line 114 static inline # 136 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$yellowOff(void) #line 136 { { } #line 137 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 138 { TOSH_SET_YELLOW_LED_PIN(); LedsC$ledsOn &= ~LedsC$YELLOW_BIT; } #line 141 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 122 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t SenseM$Leds$yellowOff(void){ #line 122 unsigned char result; #line 122 #line 122 result = LedsC$Leds$yellowOff(); #line 122 #line 122 return result; #line 122 } #line 122 # 117 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_GREEN_LED_PIN(void) #line 117 { #line 117 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 1); } static inline # 98 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$greenOn(void) #line 98 { { } #line 99 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 100 { TOSH_CLR_GREEN_LED_PIN(); LedsC$ledsOn |= LedsC$GREEN_BIT; } #line 103 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 89 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t SenseM$Leds$greenOn(void){ #line 89 unsigned char result; #line 89 #line 89 result = LedsC$Leds$greenOn(); #line 89 #line 89 return result; #line 89 } #line 89 static inline # 107 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$greenOff(void) #line 107 { { } #line 108 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 109 { TOSH_SET_GREEN_LED_PIN(); LedsC$ledsOn &= ~LedsC$GREEN_BIT; } #line 112 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 97 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t SenseM$Leds$greenOff(void){ #line 97 unsigned char result; #line 97 #line 97 result = LedsC$Leds$greenOff(); #line 97 #line 97 return result; #line 97 } #line 97 # 116 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_RED_LED_PIN(void) #line 116 { #line 116 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 2); } static inline # 69 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$redOn(void) #line 69 { { } #line 70 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 71 { TOSH_CLR_RED_LED_PIN(); LedsC$ledsOn |= LedsC$RED_BIT; } #line 74 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 64 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t SenseM$Leds$redOn(void){ #line 64 unsigned char result; #line 64 #line 64 result = LedsC$Leds$redOn(); #line 64 #line 64 return result; #line 64 } #line 64 static inline # 78 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$redOff(void) #line 78 { { } #line 79 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 80 { TOSH_SET_RED_LED_PIN(); LedsC$ledsOn &= ~LedsC$RED_BIT; } #line 83 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 72 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t SenseM$Leds$redOff(void){ #line 72 unsigned char result; #line 72 #line 72 result = LedsC$Leds$redOff(); #line 72 #line 72 return result; #line 72 } #line 72 # 98 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/sched.c" bool TOS_post(void (*tp)(void)) #line 98 { __nesc_atomic_t fInterruptFlags; uint8_t tmp; fInterruptFlags = __nesc_atomic_start(); tmp = TOSH_sched_free; TOSH_sched_free++; TOSH_sched_free &= TOSH_TASK_BITMASK; if (TOSH_sched_free != TOSH_sched_full) { __nesc_atomic_end(fInterruptFlags); TOSH_queue[tmp].tp = tp; return TRUE; } else { TOSH_sched_free = tmp; __nesc_atomic_end(fInterruptFlags); return FALSE; } } # 54 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/RealMain.nc" int main(void) #line 54 { RealMain$hardwareInit(); RealMain$Pot$init(10); TOSH_sched_init(); RealMain$StdControl$init(); RealMain$StdControl$start(); __nesc_enable_interrupt(); while (1) { TOSH_run_task(); } } static # 63 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" void HPLADCM$init_portmap(void) #line 63 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 65 { if (HPLADCM$init_portmap_done == FALSE) { int i; #line 68 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 76 __nesc_atomic_end(__nesc_atomic); } } static # 101 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLPowerManagementM.nc" uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void) #line 101 { uint8_t mcu; #line 103 if (!HPLPowerManagementM$disabled) { TOS_post(HPLPowerManagementM$doAdjustment); } else #line 105 { 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; } # 167 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica/HPLClock.nc" void __attribute((interrupt)) __vector_15(void) #line 167 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 168 { 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 177 __nesc_atomic_end(__nesc_atomic); } HPLClock$Clock$fire(); } static # 122 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" result_t HPLADCM$ADC$samplePort(uint8_t port) #line 122 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 123 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x07 + 0x20) = HPLADCM$TOSH_adc_portmap[port] & 0x1F; } #line 125 __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 << 6; return SUCCESS; } #line 144 void __attribute((signal)) __vector_21(void) #line 144 { uint16_t data = * (volatile unsigned int *)(unsigned int )& * (volatile unsigned char *)(0x04 + 0x20); #line 146 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); __nesc_enable_interrupt(); HPLADCM$ADC$dataReady(data); } static # 70 "SenseM.nc" result_t SenseM$display(uint16_t value) { if (value & 1) { #line 72 SenseM$Leds$yellowOn(); } else { #line 73 SenseM$Leds$yellowOff(); } #line 74 if (value & 2) { #line 74 SenseM$Leds$greenOn(); } else { #line 75 SenseM$Leds$greenOff(); } #line 76 if (value & 4) { #line 76 SenseM$Leds$redOn(); } else { #line 77 SenseM$Leds$redOff(); } #line 78 return SUCCESS; }