#define dbg(mode, format, ...) ((void)0) #define dbg_clear(mode, format, ...) ((void)0) #define dbg_active(mode) 0 # 50 "d:/avrgcc/avr/include/inttypes.h" typedef signed char int8_t; typedef unsigned char uint8_t; # 60 "d:/avrgcc/avr/include/inttypes.h" 3 typedef int int16_t; typedef unsigned int uint16_t; typedef long int32_t; typedef unsigned long uint32_t; typedef long long int64_t; typedef unsigned long long uint64_t; typedef int16_t intptr_t; typedef uint16_t uintptr_t; # 213 "d:/avrgcc/lib/gcc-lib/avr/3.3/include/stddef.h" 3 typedef unsigned int size_t; #line 325 typedef int wchar_t; # 60 "d:/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 "d:/avrgcc/lib/gcc-lib/avr/3.3/include/stddef.h" 3 typedef int ptrdiff_t; # 90 "d:/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 }; typedef uint8_t result_t; #line 133 enum __nesc_unnamed4246 { NULL = 0x0 }; # 79 "d:/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 "d:/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); # 41 "d:/tinyos-1.x/tos/platform/mica128/hardware.h" static __inline void TOSH_SET_RED_LED_PIN(void); #line 41 static __inline void TOSH_CLR_RED_LED_PIN(void); #line 41 static __inline void TOSH_MAKE_RED_LED_OUTPUT(void); static __inline void TOSH_SET_YELLOW_LED_PIN(void); #line 42 static __inline void TOSH_MAKE_YELLOW_LED_OUTPUT(void); static __inline void TOSH_SET_GREEN_LED_PIN(void); #line 43 static __inline void TOSH_MAKE_GREEN_LED_OUTPUT(void); static __inline void TOSH_SET_UD_PIN(void); #line 45 static __inline void TOSH_CLR_UD_PIN(void); static __inline void TOSH_SET_INC_PIN(void); #line 46 static __inline void TOSH_CLR_INC_PIN(void); static __inline void TOSH_SET_POT_SELECT_PIN(void); #line 47 static __inline void TOSH_CLR_POT_SELECT_PIN(void); #line 47 static __inline void TOSH_MAKE_POT_SELECT_OUTPUT(void); static __inline void TOSH_SET_POT_POWER_PIN(void); #line 48 static __inline void TOSH_MAKE_POT_POWER_OUTPUT(void); static __inline void TOSH_SET_BOOST_ENABLE_PIN(void); #line 49 static __inline void TOSH_MAKE_BOOST_ENABLE_OUTPUT(void); static __inline void TOSH_SET_FLASH_SELECT_PIN(void); #line 51 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_RFM_TXD_OUTPUT(void); static __inline void TOSH_MAKE_RFM_CTL0_OUTPUT(void); static __inline void TOSH_MAKE_RFM_CTL1_OUTPUT(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); #line 86 static __inline void TOSH_SET_ONE_WIRE_PIN(void); #line 86 static __inline void TOSH_MAKE_ONE_WIRE_INPUT(void); static inline void TOSH_SET_PIN_DIRECTIONS(void ); #line 133 enum __nesc_unnamed4248 { TOSH_ACTUAL_VOLTAGE_PORT = 7 }; enum __nesc_unnamed4249 { TOS_ADC_VOLTAGE_PORT = 7 }; # 85 "d:/tinyos-1.x/tos/system/dbg.h" typedef long long TOS_dbg_mode; # 80 "d:/tinyos-1.x/tos/system/dbg_modes.h" enum __nesc_unnamed4250 { 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 "d:/tinyos-1.x/tos/system/sched.c" typedef struct __nesc_unnamed4251 { void (*tp)(void); } TOSH_sched_entry_T; enum __nesc_unnamed4252 { 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); # 63 "d:/tinyos-1.x/tos/platform/mica128/Clock.h" enum __nesc_unnamed4253 { 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_unnamed4254 { DEFAULT_SCALE = 3, DEFAULT_INTERVAL = 127 }; static result_t PotM$Pot$init(uint8_t arg_0xa260930); 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 BlinkM$Clock$fire(void); static result_t BlinkM$StdControl$init(void); static result_t BlinkM$StdControl$start(void); static result_t HPLClock$Clock$setRate(char arg_0xa291138, char arg_0xa291270); static result_t LedsC$Leds$init(void); static result_t LedsC$Leds$redOff(void); static result_t LedsC$Leds$redToggle(void); static result_t LedsC$Leds$redOn(void); static # 70 "d:/tinyos-1.x/tos/system/RealMain.nc" result_t RealMain$hardwareInit(void); static # 105 "d:/tinyos-1.x/tos/interfaces/Pot.nc" result_t RealMain$Pot$init(uint8_t arg_0xa260930); static # 86 "d:/tinyos-1.x/tos/interfaces/Interrupt.nc" result_t RealMain$Interrupt$enable(void); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t RealMain$StdControl$init(void); static result_t RealMain$StdControl$start(void); # 78 "d:/tinyos-1.x/tos/system/RealMain.nc" int main(void); static # 101 "d:/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 "d:/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 # 79 "d:/tinyos-1.x/tos/platform/avrmote/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 "d:/tinyos-1.x/tos/platform/avrmote/HPLInit.nc" result_t HPLInit$init(void); static inline # 79 "d:/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 # 122 "d:/tinyos-1.x/tos/interfaces/Clock.nc" result_t BlinkM$Clock$setRate(char arg_0xa291138, char arg_0xa291270); static # 83 "d:/tinyos-1.x/tos/interfaces/Leds.nc" result_t BlinkM$Leds$init(void); static #line 108 result_t BlinkM$Leds$redToggle(void); static inline # 82 "BlinkM.nc" result_t BlinkM$StdControl$init(void); static inline result_t BlinkM$StdControl$start(void); static inline #line 114 result_t BlinkM$Clock$fire(void); static # 206 "d:/tinyos-1.x/tos/interfaces/Clock.nc" result_t HPLClock$Clock$fire(void); # 77 "d:/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 #line 172 result_t HPLClock$Clock$setRate(char interval, char scale); #line 190 void __attribute((interrupt)) __vector_15(void); # 73 "d:/tinyos-1.x/tos/system/LedsC.nc" uint8_t LedsC$ledsOn; enum LedsC$__nesc_unnamed4255 { 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 result_t LedsC$Leds$redToggle(void); # 176 "d:/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 "d:/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(); } # 86 "d:/tinyos-1.x/tos/platform/mica128/hardware.h" static __inline void TOSH_SET_ONE_WIRE_PIN(void) #line 86 { #line 86 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x03 + 0x20) |= 1 << 5; } #line 86 static __inline void TOSH_MAKE_ONE_WIRE_INPUT(void) #line 86 { #line 86 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x02 + 0x20) &= ~(1 << 5); } #line 49 static __inline void TOSH_SET_BOOST_ENABLE_PIN(void) #line 49 { #line 49 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x03 + 0x20) |= 1 << 4; } #line 49 static __inline void TOSH_MAKE_BOOST_ENABLE_OUTPUT(void) #line 49 { #line 49 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x02 + 0x20) |= 1 << 4; } #line 43 static __inline void TOSH_SET_GREEN_LED_PIN(void) #line 43 { #line 43 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 1; } #line 42 static __inline void TOSH_SET_YELLOW_LED_PIN(void) #line 42 { #line 42 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 0; } #line 41 static __inline void TOSH_SET_RED_LED_PIN(void) #line 41 { #line 41 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 2; } static __inline void TOSH_SET_FLASH_SELECT_PIN(void) #line 51 { #line 51 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x18 + 0x20) |= 1 << 0; } #line 52 static __inline void TOSH_MAKE_FLASH_CLK_OUTPUT(void) #line 52 { #line 52 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 3; } #line 53 static __inline void TOSH_MAKE_FLASH_OUT_OUTPUT(void) #line 53 { #line 53 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 7; } #line 51 static __inline void TOSH_MAKE_FLASH_SELECT_OUTPUT(void) #line 51 { #line 51 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) |= 1 << 0; } #line 48 static __inline void TOSH_SET_POT_POWER_PIN(void) #line 48 { #line 48 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x03 + 0x20) |= 1 << 7; } static __inline void TOSH_MAKE_RFM_TXD_OUTPUT(void) #line 61 { #line 61 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) |= 1 << 3; } #line 63 static __inline void TOSH_MAKE_RFM_CTL1_OUTPUT(void) #line 63 { #line 63 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 6; } #line 62 static __inline void TOSH_MAKE_RFM_CTL0_OUTPUT(void) #line 62 { #line 62 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 7; } static __inline void TOSH_MAKE_PW0_OUTPUT(void) #line 65 { #line 65 ; } #line 66 static __inline void TOSH_MAKE_PW1_OUTPUT(void) #line 66 { #line 66 ; } #line 67 static __inline void TOSH_MAKE_PW2_OUTPUT(void) #line 67 { #line 67 ; } #line 68 static __inline void TOSH_MAKE_PW3_OUTPUT(void) #line 68 { #line 68 ; } #line 69 static __inline void TOSH_MAKE_PW4_OUTPUT(void) #line 69 { #line 69 ; } #line 70 static __inline void TOSH_MAKE_PW5_OUTPUT(void) #line 70 { #line 70 ; } #line 71 static __inline void TOSH_MAKE_PW6_OUTPUT(void) #line 71 { #line 71 ; } #line 72 static __inline void TOSH_MAKE_PW7_OUTPUT(void) #line 72 { #line 72 ; } #line 48 static __inline void TOSH_MAKE_POT_POWER_OUTPUT(void) #line 48 { #line 48 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x02 + 0x20) |= 1 << 7; } #line 47 static __inline void TOSH_MAKE_POT_SELECT_OUTPUT(void) #line 47 { #line 47 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 5; } #line 43 static __inline void TOSH_MAKE_GREEN_LED_OUTPUT(void) #line 43 { #line 43 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 1; } #line 42 static __inline void TOSH_MAKE_YELLOW_LED_OUTPUT(void) #line 42 { #line 42 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 0; } #line 41 static __inline void TOSH_MAKE_RED_LED_OUTPUT(void) #line 41 { #line 41 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 2; } static inline #line 88 void TOSH_SET_PIN_DIRECTIONS(void ) { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) = 0x00; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) = 0x00; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) = 0x00; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x02 + 0x20) = 0x02; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x03 + 0x20) = 0x02; TOSH_MAKE_RED_LED_OUTPUT(); TOSH_MAKE_YELLOW_LED_OUTPUT(); TOSH_MAKE_GREEN_LED_OUTPUT(); TOSH_MAKE_POT_SELECT_OUTPUT(); TOSH_MAKE_POT_POWER_OUTPUT(); 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_RFM_CTL0_OUTPUT(); TOSH_MAKE_RFM_CTL1_OUTPUT(); TOSH_MAKE_RFM_TXD_OUTPUT(); TOSH_SET_POT_POWER_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(); TOSH_MAKE_BOOST_ENABLE_OUTPUT(); TOSH_SET_BOOST_ENABLE_PIN(); TOSH_MAKE_ONE_WIRE_INPUT(); TOSH_SET_ONE_WIRE_PIN(); } static inline # 80 "d:/tinyos-1.x/tos/platform/avrmote/HPLInit.nc" result_t HPLInit$init(void) #line 80 { TOSH_SET_PIN_DIRECTIONS(); return SUCCESS; } # 70 "d:/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 # 46 "d:/tinyos-1.x/tos/platform/mica128/hardware.h" static __inline void TOSH_SET_INC_PIN(void) #line 46 { #line 46 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 2; } #line 45 static __inline void TOSH_SET_UD_PIN(void) #line 45 { #line 45 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 1; } static inline # 97 "d:/tinyos-1.x/tos/platform/avrmote/HPLPotC.nc" result_t HPLPotC$Pot$finalise(void) #line 97 { TOSH_SET_UD_PIN(); TOSH_SET_INC_PIN(); return SUCCESS; } # 101 "d:/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 # 47 "d:/tinyos-1.x/tos/platform/mica128/hardware.h" static __inline void TOSH_SET_POT_SELECT_PIN(void) #line 47 { #line 47 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) |= 1 << 5; } #line 46 static __inline void TOSH_CLR_INC_PIN(void) #line 46 { #line 46 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 2); } #line 47 static __inline void TOSH_CLR_POT_SELECT_PIN(void) #line 47 { #line 47 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) &= ~(1 << 5); } #line 45 static __inline void TOSH_CLR_UD_PIN(void) #line 45 { #line 45 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 1); } static inline # 88 "d:/tinyos-1.x/tos/platform/avrmote/HPLPotC.nc" result_t HPLPotC$Pot$increase(void) #line 88 { TOSH_CLR_UD_PIN(); TOSH_CLR_POT_SELECT_PIN(); TOSH_SET_INC_PIN(); TOSH_CLR_INC_PIN(); TOSH_SET_POT_SELECT_PIN(); return SUCCESS; } # 94 "d:/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 # 79 "d:/tinyos-1.x/tos/platform/avrmote/HPLPotC.nc" result_t HPLPotC$Pot$decrease(void) #line 79 { TOSH_SET_UD_PIN(); TOSH_CLR_POT_SELECT_PIN(); TOSH_SET_INC_PIN(); TOSH_CLR_INC_PIN(); TOSH_SET_POT_SELECT_PIN(); return SUCCESS; } # 86 "d:/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 "d:/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 "d:/tinyos-1.x/tos/interfaces/Pot.nc" inline static result_t RealMain$Pot$init(uint8_t arg_0xa260930){ #line 105 unsigned char result; #line 105 #line 105 result = PotM$Pot$init(arg_0xa260930); #line 105 #line 105 return result; #line 105 } #line 105 static inline # 108 "d:/tinyos-1.x/tos/system/sched.c" void TOSH_sched_init(void ) { TOSH_sched_free = 0; TOSH_sched_full = 0; } static inline # 81 "d:/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 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t BlinkM$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 # 82 "BlinkM.nc" result_t BlinkM$StdControl$init(void) #line 82 { BlinkM$Leds$init(); return SUCCESS; } # 52 "d:/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 = BlinkM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 172 "d:/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; } # 122 "d:/tinyos-1.x/tos/interfaces/Clock.nc" inline static result_t BlinkM$Clock$setRate(char arg_0xa291138, char arg_0xa291270){ #line 122 unsigned char result; #line 122 #line 122 result = HPLClock$Clock$setRate(arg_0xa291138, arg_0xa291270); #line 122 #line 122 return result; #line 122 } #line 122 static inline # 93 "BlinkM.nc" result_t BlinkM$StdControl$start(void) #line 93 { return BlinkM$Clock$setRate(TOS_I2PS, TOS_S2PS); } # 59 "d:/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 = BlinkM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 # 86 "d:/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 "d:/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 "d:/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(); } # 41 "d:/tinyos-1.x/tos/platform/mica128/hardware.h" static __inline void TOSH_CLR_RED_LED_PIN(void) #line 41 { #line 41 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 2); } static inline # 92 "d:/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; } static inline 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; } static inline result_t LedsC$Leds$redToggle(void) #line 110 { result_t rval; #line 112 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 112 { if (LedsC$ledsOn & LedsC$RED_BIT) { rval = LedsC$Leds$redOff(); } else { #line 116 rval = LedsC$Leds$redOn(); } } #line 118 __nesc_atomic_end(__nesc_atomic); } #line 118 return rval; } # 108 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t BlinkM$Leds$redToggle(void){ #line 108 unsigned char result; #line 108 #line 108 result = LedsC$Leds$redToggle(); #line 108 #line 108 return result; #line 108 } #line 108 static inline # 114 "BlinkM.nc" result_t BlinkM$Clock$fire(void) { BlinkM$Leds$redToggle(); return SUCCESS; } # 206 "d:/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 = BlinkM$Clock$fire(); #line 206 #line 206 return result; #line 206 } #line 206 # 130 "d:/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 "d:/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(); } } # 190 "d:/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(); }