app.c
上传用户:joranyuan
上传日期:2022-06-23
资源大小:3306k
文件大小:323k
源码类别:

网络

开发平台:

Others

  1. #define dbg(mode, format, ...) ((void)0)
  2. #define dbg_clear(mode, format, ...) ((void)0)
  3. #define dbg_active(mode) 0
  4. # 65 "/usr/avr/include/stdint.h"
  5. typedef signed char int8_t;
  6. typedef unsigned char uint8_t;
  7. # 104 "/usr/avr/include/stdint.h" 3
  8. typedef int int16_t;
  9. typedef unsigned int uint16_t;
  10. typedef long int32_t;
  11. typedef unsigned long uint32_t;
  12. typedef long long int64_t;
  13. typedef unsigned long long uint64_t;
  14. #line 155
  15. typedef int16_t intptr_t;
  16. typedef uint16_t uintptr_t;
  17. # 213 "/usr/lib/gcc-lib/avr/3.3/include/stddef.h" 3
  18. typedef unsigned int size_t;
  19. # 70 "/usr/avr/include/string.h"
  20. extern char *strcat(char *, const char *);
  21. extern size_t __attribute((__pure__)) strlen(const char *);
  22. # 325 "/usr/lib/gcc-lib/avr/3.3/include/stddef.h" 3
  23. typedef int wchar_t;
  24. # 66 "/usr/avr/include/stdlib.h"
  25. typedef struct __nesc_unnamed4242 {
  26.   int quot;
  27.   int rem;
  28. } div_t;
  29. typedef struct __nesc_unnamed4243 {
  30.   long quot;
  31.   long rem;
  32. } ldiv_t;
  33. typedef int (*__compar_fn_t)(const void *, const void *);
  34. # 151 "/usr/lib/gcc-lib/avr/3.3/include/stddef.h" 3
  35. typedef int ptrdiff_t;
  36. # 91 "/home/testuser/tinyos-1.x/tos/system/tos.h"
  37. typedef unsigned char bool;
  38. enum __nesc_unnamed4244 {
  39.   FALSE = 0, 
  40.   TRUE = 1
  41. };
  42. uint16_t TOS_LOCAL_ADDRESS = 1;
  43. enum __nesc_unnamed4245 {
  44.   FAIL = 0, 
  45.   SUCCESS = 1
  46. };
  47. static inline 
  48. uint8_t rcombine(uint8_t r1, uint8_t r2);
  49. typedef uint8_t  result_t;
  50. static inline 
  51. result_t rcombine(result_t r1, result_t r2);
  52. static inline 
  53. #line 133
  54. result_t rcombine4(result_t r1, result_t r2, result_t r3, 
  55. result_t r4);
  56. enum __nesc_unnamed4246 {
  57.   NULL = 0x0
  58. };
  59. # 90 "/usr/avr/include/avr/pgmspace.h"
  60. typedef void __attribute((__progmem__)) prog_void;
  61. typedef char __attribute((__progmem__)) prog_char;
  62. typedef unsigned char __attribute((__progmem__)) prog_uchar;
  63. typedef int8_t __attribute((__progmem__)) prog_int8_t;
  64. typedef uint8_t __attribute((__progmem__)) prog_uint8_t;
  65. typedef int16_t __attribute((__progmem__)) prog_int16_t;
  66. typedef uint16_t __attribute((__progmem__)) prog_uint16_t;
  67. typedef int32_t __attribute((__progmem__)) prog_int32_t;
  68. typedef uint32_t __attribute((__progmem__)) prog_uint32_t;
  69. typedef int64_t __attribute((__progmem__)) prog_int64_t;
  70. typedef uint64_t __attribute((__progmem__)) prog_uint64_t;
  71. # 139 "/home/testuser/tinyos-1.x/tos/platform/avrmote/avrhardware.h"
  72. enum __nesc_unnamed4247 {
  73.   TOSH_period16 = 0x00, 
  74.   TOSH_period32 = 0x01, 
  75.   TOSH_period64 = 0x02, 
  76.   TOSH_period128 = 0x03, 
  77.   TOSH_period256 = 0x04, 
  78.   TOSH_period512 = 0x05, 
  79.   TOSH_period1024 = 0x06, 
  80.   TOSH_period2048 = 0x07
  81. };
  82. static inline 
  83. void TOSH_wait(void);
  84. typedef uint8_t __nesc_atomic_t;
  85. __nesc_atomic_t __nesc_atomic_start(void );
  86. void __nesc_atomic_end(__nesc_atomic_t oldSreg);
  87. __inline __nesc_atomic_t  __nesc_atomic_start(void );
  88. __inline void  __nesc_atomic_end(__nesc_atomic_t oldSreg);
  89. static 
  90. __inline void __nesc_atomic_sleep(void);
  91. static 
  92. __inline void __nesc_enable_interrupt(void);
  93. # 241 "../../tos/platform/mica2/CC1000Const.h"
  94. static const prog_uchar CC1K_LPL_PreambleLength[9 * 2] = { 
  95. 0, 6, 
  96. 0x0, 48, 
  97. 0x0, 60, 
  98. 0x0, 144, 
  99. 0x1, 0x0f, 
  100. 0x1, 0xf8, 
  101. 0x3, 0xd9, 
  102. 0x7, 0x9b, 
  103. 0xf, 0x06 };
  104. static const prog_uchar CC1K_LPL_SleepTime[9 * 2] = { 
  105. 0, 0, 
  106. 0x0, 10, 
  107. 0x0, 25, 
  108. 0x0, 50, 
  109. 0x0, 100, 
  110. 0x0, 200, 
  111. 0x1, 0x90, 
  112. 0x3, 0x20, 
  113. 0x6, 0x40 };
  114. #line 277
  115. static const prog_uchar CC1K_Params[6][31] = { 
  116. 0x31, 
  117. 0x58, 0x00, 0x00, 
  118. 0x57, 0xf6, 0x85, 
  119. 0X03, 0x55, (
  120. 4 << 4) | (1 << 2), 
  121. 1 << 1, (
  122. 0x0 << 4) | (0xf << 0), 
  123. 12 << 3, 
  124. 0xe << 4, (
  125. 1 << 5) | (6 << 0), (
  126. 0 << 7) | (28 << 0), (((
  127. 3 << 5) | (1 << 3)) | (1 << 1)) | (1 << 0), ((
  128. 5 << 4) | (1 << 2)) | (1 << 0), (
  129. 0x7 << 4) | (0x0 << 0), 
  130. 1 << 0, 
  131. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
  132. 0x00, 
  133. 0x00, (
  134. 8 << 4) | (1 << 0), 
  135. TRUE }, 
  136. 0x31, 
  137. 0x7c, 0x00, 0x00, 
  138. 0x7b, 0xf9, 0xae, 
  139. 0x02, 0x38, (
  140. 8 << 4) | (3 << 2), ((
  141. 1 << 5) | (2 << 3)) | (1 << 1), (
  142. 0x8 << 4) | (0x0 << 0), 
  143. 8 << 3, 
  144. 0x1 << 4, (
  145. 1 << 5) | (6 << 0), (
  146. 1 << 7) | (33 << 0), (((
  147. 3 << 5) | (1 << 3)) | (1 << 1)) | (1 << 0), ((
  148. 5 << 4) | (1 << 2)) | (1 << 0), (
  149. 0x1 << 4) | (0x0 << 0), 
  150. 1 << 0, 
  151. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
  152. 0x00, 
  153. 0x00, (
  154. 15 << 4) | (3 << 0), 
  155. TRUE }, 
  156. 0x31, 
  157. 0x51, 0x00, 0x00, 
  158. 0x50, 0xf7, 0x4F, 
  159. 0X03, 0x0E, (
  160. 4 << 4) | (1 << 2), 
  161. 1 << 1, (
  162. 0x0 << 4) | (0xf << 0), 
  163. 11 << 3, 
  164. 0xe << 4, (
  165. 1 << 5) | (6 << 0), (
  166. 1 << 7) | (33 << 0), (((
  167. 3 << 5) | (1 << 3)) | (1 << 1)) | (1 << 0), ((
  168. 5 << 4) | (1 << 2)) | (1 << 0), (
  169. 0x7 << 4) | (0x0 << 0), 
  170. 1 << 0, 
  171. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
  172. 0x00, 
  173. 0x00, (
  174. 8 << 4) | (1 << 0), 
  175. TRUE }, 
  176. 0x31, 
  177. 0x5c, 0xe0, 0x00, 
  178. 0x5c, 0xdb, 0x42, 
  179. 0x01, 0xAA, (
  180. 8 << 4) | (3 << 2), ((
  181. 1 << 5) | (2 << 3)) | (1 << 1), (
  182. 0x8 << 4) | (0x0 << 0), 
  183. 6 << 3, 
  184. 0x1 << 4, (
  185. 1 << 5) | (6 << 0), (
  186. 1 << 7) | (33 << 0), (((
  187. 3 << 5) | (1 << 3)) | (1 << 1)) | (1 << 0), ((
  188. 5 << 4) | (1 << 2)) | (1 << 0), (
  189. 0x1 << 4) | (0x0 << 0), 
  190. 1 << 0, 
  191. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
  192. 0x00, 
  193. 0x00, (
  194. 15 << 4) | (3 << 0), 
  195. TRUE }, 
  196. 0x31, 
  197. 0x45, 0x60, 0x00, 
  198. 0x45, 0x55, 0xBB, 
  199. 0X03, 0x9C, (
  200. 8 << 4) | (0 << 2), 
  201. 1 << 1, (
  202. 0x0 << 4) | (0xf << 0), 
  203. 13 << 3, 
  204. 0xe << 4, (
  205. 1 << 5) | (6 << 0), (
  206. 1 << 7) | (33 << 0), (((
  207. 3 << 5) | (1 << 3)) | (1 << 1)) | (1 << 0), ((
  208. 5 << 4) | (1 << 2)) | (0 << 0), (
  209. 0x7 << 4) | (0x0 << 0), 
  210. 1 << 0, 
  211. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
  212. 0x00, 
  213. 0x00, (
  214. 8 << 4) | (1 << 0), 
  215. TRUE }, 
  216. 0x31, 
  217. 0x58, 0x00, 0x00, 
  218. 0x57, 0xf6, 0x85, 
  219. 0X03, 0x55, (
  220. 8 << 4) | (4 << 2), 
  221. 1 << 1, (
  222. 0x0 << 4) | (0xf << 0), 
  223. 12 << 3, 
  224. 0xe << 4, (
  225. 1 << 5) | (6 << 0), (
  226. 1 << 7) | (33 << 0), (((
  227. 3 << 5) | (1 << 3)) | (1 << 1)) | (1 << 0), ((
  228. 5 << 4) | (1 << 2)) | (1 << 0), (
  229. 0x7 << 4) | (0x0 << 0), 
  230. 1 << 0, 
  231. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
  232. 0x00, 
  233. 0x00, (
  234. 8 << 4) | (1 << 0), 
  235. TRUE } };
  236. static 
  237. # 101 "../../tos/platform/mica2/hardware.h"
  238. void __inline TOSH_uwait(int u_sec);
  239. #line 120
  240. static __inline void TOSH_CLR_SERIAL_ID_PIN(void);
  241. #line 120
  242. static __inline void TOSH_MAKE_SERIAL_ID_INPUT(void);
  243. static __inline void TOSH_MAKE_CC_CHP_OUT_INPUT(void);
  244. static __inline void TOSH_SET_CC_PDATA_PIN(void);
  245. #line 126
  246. static __inline void TOSH_CLR_CC_PDATA_PIN(void);
  247. #line 126
  248. static __inline int TOSH_READ_CC_PDATA_PIN(void);
  249. #line 126
  250. static __inline void TOSH_MAKE_CC_PDATA_OUTPUT(void);
  251. #line 126
  252. static __inline void TOSH_MAKE_CC_PDATA_INPUT(void);
  253. static __inline void TOSH_SET_CC_PCLK_PIN(void);
  254. #line 127
  255. static __inline void TOSH_CLR_CC_PCLK_PIN(void);
  256. #line 127
  257. static __inline void TOSH_MAKE_CC_PCLK_OUTPUT(void);
  258. static __inline void TOSH_SET_CC_PALE_PIN(void);
  259. #line 128
  260. static __inline void TOSH_CLR_CC_PALE_PIN(void);
  261. #line 128
  262. static __inline void TOSH_MAKE_CC_PALE_OUTPUT(void);
  263. #line 143
  264. static __inline void TOSH_MAKE_MOSI_OUTPUT(void);
  265. #line 143
  266. static __inline void TOSH_MAKE_MOSI_INPUT(void);
  267. static __inline void TOSH_MAKE_MISO_OUTPUT(void);
  268. #line 144
  269. static __inline void TOSH_MAKE_MISO_INPUT(void);
  270. static __inline void TOSH_MAKE_SPI_OC1C_INPUT(void);
  271. static __inline void TOSH_MAKE_SPI_SCK_INPUT(void);
  272. static __inline void TOSH_MAKE_PW0_OUTPUT(void);
  273. static __inline void TOSH_MAKE_PW1_OUTPUT(void);
  274. static __inline void TOSH_MAKE_PW2_OUTPUT(void);
  275. static __inline void TOSH_MAKE_PW3_OUTPUT(void);
  276. static __inline void TOSH_MAKE_PW4_OUTPUT(void);
  277. static __inline void TOSH_MAKE_PW5_OUTPUT(void);
  278. static __inline void TOSH_MAKE_PW6_OUTPUT(void);
  279. static __inline void TOSH_MAKE_PW7_OUTPUT(void);
  280. static inline 
  281. #line 171
  282. void TOSH_SET_PIN_DIRECTIONS(void );
  283. #line 201
  284. enum __nesc_unnamed4248 {
  285.   TOSH_ADC_PORTMAPSIZE = 12
  286. };
  287. enum __nesc_unnamed4249 {
  288.   TOSH_ACTUAL_CC_RSSI_PORT = 0, 
  289.   TOSH_ACTUAL_VOLTAGE_PORT = 7, 
  290.   TOSH_ACTUAL_BANDGAP_PORT = 30, 
  291.   TOSH_ACTUAL_GND_PORT = 31
  292. };
  293. enum __nesc_unnamed4250 {
  294.   TOS_ADC_CC_RSSI_PORT = 0, 
  295.   TOS_ADC_VOLTAGE_PORT = 7, 
  296.   TOS_ADC_BANDGAP_PORT = 10, 
  297.   TOS_ADC_GND_PORT = 11
  298. };
  299. # 54 "/home/testuser/tinyos-1.x/tos/types/dbg_modes.h"
  300. typedef long long TOS_dbg_mode;
  301. enum __nesc_unnamed4251 {
  302.   DBG_ALL = ~0ULL, 
  303.   DBG_BOOT = 1ULL << 0, 
  304.   DBG_CLOCK = 1ULL << 1, 
  305.   DBG_TASK = 1ULL << 2, 
  306.   DBG_SCHED = 1ULL << 3, 
  307.   DBG_SENSOR = 1ULL << 4, 
  308.   DBG_LED = 1ULL << 5, 
  309.   DBG_CRYPTO = 1ULL << 6, 
  310.   DBG_ROUTE = 1ULL << 7, 
  311.   DBG_AM = 1ULL << 8, 
  312.   DBG_CRC = 1ULL << 9, 
  313.   DBG_PACKET = 1ULL << 10, 
  314.   DBG_ENCODE = 1ULL << 11, 
  315.   DBG_RADIO = 1ULL << 12, 
  316.   DBG_LOG = 1ULL << 13, 
  317.   DBG_ADC = 1ULL << 14, 
  318.   DBG_I2C = 1ULL << 15, 
  319.   DBG_UART = 1ULL << 16, 
  320.   DBG_PROG = 1ULL << 17, 
  321.   DBG_SOUNDER = 1ULL << 18, 
  322.   DBG_TIME = 1ULL << 19, 
  323.   DBG_POWER = 1ULL << 20, 
  324.   DBG_SIM = 1ULL << 21, 
  325.   DBG_QUEUE = 1ULL << 22, 
  326.   DBG_SIMRADIO = 1ULL << 23, 
  327.   DBG_HARD = 1ULL << 24, 
  328.   DBG_MEM = 1ULL << 25, 
  329.   DBG_USR1 = 1ULL << 27, 
  330.   DBG_USR2 = 1ULL << 28, 
  331.   DBG_USR3 = 1ULL << 29, 
  332.   DBG_TEMP = 1ULL << 30, 
  333.   DBG_ERROR = 1ULL << 31, 
  334.   DBG_NONE = 0, 
  335.   DBG_DEFAULT = DBG_ALL
  336. };
  337. # 59 "/home/testuser/tinyos-1.x/tos/system/sched.c"
  338. typedef struct __nesc_unnamed4252 {
  339.   void (*tp)(void);
  340. } TOSH_sched_entry_T;
  341. enum __nesc_unnamed4253 {
  342.   TOSH_MAX_TASKS = 8, 
  343.   TOSH_TASK_BITMASK = TOSH_MAX_TASKS - 1
  344. };
  345. volatile TOSH_sched_entry_T TOSH_queue[TOSH_MAX_TASKS];
  346. uint8_t TOSH_sched_full;
  347. volatile uint8_t TOSH_sched_free;
  348. static inline 
  349. void TOSH_sched_init(void );
  350. bool TOS_post(void (*tp)(void));
  351. #line 102
  352. bool  TOS_post(void (*tp)(void));
  353. static inline 
  354. #line 136
  355. bool TOSH_run_next_task(void);
  356. static inline 
  357. #line 159
  358. void TOSH_run_task(void);
  359. static inline 
  360. # 159 "/home/testuser/tinyos-1.x/tos/system/tos.h"
  361. void *nmemset(void *to, int val, size_t n);
  362. # 28 "/home/testuser/tinyos-1.x/tos/system/Ident.h"
  363. enum __nesc_unnamed4254 {
  364.   IDENT_MAX_PROGRAM_NAME_LENGTH = 16
  365. };
  366. typedef struct __nesc_unnamed4255 {
  367.   uint32_t unix_time;
  368.   uint32_t user_hash;
  369.   char program_name[IDENT_MAX_PROGRAM_NAME_LENGTH];
  370. } Ident_t;
  371. # 6 "MultiHopTtestMSG.h"
  372. enum __nesc_unnamed4256 {
  373.   AM_MULTIHOP = 77
  374. };
  375. enum __nesc_unnamed4257 {
  376.   ROUTE_TIME = 60000L, 
  377.   DRAND_TIME = 200000L, 
  378.   STAT_TIME = 10240
  379. };
  380. typedef struct multiHopMsg {
  381.   uint8_t sendID;
  382.   uint8_t dummyData[20];
  383. } multiHopMsg;
  384. # 39 "../../tos/interfaces/SClock.h"
  385. enum __nesc_unnamed4258 {
  386.   CLK_STOP = 0, 
  387.   CLK_DIV_1 = 1, 
  388.   CLK_DIV_8 = 2, 
  389.   CLK_DIV_64 = 3, 
  390.   CLK_DIV_256 = 4, 
  391.   CLK_DIV_1024 = 5
  392. };
  393. enum __nesc_unnamed4259 {
  394.   MAX_VAL = 0xFFFF
  395. };
  396. enum __nesc_unnamed4260 {
  397.   POSITIVE = 1, 
  398.   NEGATIVE = 2, 
  399.   ZERO = 3
  400. };
  401. typedef struct GTime {
  402.   uint16_t sticks;
  403.   uint16_t mticks;
  404. } GTime;
  405. # 6 "../../tos/system/DrandMSG.h"
  406. enum __nesc_unnamed4261 {
  407.   MAX_NBR = 20, 
  408.   MAX_ONE_HOP = 15
  409. };
  410. enum __nesc_unnamed4262 {
  411.   MAX_GRANT = 30, 
  412.   MAX_REQUEST = 30, 
  413.   MAX_FRAME = 30, 
  414.   MAX_REPORT = 30
  415. };
  416. enum __nesc_unnamed4263 {
  417.   AM_HELLO = 31, 
  418.   AM_REQUEST = 32, 
  419.   AM_GRANT = 33, 
  420.   AM_RELEASE = 34, 
  421.   AM_REJECT = 35, 
  422.   AM_TWOHOP = 36, 
  423.   AM_REPORT = 37, 
  424.   AM_FRAME = 38
  425. };
  426. enum __nesc_unnamed4264 {
  427.   HELLO_PERIOD = 30000L, 
  428.   HELLO_INTERVAL = 500, 
  429.   GRANT_INTERVAL = 100, 
  430.   REPORT_INTERVAL = 100, 
  431.   REPORT_XPERIOD = 1000, 
  432.   FRAME_INTERVAL = 100, 
  433.   FRAME_XPERIOD = 1000, 
  434.   DRAND_PERIOD = 120000L, 
  435.   REPORT_PERIOD = 30000L
  436. };
  437. enum __nesc_unnamed4265 {
  438.   HELLO_STATE, 
  439.   REQUEST_STATE, 
  440.   GRANT_STATE, 
  441.   IDLE_STATE2, 
  442.   RELEASE_STATE, 
  443.   REPORT_STATE, 
  444.   FRAME_STATE
  445. };
  446. enum __nesc_unnamed4266 {
  447.   ONE_HOP = 0x1, 
  448.   TWO_HOP = 0x2, 
  449.   GRANT_SENT = 0x4
  450. };
  451. enum __nesc_unnamed4267 {
  452.   REPORT_REQUEST = 0, 
  453.   REPORT_REPLY = 1, 
  454.   FRAME_REQUEST = 2, 
  455.   FRAME_REPLY = 3
  456. };
  457. # 7 "../../tos/system/DrandInfo.h"
  458. typedef struct nodeInfo {
  459.   uint8_t nodeID;
  460.   uint8_t slot;
  461.   uint8_t frame;
  462.   uint8_t bitMap;
  463. } nodeInfo;
  464. typedef struct helloMsg {
  465.   uint8_t sendID;
  466.   uint8_t OneWayLen;
  467.   uint8_t OneWayId[MAX_NBR];
  468. } helloMsg;
  469. typedef struct requestMsg {
  470.   uint8_t sendID;
  471.   uint8_t numRemaining;
  472.   uint16_t OTT;
  473.   GTime timestamp;
  474.   uint8_t idMap[MAX_NBR];
  475. } requestMsg;
  476. typedef struct grantMsg {
  477.   uint8_t sendID;
  478.   uint8_t timeSlot[MAX_NBR];
  479.   GTime timestamp;
  480. } grantMsg;
  481. typedef struct rejectMsg {
  482.   uint8_t sendID;
  483. rejectMsg;
  484. typedef struct releaseMsg {
  485.   uint8_t sendID;
  486.   uint8_t slot;
  487. } releaseMsg;
  488. typedef struct twoHopMsg {
  489.   uint8_t sendID;
  490.   uint8_t slot;
  491.   uint8_t slotID;
  492. } twoHopMsg;
  493. typedef struct frameMsg {
  494.   uint8_t sendID;
  495.   uint8_t frame;
  496.   uint8_t type;
  497.   uint8_t oneHopNodeID[MAX_ONE_HOP];
  498.   uint8_t frameArray[MAX_ONE_HOP];
  499. } frameMsg;
  500. typedef struct reportMsg {
  501.   uint8_t sendID;
  502.   uint8_t slot;
  503.   uint8_t type;
  504.   uint8_t timeSlot[MAX_NBR];
  505. } reportMsg;
  506. # 4 "../../tos/types/AM.h"
  507. enum __nesc_unnamed4268 {
  508.   TOS_BCAST_ADDR = 0xffff, 
  509.   TOS_UART_ADDR = 0x007e
  510. };
  511. enum __nesc_unnamed4269 {
  512.   TOS_DEFAULT_AM_GROUP = 0x7d
  513. };
  514. uint8_t TOS_AM_GROUP = TOS_DEFAULT_AM_GROUP;
  515. #line 39
  516. typedef struct TOS_Msg {
  517.   uint16_t addr;
  518.   uint8_t type;
  519.   uint8_t group;
  520.   uint8_t length;
  521.   int8_t data[70];
  522.   uint16_t crc;
  523.   uint16_t strength;
  524.   uint8_t ack;
  525.   uint16_t time;
  526.   uint8_t sendSecurityMode;
  527.   uint8_t receiveSecurityMode;
  528. } TOS_Msg;
  529. typedef struct TOS_Msg_TinySecCompat {
  530.   uint16_t addr;
  531.   uint8_t type;
  532.   uint8_t length;
  533.   uint8_t group;
  534.   int8_t data[70];
  535.   uint16_t crc;
  536.   uint16_t strength;
  537.   uint8_t ack;
  538.   uint16_t time;
  539.   uint8_t sendSecurityMode;
  540.   uint8_t receiveSecurityMode;
  541. } TOS_Msg_TinySecCompat;
  542. typedef struct TinySec_Msg {
  543.   uint16_t addr;
  544.   uint8_t type;
  545.   uint8_t length;
  546.   uint8_t iv[4];
  547.   uint8_t enc[70];
  548.   uint8_t mac[4];
  549.   uint8_t calc_mac[4];
  550.   uint8_t ack_byte;
  551.   bool cryptoDone;
  552.   bool receiveDone;
  553.   bool MACcomputed;
  554. } __attribute((packed))  TinySec_Msg;
  555. enum __nesc_unnamed4270 {
  556.   MSG_DATA_SIZE = (size_t )& ((struct TOS_Msg *)0)->crc + sizeof(uint16_t ), 
  557.   TINYSEC_MSG_DATA_SIZE = (size_t )& ((struct TinySec_Msg *)0)->mac + 4, 
  558.   DATA_LENGTH = 70, 
  559.   LENGTH_BYTE_NUMBER = (size_t )& ((struct TOS_Msg *)0)->length + 1, 
  560.   TINYSEC_NODE_ID_SIZE = sizeof(uint16_t )
  561. };
  562. enum __nesc_unnamed4271 {
  563.   TINYSEC_AUTH_ONLY = 1, 
  564.   TINYSEC_ENCRYPT_AND_AUTH = 2, 
  565.   TINYSEC_DISABLED = 3, 
  566.   TINYSEC_RECEIVE_AUTHENTICATED = 4, 
  567.   TINYSEC_RECEIVE_CRC = 5, 
  568.   TINYSEC_RECEIVE_ANY = 6, 
  569.   TINYSEC_ENABLED_BIT = 128, 
  570.   TINYSEC_ENCRYPT_ENABLED_BIT = 64
  571. } __attribute((packed)) ;
  572. typedef TOS_Msg *TOS_MsgPtr;
  573. # 39 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.h"
  574. enum __nesc_unnamed4272 {
  575.   TIMER_REPEAT = 0, 
  576.   TIMER_ONE_SHOT = 1, 
  577.   NUM_TIMERS = 10
  578. };
  579. # 4 "../../tos/platform/mica2/zmacInfo.h"
  580. typedef struct syncMsgType {
  581.   uint16_t mticks;
  582.   uint16_t sticks;
  583.   uint8_t trust;
  584.   uint16_t sender;
  585. } syncMsgType;
  586. typedef struct ecnMsgType {
  587.   uint8_t hopCount;
  588.   uint16_t nextHop;
  589.   uint16_t senderAddress;
  590. } ecnMsgType;
  591. typedef struct ecnForwardMsgType {
  592.   uint8_t hopCount;
  593.   uint16_t nextHop;
  594.   uint16_t senderAddress;
  595. } ecnForwardMsgType;
  596. # 31 "/home/testuser/tinyos-1.x/tos/platform/avrmote/crc.h"
  597. uint16_t __attribute((__progmem__)) crcTable[256] = { 
  598. 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 
  599. 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 
  600. 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 
  601. 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 
  602. 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 
  603. 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 
  604. 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 
  605. 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 
  606. 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 
  607. 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 
  608. 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 
  609. 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 
  610. 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 
  611. 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 
  612. 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 
  613. 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 
  614. 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 
  615. 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 
  616. 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 
  617. 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 
  618. 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 
  619. 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 
  620. 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 
  621. 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 
  622. 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 
  623. 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 
  624. 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 
  625. 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 
  626. 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 
  627. 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 
  628. 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 
  629. 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 };
  630. static inline 
  631. uint16_t crcByte(uint16_t oldCrc, uint8_t byte);
  632. # 35 "/home/testuser/tinyos-1.x/tos/interfaces/ADC.h"
  633. enum __nesc_unnamed4273 {
  634.   TOS_ADCSample3750ns = 0, 
  635.   TOS_ADCSample7500ns = 1, 
  636.   TOS_ADCSample15us = 2, 
  637.   TOS_ADCSample30us = 3, 
  638.   TOS_ADCSample60us = 4, 
  639.   TOS_ADCSample120us = 5, 
  640.   TOS_ADCSample240us = 6, 
  641.   TOS_ADCSample480us = 7
  642. };
  643. # 33 "/home/testuser/tinyos-1.x/tos/platform/mica128/Clock.h"
  644. enum __nesc_unnamed4274 {
  645.   TOS_I1000PS = 32, TOS_S1000PS = 1, 
  646.   TOS_I100PS = 40, TOS_S100PS = 2, 
  647.   TOS_I10PS = 101, TOS_S10PS = 3, 
  648.   TOS_I1024PS = 0, TOS_S1024PS = 3, 
  649.   TOS_I512PS = 1, TOS_S512PS = 3, 
  650.   TOS_I256PS = 3, TOS_S256PS = 3, 
  651.   TOS_I128PS = 7, TOS_S128PS = 3, 
  652.   TOS_I64PS = 15, TOS_S64PS = 3, 
  653.   TOS_I32PS = 31, TOS_S32PS = 3, 
  654.   TOS_I16PS = 63, TOS_S16PS = 3, 
  655.   TOS_I8PS = 127, TOS_S8PS = 3, 
  656.   TOS_I4PS = 255, TOS_S4PS = 3, 
  657.   TOS_I2PS = 15, TOS_S2PS = 7, 
  658.   TOS_I1PS = 31, TOS_S1PS = 7, 
  659.   TOS_I0PS = 0, TOS_S0PS = 0
  660. };
  661. enum __nesc_unnamed4275 {
  662.   DEFAULT_SCALE = 3, DEFAULT_INTERVAL = 127
  663. };
  664. # 44 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHop.h"
  665. enum __nesc_unnamed4276 {
  666.   AM_MULTIHOPMSG = 250, 
  667.   AM_DEBUGPACKET = 3
  668. };
  669. typedef struct TOS_MHopNeighbor {
  670.   uint16_t addr;
  671.   uint16_t recv_count;
  672.   uint16_t fail_count;
  673.   int16_t last_seqno;
  674.   uint8_t goodness;
  675.   uint8_t hopcount;
  676.   uint8_t timeouts;
  677. } TOS_MHopNeighbor;
  678. typedef struct MultihopMsg {
  679.   uint16_t sourceaddr;
  680.   uint16_t originaddr;
  681.   int16_t seqno;
  682.   uint8_t hopcount;
  683.   uint8_t data[70 - 7];
  684. } __attribute((packed))  TOS_MHopMsg;
  685. typedef struct DBGEstEntry {
  686.   uint16_t id;
  687.   uint8_t hopcount;
  688.   uint8_t sendEst;
  689. } __attribute((packed))  DBGEstEntry;
  690. typedef struct DebugPacket {
  691.   uint8_t estEntries;
  692.   DBGEstEntry estList[5];
  693. } __attribute((packed))  DebugPacket;
  694. static  result_t PotM$Pot$init(uint8_t arg_0x85191f0);
  695. static  result_t HPLPotC$Pot$finalise(void);
  696. static  result_t HPLPotC$Pot$decrease(void);
  697. static  result_t HPLPotC$Pot$increase(void);
  698. static  result_t HPLInit$init(void);
  699. static  result_t MultiHopTtestM$SendTimer$fired(void);
  700. static  result_t MultiHopTtestM$Intercept$intercept(TOS_MsgPtr arg_0x854f548, void *arg_0x854f6a0, uint16_t arg_0x854f7f8);
  701. static  result_t MultiHopTtestM$Send$sendDone(TOS_MsgPtr arg_0x8563dd8, result_t arg_0x8563f28);
  702. static  result_t MultiHopTtestM$RouteTimer$fired(void);
  703. static  result_t MultiHopTtestM$StatTimer$fired(void);
  704. static  result_t MultiHopTtestM$StdControl$init(void);
  705. static  result_t MultiHopTtestM$StdControl$start(void);
  706. static  TOS_MsgPtr AMPromiscuous$ReceiveMsg$default$receive(uint8_t arg_0x85aae88, TOS_MsgPtr arg_0x85b1db0);
  707. static  result_t AMPromiscuous$ActivityTimer$fired(void);
  708. static  result_t AMPromiscuous$UARTSend$sendDone(TOS_MsgPtr arg_0x85bb080, result_t arg_0x85bb1d0);
  709. static  TOS_MsgPtr AMPromiscuous$RadioReceive$receive(TOS_MsgPtr arg_0x85b1db0);
  710. static  result_t AMPromiscuous$CommControl$setPromiscuous(bool arg_0x85a8158);
  711. static  result_t AMPromiscuous$Control$init(void);
  712. static  result_t AMPromiscuous$Control$start(void);
  713. static  result_t AMPromiscuous$default$sendDone(void);
  714. static  result_t AMPromiscuous$RadioSend$sendDone(TOS_MsgPtr arg_0x85bb080, result_t arg_0x85bb1d0);
  715. static  result_t AMPromiscuous$SendMsg$send(uint8_t arg_0x85aa8d0, uint16_t arg_0x85a9e28, uint8_t arg_0x85b0010, TOS_MsgPtr arg_0x85b0160);
  716. static  TOS_MsgPtr AMPromiscuous$UARTReceive$receive(TOS_MsgPtr arg_0x85b1db0);
  717. static  result_t CC1000RadioIntM$SetDrand$Set(nodeInfo *arg_0x85796b8, uint8_t arg_0x8579800, nodeInfo *arg_0x8579968, uint16_t arg_0x8579ab8);
  718. static   uint16_t CC1000RadioIntM$GetPower_sp(void);
  719. static  result_t CC1000RadioIntM$SquelchTimer$fired(void);
  720. static   uint16_t CC1000RadioIntM$GetSquelch(void);
  721. static   result_t CC1000RadioIntM$ResetPower(void);
  722. static  result_t CC1000RadioIntM$Send$send(TOS_MsgPtr arg_0x85bab68);
  723. static   uint16_t CC1000RadioIntM$GetDataSent(void);
  724. static   result_t CC1000RadioIntM$ResetDataSent(void);
  725. static  result_t CC1000RadioIntM$TDMATimer$fired(void);
  726. static   result_t CC1000RadioIntM$SpiByteFifo$dataReady(uint8_t arg_0x86357c8);
  727. static  result_t CC1000RadioIntM$WakeupTimer$fired(void);
  728. static   void CC1000RadioIntM$RadioReceiveCoordinator$default$byte(TOS_MsgPtr arg_0x85f8180, uint8_t arg_0x85f82d0);
  729. static   void CC1000RadioIntM$RadioReceiveCoordinator$default$blockTimer(void);
  730. static   void CC1000RadioIntM$RadioReceiveCoordinator$default$startSymbol(uint8_t arg_0x85eba50, uint8_t arg_0x85ebb98, TOS_MsgPtr arg_0x85ebce8);
  731. static   void CC1000RadioIntM$RadioSendCoordinator$default$byte(TOS_MsgPtr arg_0x85f8180, uint8_t arg_0x85f82d0);
  732. static   void CC1000RadioIntM$RadioSendCoordinator$default$blockTimer(void);
  733. static   void CC1000RadioIntM$RadioSendCoordinator$default$startSymbol(uint8_t arg_0x85eba50, uint8_t arg_0x85ebb98, TOS_MsgPtr arg_0x85ebce8);
  734. static   uint16_t CC1000RadioIntM$GetPower_tx(void);
  735. static   uint16_t CC1000RadioIntM$GetPower_rx(void);
  736. static   result_t CC1000RadioIntM$SClock$syncDone(void);
  737. static   result_t CC1000RadioIntM$SClock$fire(uint16_t arg_0x8624768);
  738. static  result_t CC1000RadioIntM$StdControl$init(void);
  739. static  result_t CC1000RadioIntM$StdControl$start(void);
  740. static   result_t CC1000RadioIntM$RSSIADC$dataReady(uint16_t arg_0x8636a60);
  741. static   int16_t CC1000RadioIntM$MacBackoff$default$initialBackoff(TOS_MsgPtr arg_0x85f7e60);
  742. static   int16_t CC1000RadioIntM$MacBackoff$default$congestionBackoff(TOS_MsgPtr arg_0x85fe310);
  743. static  result_t CC1000ControlM$CC1000Control$SetRFPower(uint8_t arg_0x856ce78);
  744. static  bool CC1000ControlM$CC1000Control$GetLOStatus(void);
  745. static  result_t CC1000ControlM$CC1000Control$TunePreset(uint8_t arg_0x85513e8);
  746. static   result_t CC1000ControlM$CC1000Control$RxMode(void);
  747. static  result_t CC1000ControlM$CC1000Control$BIASOn(void);
  748. static   result_t CC1000ControlM$CC1000Control$TxMode(void);
  749. static  result_t CC1000ControlM$CC1000Control$SelectLock(uint8_t arg_0x856d710);
  750. static  result_t CC1000ControlM$StdControl$init(void);
  751. static  result_t CC1000ControlM$StdControl$start(void);
  752. static  result_t CC1000ControlM$StdControl$stop(void);
  753. static  result_t HPLCC1000M$HPLCC1000$init(void);
  754. static   uint8_t HPLCC1000M$HPLCC1000$read(uint8_t arg_0x87b1d20);
  755. static   result_t HPLCC1000M$HPLCC1000$write(uint8_t arg_0x87b1768, uint8_t arg_0x87b18b0);
  756. static   uint16_t RandomLFSR$Random$rand(void);
  757. static   result_t RandomLFSR$Random$init(void);
  758. static   result_t ADCREFM$HPLADC$dataReady(uint16_t arg_0x87f91b8);
  759. static   result_t ADCREFM$CalADC$default$dataReady(uint8_t arg_0x87e1f08, uint16_t arg_0x8636a60);
  760. static  result_t ADCREFM$ADCControl$bindPort(uint8_t arg_0x8630810, uint8_t arg_0x8630958);
  761. static  result_t ADCREFM$ADCControl$init(void);
  762. static   result_t ADCREFM$ADCControl$manualCalibrate(void);
  763. static   result_t ADCREFM$ADC$getData(uint8_t arg_0x87e1880);
  764. static   result_t ADCREFM$ADC$default$dataReady(uint8_t arg_0x87e1880, uint16_t arg_0x8636a60);
  765. static  result_t ADCREFM$Timer$fired(void);
  766. static   result_t HPLADCM$ADC$bindPort(uint8_t arg_0x87f8060, uint8_t arg_0x87f81a8);
  767. static   result_t HPLADCM$ADC$init(void);
  768. static   result_t HPLADCM$ADC$samplePort(uint8_t arg_0x87f8690);
  769. static   result_t TimerM$Clock$fire(void);
  770. static  result_t TimerM$StdControl$init(void);
  771. static  result_t TimerM$StdControl$start(void);
  772. static  result_t TimerM$Timer$default$fired(uint8_t arg_0x85e4d90);
  773. static  result_t TimerM$Timer$start(uint8_t arg_0x85e4d90, char arg_0x8561bb8, uint32_t arg_0x8561d10);
  774. static  result_t TimerM$Timer$stop(uint8_t arg_0x85e4d90);
  775. static   void HPLClock$Clock$setInterval(uint8_t arg_0x882d378);
  776. static   uint8_t HPLClock$Clock$readCounter(void);
  777. static   result_t HPLClock$Clock$setRate(char arg_0x882c878, char arg_0x882c9b8);
  778. static   uint8_t HPLClock$Clock$getInterval(void);
  779. static   result_t NoLeds$Leds$greenToggle(void);
  780. static   result_t NoLeds$Leds$yellowToggle(void);
  781. static   result_t NoLeds$Leds$redToggle(void);
  782. static   uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void);
  783. static   result_t HPLSpiM$SpiByteFifo$initSlave(void);
  784. static   result_t HPLSpiM$SpiByteFifo$disableIntr(void);
  785. static   result_t HPLSpiM$SpiByteFifo$writeByte(uint8_t arg_0x8634010);
  786. static   result_t HPLSpiM$SpiByteFifo$enableIntr(void);
  787. static   result_t HPLSpiM$SpiByteFifo$txMode(void);
  788. static   result_t HPLSpiM$SpiByteFifo$rxMode(void);
  789. static   void HPLSClock$SClock$getTime(GTime *arg_0x862b720);
  790. static   void HPLSClock$SClock$setTime(uint8_t arg_0x862bb68, GTime *arg_0x862bcc8);
  791. static   result_t HPLSClock$SClock$SetRate(uint16_t arg_0x862a9b0, char arg_0x862aaf0);
  792. static   result_t FramerM$ByteComm$txDone(void);
  793. static   result_t FramerM$ByteComm$txByteReady(bool arg_0x88b1400);
  794. static   result_t FramerM$ByteComm$rxByteReady(uint8_t arg_0x88b0c30, bool arg_0x88b0d78, uint16_t arg_0x88b0ed0);
  795. static  result_t FramerM$BareSendMsg$send(TOS_MsgPtr arg_0x85bab68);
  796. static  result_t FramerM$StdControl$init(void);
  797. static  result_t FramerM$StdControl$start(void);
  798. static  result_t FramerM$TokenReceiveMsg$ReflectToken(uint8_t arg_0x88b2a98);
  799. static  TOS_MsgPtr FramerAckM$ReceiveMsg$receive(TOS_MsgPtr arg_0x85b1db0);
  800. static  TOS_MsgPtr FramerAckM$TokenReceiveMsg$receive(TOS_MsgPtr arg_0x88b2338, uint8_t arg_0x88b2480);
  801. static   result_t UARTM$HPLUART$get(uint8_t arg_0x88d4fc8);
  802. static   result_t UARTM$HPLUART$putDone(void);
  803. static   result_t UARTM$ByteComm$txByte(uint8_t arg_0x88b07a0);
  804. static  result_t UARTM$Control$init(void);
  805. static  result_t UARTM$Control$start(void);
  806. static   result_t HPLUART0M$UART$init(void);
  807. static   result_t HPLUART0M$UART$put(uint8_t arg_0x88d4ac8);
  808. static  TOS_MsgPtr MultiHopEngineM$ReceiveMsg$receive(uint8_t arg_0x89170b0, TOS_MsgPtr arg_0x85b1db0);
  809. static  result_t MultiHopEngineM$Intercept$default$intercept(uint8_t arg_0x8913f48, TOS_MsgPtr arg_0x854f548, void *arg_0x854f6a0, uint16_t arg_0x854f7f8);
  810. static  result_t MultiHopEngineM$Send$send(uint8_t arg_0x89138e0, TOS_MsgPtr arg_0x8562cc0, uint16_t arg_0x8562e10);
  811. static  void *MultiHopEngineM$Send$getBuffer(uint8_t arg_0x89138e0, TOS_MsgPtr arg_0x8563448, uint16_t *arg_0x85635b0);
  812. static  result_t MultiHopEngineM$Send$default$sendDone(uint8_t arg_0x89138e0, TOS_MsgPtr arg_0x8563dd8, result_t arg_0x8563f28);
  813. static  result_t MultiHopEngineM$SendMsg$sendDone(uint8_t arg_0x89175b0, TOS_MsgPtr arg_0x85b0580, result_t arg_0x85b06d0);
  814. static  result_t MultiHopEngineM$StdControl$init(void);
  815. static  result_t MultiHopEngineM$StdControl$start(void);
  816. static  uint16_t MultiHopEngineM$RouteControl$getParent(void);
  817. static  result_t MultiHopWMEWMA$RouteSelect$selectRoute(TOS_MsgPtr arg_0x89392f8, uint8_t arg_0x8939440);
  818. static  result_t MultiHopWMEWMA$RouteSelect$initializeFields(TOS_MsgPtr arg_0x89399b8, uint8_t arg_0x8939b00);
  819. static  result_t MultiHopWMEWMA$Timer$fired(void);
  820. static  TOS_MsgPtr MultiHopWMEWMA$ReceiveMsg$receive(TOS_MsgPtr arg_0x85b1db0);
  821. static  result_t MultiHopWMEWMA$Snoop$intercept(uint8_t arg_0x8947910, TOS_MsgPtr arg_0x854f548, void *arg_0x854f6a0, uint16_t arg_0x854f7f8);
  822. static  result_t MultiHopWMEWMA$DebugSendMsg$sendDone(TOS_MsgPtr arg_0x8563dd8, result_t arg_0x8563f28);
  823. static  result_t MultiHopWMEWMA$ATimer$fired(void);
  824. static  result_t MultiHopWMEWMA$SendMsg$sendDone(TOS_MsgPtr arg_0x85b0580, result_t arg_0x85b06d0);
  825. static  result_t MultiHopWMEWMA$StdControl$init(void);
  826. static  result_t MultiHopWMEWMA$StdControl$start(void);
  827. static  uint16_t MultiHopWMEWMA$RouteControl$getParent(void);
  828. static  result_t QueuedSendM$QueueSendMsg$send(uint8_t arg_0x89a2010, uint16_t arg_0x85a9e28, uint8_t arg_0x85b0010, TOS_MsgPtr arg_0x85b0160);
  829. static  result_t QueuedSendM$StdControl$init(void);
  830. static  result_t QueuedSendM$StdControl$start(void);
  831. static  result_t QueuedSendM$SerialSendMsg$sendDone(uint8_t arg_0x89a2998, TOS_MsgPtr arg_0x85b0580, result_t arg_0x85b06d0);
  832. static  
  833. # 47 "/home/testuser/tinyos-1.x/tos/system/RealMain.nc"
  834. result_t RealMain$hardwareInit(void);
  835. static  
  836. # 78 "/home/testuser/tinyos-1.x/tos/interfaces/Pot.nc"
  837. result_t RealMain$Pot$init(uint8_t arg_0x85191f0);
  838. static  
  839. # 63 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
  840. result_t RealMain$StdControl$init(void);
  841. static  
  842. result_t RealMain$StdControl$start(void);
  843. # 54 "/home/testuser/tinyos-1.x/tos/system/RealMain.nc"
  844. int   main(void);
  845. static  
  846. # 74 "/home/testuser/tinyos-1.x/tos/interfaces/HPLPot.nc"
  847. result_t PotM$HPLPot$finalise(void);
  848. static  
  849. #line 59
  850. result_t PotM$HPLPot$decrease(void);
  851. static  
  852. result_t PotM$HPLPot$increase(void);
  853. # 91 "/home/testuser/tinyos-1.x/tos/system/PotM.nc"
  854. uint8_t PotM$potSetting;
  855. static inline 
  856. void PotM$setPot(uint8_t value);
  857. static inline  
  858. #line 106
  859. result_t PotM$Pot$init(uint8_t initialSetting);
  860. static inline  
  861. # 57 "../../tos/platform/mica2/HPLPotC.nc"
  862. result_t HPLPotC$Pot$decrease(void);
  863. static inline  
  864. result_t HPLPotC$Pot$increase(void);
  865. static inline  
  866. result_t HPLPotC$Pot$finalise(void);
  867. static inline  
  868. # 57 "/home/testuser/tinyos-1.x/tos/platform/avrmote/HPLInit.nc"
  869. result_t HPLInit$init(void);
  870. static  
  871. # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
  872. result_t MultiHopTtestM$SendTimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10);
  873. static  
  874. # 4 "../../tos/interfaces/SetDrand.nc"
  875. result_t MultiHopTtestM$SetDrand$Set(nodeInfo *arg_0x85796b8, uint8_t arg_0x8579800, nodeInfo *arg_0x8579968, uint16_t arg_0x8579ab8);
  876. static   
  877. # 29 "MultiHopTtestM.nc"
  878. uint16_t MultiHopTtestM$GetPower_sp(void);
  879. static  
  880. # 83 "/home/testuser/tinyos-1.x/tos/interfaces/Send.nc"
  881. result_t MultiHopTtestM$Send$send(TOS_MsgPtr arg_0x8562cc0, uint16_t arg_0x8562e10);
  882. static  
  883. #line 106
  884. void *MultiHopTtestM$Send$getBuffer(TOS_MsgPtr arg_0x8563448, uint16_t *arg_0x85635b0);
  885. static   
  886. # 63 "/home/testuser/tinyos-1.x/tos/interfaces/Random.nc"
  887. uint16_t MultiHopTtestM$Random$rand(void);
  888. static   
  889. #line 57
  890. result_t MultiHopTtestM$Random$init(void);
  891. static   
  892. # 25 "MultiHopTtestM.nc"
  893. result_t MultiHopTtestM$ResetPower(void);
  894. static   result_t MultiHopTtestM$ResetDataSent(void);
  895. static   
  896. uint16_t MultiHopTtestM$GetDataSent(void);
  897. static  
  898. # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
  899. result_t MultiHopTtestM$RouteTimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10);
  900. static  
  901. #line 59
  902. result_t MultiHopTtestM$StatTimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10);
  903. static  
  904. # 150 "../../tos/platform/mica2/CC1000Control.nc"
  905. result_t MultiHopTtestM$RFset$SetRFPower(uint8_t arg_0x856ce78);
  906. static   
  907. # 27 "MultiHopTtestM.nc"
  908. uint16_t MultiHopTtestM$GetPower_tx(void);
  909. static   
  910. uint16_t MultiHopTtestM$GetPower_rx(void);
  911. static  
  912. # 49 "/home/testuser/tinyos-1.x/tos/interfaces/RouteControl.nc"
  913. uint16_t MultiHopTtestM$RouteControl$getParent(void);
  914. # 43 "/usr/lib/gcc-lib/avr/3.3/include/stdarg.h" 3
  915. typedef __builtin_va_list MultiHopTtestM$__gnuc_va_list;
  916. #line 105
  917. typedef MultiHopTtestM$__gnuc_va_list MultiHopTtestM$va_list;
  918. # 8 "../../tos/interfaces/SODebug.h"
  919. char MultiHopTtestM$debugbuf[256];
  920. static inline 
  921. void MultiHopTtestM$init_debug(void);
  922. static 
  923. #line 35
  924. void MultiHopTtestM$UARTPutChar(char c);
  925. static 
  926. void MultiHopTtestM$writedebug(void);
  927. static 
  928. int MultiHopTtestM$sprintf(uint8_t *buf, const uint8_t *format, ...);
  929. # 37 "MultiHopTtestM.nc"
  930. TOS_Msg MultiHopTtestM$DataPkt;
  931. uint16_t MultiHopTtestM$Rcount;
  932. uint16_t MultiHopTtestM$Scount;
  933. uint16_t MultiHopTtestM$time;
  934. bool MultiHopTtestM$txBusy;
  935. #line 41
  936. bool MultiHopTtestM$gotFrames;
  937. #line 41
  938. bool MultiHopTtestM$startSender;
  939. #line 41
  940. bool MultiHopTtestM$drandFirstTime;
  941. uint8_t MultiHopTtestM$eachCount[50];
  942. static inline  
  943. result_t MultiHopTtestM$StdControl$init(void);
  944. static inline  
  945. #line 68
  946. result_t MultiHopTtestM$StdControl$start(void);
  947. static inline  
  948. #line 87
  949. result_t MultiHopTtestM$Send$sendDone(TOS_MsgPtr msg, result_t success);
  950. static inline  
  951. result_t MultiHopTtestM$Intercept$intercept(TOS_MsgPtr m, void *payload, uint16_t payloadLen);
  952. static inline  
  953. result_t MultiHopTtestM$SendTimer$fired(void);
  954. static inline  
  955. #line 123
  956. result_t MultiHopTtestM$StatTimer$fired(void);
  957. static inline  
  958. #line 149
  959. result_t MultiHopTtestM$RouteTimer$fired(void);
  960. static  
  961. # 75 "/home/testuser/tinyos-1.x/tos/interfaces/ReceiveMsg.nc"
  962. TOS_MsgPtr AMPromiscuous$ReceiveMsg$receive(
  963. # 57 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
  964. uint8_t arg_0x85aae88, 
  965. # 75 "/home/testuser/tinyos-1.x/tos/interfaces/ReceiveMsg.nc"
  966. TOS_MsgPtr arg_0x85b1db0);
  967. static  
  968. # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
  969. result_t AMPromiscuous$ActivityTimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10);
  970. static  
  971. # 58 "/home/testuser/tinyos-1.x/tos/interfaces/BareSendMsg.nc"
  972. result_t AMPromiscuous$UARTSend$send(TOS_MsgPtr arg_0x85bab68);
  973. static   
  974. # 41 "/home/testuser/tinyos-1.x/tos/interfaces/PowerManagement.nc"
  975. uint8_t AMPromiscuous$PowerManagement$adjustPower(void);
  976. static  
  977. # 63 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
  978. result_t AMPromiscuous$RadioControl$init(void);
  979. static  
  980. result_t AMPromiscuous$RadioControl$start(void);
  981. static  
  982. #line 63
  983. result_t AMPromiscuous$TimerControl$init(void);
  984. static  
  985. result_t AMPromiscuous$TimerControl$start(void);
  986. static  
  987. #line 63
  988. result_t AMPromiscuous$UARTControl$init(void);
  989. static  
  990. result_t AMPromiscuous$UARTControl$start(void);
  991. static   
  992. # 106 "/home/testuser/tinyos-1.x/tos/interfaces/Leds.nc"
  993. result_t AMPromiscuous$Leds$greenToggle(void);
  994. static  
  995. # 67 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
  996. result_t AMPromiscuous$sendDone(void);
  997. static  
  998. # 58 "/home/testuser/tinyos-1.x/tos/interfaces/BareSendMsg.nc"
  999. result_t AMPromiscuous$RadioSend$send(TOS_MsgPtr arg_0x85bab68);
  1000. static  
  1001. # 49 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
  1002. result_t AMPromiscuous$SendMsg$sendDone(
  1003. # 56 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
  1004. uint8_t arg_0x85aa8d0, 
  1005. # 49 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
  1006. TOS_MsgPtr arg_0x85b0580, result_t arg_0x85b06d0);
  1007. # 84 "/home/testuser/tinyos-1.x/tos/system/AMPromiscuous.nc"
  1008. bool AMPromiscuous$state;
  1009. TOS_MsgPtr AMPromiscuous$buffer;
  1010. uint16_t AMPromiscuous$lastCount;
  1011. uint16_t AMPromiscuous$counter;
  1012. bool AMPromiscuous$promiscuous_mode;
  1013. bool AMPromiscuous$crc_check;
  1014. static inline  
  1015. result_t AMPromiscuous$Control$init(void);
  1016. static inline  
  1017. #line 109
  1018. result_t AMPromiscuous$Control$start(void);
  1019. static inline  
  1020. #line 146
  1021. result_t AMPromiscuous$CommControl$setPromiscuous(bool value);
  1022. static inline 
  1023. #line 159
  1024. void AMPromiscuous$dbgPacket(TOS_MsgPtr data);
  1025. static 
  1026. result_t AMPromiscuous$reportSendDone(TOS_MsgPtr msg, result_t success);
  1027. static inline  
  1028. result_t AMPromiscuous$ActivityTimer$fired(void);
  1029. static inline   
  1030. result_t AMPromiscuous$default$sendDone(void);
  1031. static inline  
  1032. void AMPromiscuous$sendTask(void);
  1033. static inline  
  1034. #line 206
  1035. result_t AMPromiscuous$SendMsg$send(uint8_t id, uint16_t addr, uint8_t length, TOS_MsgPtr data);
  1036. static inline  
  1037. #line 236
  1038. result_t AMPromiscuous$UARTSend$sendDone(TOS_MsgPtr msg, result_t success);
  1039. static inline  
  1040. result_t AMPromiscuous$RadioSend$sendDone(TOS_MsgPtr msg, result_t success);
  1041. TOS_MsgPtr   prom_received(TOS_MsgPtr packet);
  1042. static inline   
  1043. #line 271
  1044. TOS_MsgPtr AMPromiscuous$ReceiveMsg$default$receive(uint8_t id, TOS_MsgPtr msg);
  1045. static inline  
  1046. TOS_MsgPtr AMPromiscuous$UARTReceive$receive(TOS_MsgPtr packet);
  1047. static inline  
  1048. TOS_MsgPtr AMPromiscuous$RadioReceive$receive(TOS_MsgPtr packet);
  1049. static  
  1050. # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
  1051. result_t CC1000RadioIntM$SquelchTimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10);
  1052. static  
  1053. result_t CC1000RadioIntM$SquelchTimer$stop(void);
  1054. static  
  1055. # 67 "/home/testuser/tinyos-1.x/tos/interfaces/BareSendMsg.nc"
  1056. result_t CC1000RadioIntM$Send$sendDone(TOS_MsgPtr arg_0x85bb080, result_t arg_0x85bb1d0);
  1057. static   
  1058. # 63 "/home/testuser/tinyos-1.x/tos/interfaces/Random.nc"
  1059. uint16_t CC1000RadioIntM$Random$rand(void);
  1060. static   
  1061. #line 57
  1062. result_t CC1000RadioIntM$Random$init(void);
  1063. static  
  1064. # 116 "../../tos/platform/mica2/ADCControl.nc"
  1065. result_t CC1000RadioIntM$ADCControl$bindPort(uint8_t arg_0x8630810, uint8_t arg_0x8630958);
  1066. static  
  1067. #line 77
  1068. result_t CC1000RadioIntM$ADCControl$init(void);
  1069. static  
  1070. # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
  1071. result_t CC1000RadioIntM$TDMATimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10);
  1072. static  
  1073. # 63 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
  1074. result_t CC1000RadioIntM$CC1000StdControl$init(void);
  1075. static  
  1076. result_t CC1000RadioIntM$CC1000StdControl$start(void);
  1077. static  
  1078. result_t CC1000RadioIntM$CC1000StdControl$stop(void);
  1079. static  
  1080. #line 63
  1081. result_t CC1000RadioIntM$TimerControl$init(void);
  1082. static  
  1083. # 75 "/home/testuser/tinyos-1.x/tos/interfaces/ReceiveMsg.nc"
  1084. TOS_MsgPtr CC1000RadioIntM$Receive$receive(TOS_MsgPtr arg_0x85b1db0);
  1085. static   
  1086. # 38 "../../tos/platform/mica2/SpiByteFifo.nc"
  1087. result_t CC1000RadioIntM$SpiByteFifo$initSlave(void);
  1088. static   
  1089. #line 37
  1090. result_t CC1000RadioIntM$SpiByteFifo$disableIntr(void);
  1091. static   
  1092. #line 33
  1093. result_t CC1000RadioIntM$SpiByteFifo$writeByte(uint8_t arg_0x8634010);
  1094. static   
  1095. result_t CC1000RadioIntM$SpiByteFifo$enableIntr(void);
  1096. static   
  1097. result_t CC1000RadioIntM$SpiByteFifo$txMode(void);
  1098. static   result_t CC1000RadioIntM$SpiByteFifo$rxMode(void);
  1099. static  
  1100. # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
  1101. result_t CC1000RadioIntM$WakeupTimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10);
  1102. static  
  1103. result_t CC1000RadioIntM$WakeupTimer$stop(void);
  1104. static   
  1105. # 36 "../../tos/platform/mica2/RadioCoordinator.nc"
  1106. void CC1000RadioIntM$RadioReceiveCoordinator$byte(TOS_MsgPtr arg_0x85f8180, uint8_t arg_0x85f82d0);
  1107. static   
  1108. void CC1000RadioIntM$RadioReceiveCoordinator$blockTimer(void);
  1109. static   
  1110. #line 31
  1111. void CC1000RadioIntM$RadioReceiveCoordinator$startSymbol(uint8_t arg_0x85eba50, uint8_t arg_0x85ebb98, TOS_MsgPtr arg_0x85ebce8);
  1112. static   
  1113. # 81 "/home/testuser/tinyos-1.x/tos/interfaces/Leds.nc"
  1114. result_t CC1000RadioIntM$Leds$redToggle(void);
  1115. static  
  1116. # 190 "../../tos/platform/mica2/CC1000Control.nc"
  1117. bool CC1000RadioIntM$CC1000Control$GetLOStatus(void);
  1118. static   
  1119. #line 116
  1120. result_t CC1000RadioIntM$CC1000Control$RxMode(void);
  1121. static  
  1122. #line 137
  1123. result_t CC1000RadioIntM$CC1000Control$BIASOn(void);
  1124. static   
  1125. #line 108
  1126. result_t CC1000RadioIntM$CC1000Control$TxMode(void);
  1127. static  
  1128. #line 170
  1129. result_t CC1000RadioIntM$CC1000Control$SelectLock(uint8_t arg_0x856d710);
  1130. static   
  1131. # 36 "../../tos/platform/mica2/RadioCoordinator.nc"
  1132. void CC1000RadioIntM$RadioSendCoordinator$byte(TOS_MsgPtr arg_0x85f8180, uint8_t arg_0x85f82d0);
  1133. static   
  1134. void CC1000RadioIntM$RadioSendCoordinator$blockTimer(void);
  1135. static   
  1136. #line 31
  1137. void CC1000RadioIntM$RadioSendCoordinator$startSymbol(uint8_t arg_0x85eba50, uint8_t arg_0x85ebb98, TOS_MsgPtr arg_0x85ebce8);
  1138. static   
  1139. # 63 "../../tos/interfaces/SClock.nc"
  1140. void CC1000RadioIntM$SClock$getTime(GTime *arg_0x862b720);
  1141. static   
  1142. void CC1000RadioIntM$SClock$setTime(uint8_t arg_0x862bb68, GTime *arg_0x862bcc8);
  1143. static   
  1144. #line 45
  1145. result_t CC1000RadioIntM$SClock$SetRate(uint16_t arg_0x862a9b0, char arg_0x862aaf0);
  1146. static   
  1147. # 52 "/home/testuser/tinyos-1.x/tos/interfaces/ADC.nc"
  1148. result_t CC1000RadioIntM$RSSIADC$getData(void);
  1149. static   
  1150. # 39 "../../tos/platform/mica2/MacBackoff.nc"
  1151. int16_t CC1000RadioIntM$MacBackoff$initialBackoff(TOS_MsgPtr arg_0x85f7e60);
  1152. static   int16_t CC1000RadioIntM$MacBackoff$congestionBackoff(TOS_MsgPtr arg_0x85fe310);
  1153. # 60 "../../tos/platform/mica2/CC1000RadioIntM.nc"
  1154. enum CC1000RadioIntM$__nesc_unnamed4277 {
  1155.   CC1000RadioIntM$NULL_STATE, 
  1156.   CC1000RadioIntM$TX_STATE, 
  1157.   CC1000RadioIntM$DISABLED_STATE, 
  1158.   CC1000RadioIntM$IDLE_STATE, 
  1159.   CC1000RadioIntM$PRETX_STATE, 
  1160.   CC1000RadioIntM$SYNC_STATE, 
  1161.   CC1000RadioIntM$RX_STATE, 
  1162.   CC1000RadioIntM$SENDING_ACK, 
  1163.   CC1000RadioIntM$POWER_DOWN_STATE, 
  1164.   CC1000RadioIntM$PULSE_CHECK_STATE
  1165. };
  1166. enum CC1000RadioIntM$__nesc_unnamed4278 {
  1167.   CC1000RadioIntM$TXSTATE_WAIT, 
  1168.   CC1000RadioIntM$TXSTATE_START, 
  1169.   CC1000RadioIntM$TXSTATE_PREAMBLE, 
  1170.   CC1000RadioIntM$TXSTATE_SYNC, 
  1171.   CC1000RadioIntM$TXSTATE_DATA, 
  1172.   CC1000RadioIntM$TXSTATE_CRC, 
  1173.   CC1000RadioIntM$TXSTATE_FLUSH, 
  1174.   CC1000RadioIntM$TXSTATE_WAIT_FOR_ACK, 
  1175.   CC1000RadioIntM$TXSTATE_READ_ACK, 
  1176.   CC1000RadioIntM$TXSTATE_DONE
  1177. };
  1178. enum CC1000RadioIntM$__nesc_unnamed4279 {
  1179.   CC1000RadioIntM$SYNC_BYTE = 0x33, 
  1180.   CC1000RadioIntM$NSYNC_BYTE = 0xcc, 
  1181.   CC1000RadioIntM$SYNC_WORD = 0x33cc, 
  1182.   CC1000RadioIntM$NSYNC_WORD = 0xcc33, 
  1183.   CC1000RadioIntM$ACK_LENGTH = 16, 
  1184.   CC1000RadioIntM$MAX_ACK_WAIT = 18, 
  1185.   CC1000RadioIntM$TIME_BETWEEN_CHECKS = 50, 
  1186.   CC1000RadioIntM$TIME_AFTER_CHECK = 30, 
  1187.   CC1000RadioIntM$CHECK_MA_COUNT = 100, 
  1188.   CC1000RadioIntM$SEND_MA_COUNT = 100, 
  1189.   CC1000RadioIntM$PREAMBLE_LENGTH_TO_BASE = 8, 
  1190.   CC1000RadioIntM$RECEIVE_MA_COUNT = 100
  1191. };
  1192. uint8_t CC1000RadioIntM$ack_code[5] = { 0xab, 0xba, 0x83, 0xaa, 0xaa };
  1193. uint8_t CC1000RadioIntM$RadioState;
  1194. uint8_t CC1000RadioIntM$RadioTxState;
  1195.  uint8_t CC1000RadioIntM$iRSSIcount;
  1196. uint8_t CC1000RadioIntM$RSSIInitState;
  1197. uint8_t CC1000RadioIntM$iSquelchCount;
  1198. uint16_t CC1000RadioIntM$txlength;
  1199. uint16_t CC1000RadioIntM$rxlength;
  1200. TOS_MsgPtr CC1000RadioIntM$txbufptr;
  1201. TOS_MsgPtr CC1000RadioIntM$rxbufptr;
  1202. TOS_Msg CC1000RadioIntM$RxBuf;
  1203. uint8_t CC1000RadioIntM$NextTxByte;
  1204. uint8_t CC1000RadioIntM$lplpower;
  1205. uint8_t CC1000RadioIntM$lplpowertx;
  1206. uint16_t CC1000RadioIntM$preamblelen;
  1207. uint16_t CC1000RadioIntM$sleeptime;
  1208. uint16_t CC1000RadioIntM$PreambleCount;
  1209. uint8_t CC1000RadioIntM$SOFCount;
  1210. uint16_t CC1000RadioIntM$search_word;
  1211. enum CC1000RadioIntM$__nesc_unnamed4280 {
  1212.   CC1000RadioIntM$BMAC, 
  1213.   CC1000RadioIntM$ZMAC
  1214. };
  1215. enum CC1000RadioIntM$__nesc_unnamed4281 {
  1216.   CC1000RadioIntM$MAX_VAL = 0xFFFF
  1217. };
  1218. enum CC1000RadioIntM$__nesc_unnamed4282 {
  1219.   CC1000RadioIntM$POSITIVE = 1, 
  1220.   CC1000RadioIntM$NEGATIVE = 2, 
  1221.   CC1000RadioIntM$ZERO = 3
  1222. };
  1223. nodeInfo CC1000RadioIntM$nbrInfo[MAX_NBR];
  1224. GTime CC1000RadioIntM$currentDiff;
  1225. #line 150
  1226. GTime CC1000RadioIntM$constOffset;
  1227. uint16_t CC1000RadioIntM$currentSender;
  1228. uint8_t CC1000RadioIntM$currentSign;
  1229. uint8_t CC1000RadioIntM$currentMAC;
  1230. uint16_t CC1000RadioIntM$localFrameLength;
  1231. uint16_t CC1000RadioIntM$globalFrameLength;
  1232. uint16_t CC1000RadioIntM$slotSize;
  1233. uint16_t CC1000RadioIntM$nextHop;
  1234. uint16_t CC1000RadioIntM$ownSlot;
  1235. uint16_t CC1000RadioIntM$slots_since_ecnsend;
  1236. uint16_t CC1000RadioIntM$slots_since_ecnrecv;
  1237. uint16_t CC1000RadioIntM$slots_since_ecncheck;
  1238. uint16_t CC1000RadioIntM$globalFrameSize;
  1239. uint16_t CC1000RadioIntM$localFrameSize;
  1240. uint16_t CC1000RadioIntM$globalSlot;
  1241. uint16_t CC1000RadioIntM$currentSlot;
  1242. uint16_t CC1000RadioIntM$slotMultiplier;
  1243. uint32_t CC1000RadioIntM$slotNum;
  1244. uint16_t CC1000RadioIntM$packetsSent;
  1245. uint16_t CC1000RadioIntM$pktsLastSync;
  1246. bool CC1000RadioIntM$needTimeSync;
  1247. uint16_t CC1000RadioIntM$congBackOffs;
  1248. double CC1000RadioIntM$avgLoss;
  1249. uint32_t CC1000RadioIntM$curHCLlist;
  1250. bool CC1000RadioIntM$HCLselect;
  1251. bool CC1000RadioIntM$ackOrig;
  1252. bool CC1000RadioIntM$ecnPending;
  1253. bool CC1000RadioIntM$ecnforward;
  1254. bool CC1000RadioIntM$enableHCL;
  1255. bool CC1000RadioIntM$pureHCL;
  1256. TOS_Msg CC1000RadioIntM$ecnMsgHdr;
  1257. TOS_Msg CC1000RadioIntM$ecnForwardMsgHdr;
  1258. TOS_Msg CC1000RadioIntM$syncMsgHdr;
  1259. union CC1000RadioIntM$__nesc_unnamed4283 {
  1260.   uint16_t W;
  1261.   struct  {
  1262.     uint8_t LSB;
  1263.     uint8_t MSB;
  1264.   } ;
  1265. } CC1000RadioIntM$RxShiftBuf;
  1266. uint8_t CC1000RadioIntM$RxBitOffset;
  1267. uint16_t CC1000RadioIntM$RxByteCnt;
  1268. uint16_t CC1000RadioIntM$TxByteCnt;
  1269. uint16_t CC1000RadioIntM$RSSISampleFreq;
  1270.  bool CC1000RadioIntM$bInvertRxData;
  1271.  bool CC1000RadioIntM$bTxPending;
  1272. bool CC1000RadioIntM$bAckEnable;
  1273. bool CC1000RadioIntM$bCCAEnable;
  1274. bool CC1000RadioIntM$bTxBusy;
  1275. bool CC1000RadioIntM$bRSSIValid;
  1276. uint16_t CC1000RadioIntM$CC1K_PulseLevel;
  1277. uint16_t CC1000RadioIntM$usRunningCRC;
  1278. uint16_t CC1000RadioIntM$usRSSIVal;
  1279. uint16_t CC1000RadioIntM$usSquelchVal;
  1280. uint16_t CC1000RadioIntM$usTempSquelch;
  1281. uint8_t CC1000RadioIntM$usSquelchIndex;
  1282.  uint8_t CC1000RadioIntM$pulse_check_count;
  1283.  uint16_t CC1000RadioIntM$pulse_check_sum;
  1284.  uint16_t CC1000RadioIntM$send_sum;
  1285.  uint16_t CC1000RadioIntM$receive_sum;
  1286.  uint16_t CC1000RadioIntM$power_sum;
  1287.  uint16_t CC1000RadioIntM$sp_sum;
  1288.  uint16_t CC1000RadioIntM$rx_sum;
  1289.  uint16_t CC1000RadioIntM$tx_sum;
  1290.  uint16_t CC1000RadioIntM$dataSent;
  1291. uint16_t CC1000RadioIntM$usSquelchTable[9];
  1292. int16_t CC1000RadioIntM$sMacDelay;
  1293. volatile uint16_t CC1000RadioIntM$LocalAddr;
  1294. static inline 
  1295. #line 245
  1296. uint16_t CC1000RadioIntM$getOwnerBackoff(void);
  1297. static inline 
  1298. uint16_t CC1000RadioIntM$getNonOwnerBackoff(void);
  1299. static inline 
  1300. void CC1000RadioIntM$DivTime2(GTime *B, GTime *A);
  1301. static inline 
  1302. void CC1000RadioIntM$AddTime(GTime *C, GTime *A, GTime *B);
  1303. static 
  1304. void CC1000RadioIntM$SubTime(GTime *C, GTime *A, GTime *B);
  1305. static 
  1306. uint16_t CC1000RadioIntM$getZMACBackoff(uint16_t residualBackoff);
  1307. static inline 
  1308. #line 306
  1309. uint8_t CC1000RadioIntM$ModSubTime(GTime *C, GTime *A, GTime *B);
  1310. static inline 
  1311. #line 329
  1312. bool CC1000RadioIntM$IsHCL(uint32_t gSlot);
  1313. static  
  1314. #line 342
  1315. void CC1000RadioIntM$adjustSquelch(void);
  1316. static inline 
  1317. #line 387
  1318. void CC1000RadioIntM$getTimeDiff(void);
  1319. static 
  1320. #line 409
  1321. void CC1000RadioIntM$Blacklist(uint8_t slot, uint8_t fsize);
  1322. static inline  
  1323. #line 424
  1324. void CC1000RadioIntM$adjustTime(void);
  1325. static  
  1326. void CC1000RadioIntM$PacketRcvd(void);
  1327. static inline  
  1328. #line 506
  1329. void CC1000RadioIntM$PacketSent(void);
  1330. static  
  1331. #line 563
  1332. result_t CC1000RadioIntM$SetDrand$Set(nodeInfo *mInfo, uint8_t nHop, nodeInfo *nInfo, uint16_t sSize);
  1333. static inline  
  1334. #line 648
  1335. result_t CC1000RadioIntM$StdControl$init(void);
  1336. static inline  
  1337. #line 916
  1338. result_t CC1000RadioIntM$SquelchTimer$fired(void);
  1339. static inline  
  1340. result_t CC1000RadioIntM$WakeupTimer$fired(void);
  1341. static inline  
  1342. #line 980
  1343. result_t CC1000RadioIntM$TDMATimer$fired(void);
  1344. static inline  
  1345. #line 1056
  1346. result_t CC1000RadioIntM$StdControl$start(void);
  1347. static  
  1348. #line 1102
  1349. result_t CC1000RadioIntM$Send$send(TOS_MsgPtr pMsg);
  1350. static   
  1351. #line 1166
  1352. result_t CC1000RadioIntM$SpiByteFifo$dataReady(uint8_t data_in);
  1353. static  
  1354. #line 1586
  1355. void CC1000RadioIntM$IdleTimerTask(void);
  1356. static inline  
  1357. #line 1606
  1358. void CC1000RadioIntM$SleepTimerTask(void);
  1359. static inline   
  1360. result_t CC1000RadioIntM$RSSIADC$dataReady(uint16_t data);
  1361. static inline   
  1362. #line 1724
  1363. uint16_t CC1000RadioIntM$GetSquelch(void);
  1364. static inline   
  1365. uint16_t CC1000RadioIntM$GetDataSent(void);
  1366. static inline   
  1367. result_t CC1000RadioIntM$ResetDataSent(void);
  1368. static inline   
  1369. uint16_t CC1000RadioIntM$GetPower_tx(void);
  1370. static inline   
  1371. uint16_t CC1000RadioIntM$GetPower_rx(void);
  1372. static inline   
  1373. uint16_t CC1000RadioIntM$GetPower_sp(void);
  1374. static   
  1375. result_t CC1000RadioIntM$ResetPower(void);
  1376. static inline    
  1377. #line 1786
  1378. void CC1000RadioIntM$RadioSendCoordinator$default$startSymbol(uint8_t bitsPerBlock, uint8_t offset, 
  1379. TOS_MsgPtr msgBuff);
  1380. static inline    void CC1000RadioIntM$RadioSendCoordinator$default$byte(TOS_MsgPtr msg, uint8_t byteCount);
  1381. static inline    void CC1000RadioIntM$RadioSendCoordinator$default$blockTimer(void);
  1382. static inline    
  1383. void CC1000RadioIntM$RadioReceiveCoordinator$default$startSymbol(uint8_t bitsPerBlock, uint8_t offset, 
  1384. TOS_MsgPtr msgBuff);
  1385. static inline    void CC1000RadioIntM$RadioReceiveCoordinator$default$byte(TOS_MsgPtr msg, uint8_t byteCount);
  1386. static inline    void CC1000RadioIntM$RadioReceiveCoordinator$default$blockTimer(void);
  1387. static inline    
  1388. int16_t CC1000RadioIntM$MacBackoff$default$initialBackoff(TOS_MsgPtr m);
  1389. static inline    
  1390. int16_t CC1000RadioIntM$MacBackoff$default$congestionBackoff(TOS_MsgPtr m);
  1391. static inline   
  1392. result_t CC1000RadioIntM$SClock$syncDone(void);
  1393. static inline   
  1394. #line 1823
  1395. result_t CC1000RadioIntM$SClock$fire(uint16_t mticks);
  1396. static  
  1397. # 51 "../../tos/platform/mica2/HPLCC1000.nc"
  1398. result_t CC1000ControlM$HPLChipcon$init(void);
  1399. static   
  1400. #line 65
  1401. uint8_t CC1000ControlM$HPLChipcon$read(uint8_t arg_0x87b1d20);
  1402. static   
  1403. #line 58
  1404. result_t CC1000ControlM$HPLChipcon$write(uint8_t arg_0x87b1768, uint8_t arg_0x87b18b0);
  1405.  
  1406. # 83 "../../tos/platform/mica2/CC1000ControlM.nc"
  1407. uint8_t CC1000ControlM$gCurrentParameters[31];
  1408. enum CC1000ControlM$__nesc_unnamed4284 {
  1409.   CC1000ControlM$IF = 150000, 
  1410.   CC1000ControlM$FREQ_MIN = 4194304, 
  1411.   CC1000ControlM$FREQ_MAX = 16751615
  1412. };
  1413. static inline 
  1414. #line 131
  1415. result_t CC1000ControlM$chipcon_cal(void);
  1416. static inline 
  1417. #line 187
  1418. void CC1000ControlM$cc1000SetFreq(void);
  1419. static inline 
  1420. #line 203
  1421. void CC1000ControlM$cc1000SetModem(void);
  1422. static inline  
  1423. #line 342
  1424. result_t CC1000ControlM$StdControl$init(void);
  1425. static inline  
  1426. #line 400
  1427. result_t CC1000ControlM$CC1000Control$TunePreset(uint8_t freq);
  1428. static   
  1429. #line 422
  1430. result_t CC1000ControlM$CC1000Control$TxMode(void);
  1431. static   
  1432. #line 435
  1433. result_t CC1000ControlM$CC1000Control$RxMode(void);
  1434. static inline  
  1435. #line 457
  1436. result_t CC1000ControlM$CC1000Control$BIASOn(void);
  1437. static inline  
  1438. #line 469
  1439. result_t CC1000ControlM$StdControl$stop(void);
  1440. static inline  
  1441. result_t CC1000ControlM$StdControl$start(void);
  1442. static inline  
  1443. #line 494
  1444. result_t CC1000ControlM$CC1000Control$SetRFPower(uint8_t power);
  1445. static inline  
  1446. result_t CC1000ControlM$CC1000Control$SelectLock(uint8_t Value);
  1447. static inline  
  1448. #line 517
  1449. bool CC1000ControlM$CC1000Control$GetLOStatus(void);
  1450. static inline  
  1451. # 51 "../../tos/platform/mica2/HPLCC1000M.nc"
  1452. result_t HPLCC1000M$HPLCC1000$init(void);
  1453. static   
  1454. #line 75
  1455. result_t HPLCC1000M$HPLCC1000$write(uint8_t addr, uint8_t data);
  1456. static   
  1457. #line 128
  1458. uint8_t HPLCC1000M$HPLCC1000$read(uint8_t addr);
  1459. # 54 "/home/testuser/tinyos-1.x/tos/system/RandomLFSR.nc"
  1460. uint16_t RandomLFSR$shiftReg;
  1461. uint16_t RandomLFSR$initSeed;
  1462. uint16_t RandomLFSR$mask;
  1463. static   
  1464. result_t RandomLFSR$Random$init(void);
  1465. static   
  1466. uint16_t RandomLFSR$Random$rand(void);
  1467. static   
  1468. # 70 "/home/testuser/tinyos-1.x/tos/interfaces/HPLADC.nc"
  1469. result_t ADCREFM$HPLADC$bindPort(uint8_t arg_0x87f8060, uint8_t arg_0x87f81a8);
  1470. static   
  1471. #line 54
  1472. result_t ADCREFM$HPLADC$init(void);
  1473. static   
  1474. #line 77
  1475. result_t ADCREFM$HPLADC$samplePort(uint8_t arg_0x87f8690);
  1476. static   
  1477. # 70 "/home/testuser/tinyos-1.x/tos/interfaces/ADC.nc"
  1478. result_t ADCREFM$CalADC$dataReady(
  1479. # 67 "../../tos/platform/mica2/ADCREFM.nc"
  1480. uint8_t arg_0x87e1f08, 
  1481. # 70 "/home/testuser/tinyos-1.x/tos/interfaces/ADC.nc"
  1482. uint16_t arg_0x8636a60);
  1483. static   
  1484. #line 70
  1485. result_t ADCREFM$ADC$dataReady(
  1486. # 66 "../../tos/platform/mica2/ADCREFM.nc"
  1487. uint8_t arg_0x87e1880, 
  1488. # 70 "/home/testuser/tinyos-1.x/tos/interfaces/ADC.nc"
  1489. uint16_t arg_0x8636a60);
  1490. # 80 "../../tos/platform/mica2/ADCREFM.nc"
  1491. enum ADCREFM$__nesc_unnamed4285 {
  1492.   ADCREFM$IDLE = 0, 
  1493.   ADCREFM$SINGLE_CONVERSION = 1, 
  1494.   ADCREFM$CONTINUOUS_CONVERSION = 2
  1495. };
  1496. uint16_t ADCREFM$ReqPort;
  1497. uint16_t ADCREFM$ReqVector;
  1498. uint16_t ADCREFM$ContReqMask;
  1499. uint16_t ADCREFM$CalReqMask;
  1500. uint32_t ADCREFM$RefVal;
  1501. static inline  
  1502. void ADCREFM$CalTask(void);
  1503. static inline  
  1504. result_t ADCREFM$ADCControl$init(void);
  1505. static inline  
  1506. #line 114
  1507. result_t ADCREFM$ADCControl$bindPort(uint8_t port, uint8_t adcPort);
  1508. static inline    
  1509. result_t ADCREFM$ADC$default$dataReady(uint8_t port, uint16_t data);
  1510. static inline    
  1511. result_t ADCREFM$CalADC$default$dataReady(uint8_t port, uint16_t data);
  1512. static inline  
  1513. result_t ADCREFM$Timer$fired(void);
  1514. static inline   
  1515. result_t ADCREFM$HPLADC$dataReady(uint16_t data);
  1516. static 
  1517. #line 198
  1518. result_t ADCREFM$startGet(uint8_t port);
  1519. static inline   
  1520. #line 222
  1521. result_t ADCREFM$ADC$getData(uint8_t port);
  1522. static inline   
  1523. #line 284
  1524. result_t ADCREFM$ADCControl$manualCalibrate(void);
  1525. static   
  1526. # 99 "/home/testuser/tinyos-1.x/tos/interfaces/HPLADC.nc"
  1527. result_t HPLADCM$ADC$dataReady(uint16_t arg_0x87f91b8);
  1528. # 60 "../../tos/platform/mica2/HPLADCM.nc"
  1529. bool HPLADCM$init_portmap_done;
  1530. uint8_t HPLADCM$TOSH_adc_portmap[TOSH_ADC_PORTMAPSIZE];
  1531. static 
  1532. void HPLADCM$init_portmap(void);
  1533. static inline   
  1534. #line 90
  1535. result_t HPLADCM$ADC$init(void);
  1536. static inline   
  1537. #line 110
  1538. result_t HPLADCM$ADC$bindPort(uint8_t port, uint8_t adcPort);
  1539. static   
  1540. #line 122
  1541. result_t HPLADCM$ADC$samplePort(uint8_t port);
  1542. #line 144
  1543. void __attribute((signal))   __vector_21(void);
  1544. static   
  1545. # 41 "/home/testuser/tinyos-1.x/tos/interfaces/PowerManagement.nc"
  1546. uint8_t TimerM$PowerManagement$adjustPower(void);
  1547. static   
  1548. # 105 "/home/testuser/tinyos-1.x/tos/interfaces/Clock.nc"
  1549. void TimerM$Clock$setInterval(uint8_t arg_0x882d378);
  1550. static   
  1551. #line 153
  1552. uint8_t TimerM$Clock$readCounter(void);
  1553. static   
  1554. #line 96
  1555. result_t TimerM$Clock$setRate(char arg_0x882c878, char arg_0x882c9b8);
  1556. static   
  1557. #line 121
  1558. uint8_t TimerM$Clock$getInterval(void);
  1559. static  
  1560. # 73 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
  1561. result_t TimerM$Timer$fired(
  1562. # 49 "/home/testuser/tinyos-1.x/tos/system/TimerM.nc"
  1563. uint8_t arg_0x85e4d90);
  1564. uint32_t TimerM$mState;
  1565. uint8_t TimerM$setIntervalFlag;
  1566. uint8_t TimerM$mScale;
  1567. #line 61
  1568. uint8_t TimerM$mInterval;
  1569. int8_t TimerM$queue_head;
  1570. int8_t TimerM$queue_tail;
  1571. uint8_t TimerM$queue_size;
  1572. uint8_t TimerM$queue[NUM_TIMERS];
  1573. volatile uint16_t TimerM$interval_outstanding;
  1574. struct TimerM$timer_s {
  1575.   uint8_t type;
  1576.   int32_t ticks;
  1577.   int32_t ticksLeft;
  1578. } TimerM$mTimerList[NUM_TIMERS];
  1579. enum TimerM$__nesc_unnamed4286 {
  1580.   TimerM$maxTimerInterval = 230
  1581. };
  1582. static  result_t TimerM$StdControl$init(void);
  1583. static inline  
  1584. result_t TimerM$StdControl$start(void);
  1585. static  
  1586. result_t TimerM$Timer$start(uint8_t id, char type, 
  1587. uint32_t interval);
  1588. #line 129
  1589. static void TimerM$adjustInterval(void);
  1590. static  
  1591. #line 168
  1592. result_t TimerM$Timer$stop(uint8_t id);
  1593. static inline   
  1594. #line 182
  1595. result_t TimerM$Timer$default$fired(uint8_t id);
  1596. static inline 
  1597. void TimerM$enqueue(uint8_t value);
  1598. static inline 
  1599. uint8_t TimerM$dequeue(void);
  1600. static inline  
  1601. void TimerM$signalOneTimer(void);
  1602. static inline  
  1603. void TimerM$HandleFire(void);
  1604. static inline   
  1605. #line 253
  1606. result_t TimerM$Clock$fire(void);
  1607. static   
  1608. # 180 "/home/testuser/tinyos-1.x/tos/interfaces/Clock.nc"
  1609. result_t HPLClock$Clock$fire(void);
  1610. # 54 "/home/testuser/tinyos-1.x/tos/platform/mica/HPLClock.nc"
  1611. uint8_t HPLClock$set_flag;
  1612. uint8_t HPLClock$mscale;
  1613. #line 55
  1614. uint8_t HPLClock$nextScale;
  1615. #line 55
  1616. uint8_t HPLClock$minterval;
  1617. static inline   
  1618. #line 87
  1619. void HPLClock$Clock$setInterval(uint8_t value);
  1620. static inline   
  1621. uint8_t HPLClock$Clock$getInterval(void);
  1622. static inline   
  1623. #line 134
  1624. uint8_t HPLClock$Clock$readCounter(void);
  1625. static inline   
  1626. #line 149
  1627. result_t HPLClock$Clock$setRate(char interval, char scale);
  1628. #line 167
  1629. void __attribute((interrupt))   __vector_15(void);
  1630. static inline   
  1631. # 63 "/home/testuser/tinyos-1.x/tos/system/NoLeds.nc"
  1632. result_t NoLeds$Leds$redToggle(void);
  1633. static inline   
  1634. #line 75
  1635. result_t NoLeds$Leds$greenToggle(void);
  1636. static inline   
  1637. #line 87
  1638. result_t NoLeds$Leds$yellowToggle(void);
  1639.  
  1640. # 51 "../../tos/platform/mica2/HPLPowerManagementM.nc"
  1641. int8_t HPLPowerManagementM$disableCount = 1;
  1642. uint8_t HPLPowerManagementM$powerLevel;
  1643. enum HPLPowerManagementM$__nesc_unnamed4287 {
  1644.   HPLPowerManagementM$IDLE = 0, 
  1645.   HPLPowerManagementM$ADC_NR = 1 << 3, 
  1646.   HPLPowerManagementM$POWER_DOWN = 1 << 4, 
  1647.   HPLPowerManagementM$POWER_SAVE = (1 << 3) + (1 << 4), 
  1648.   HPLPowerManagementM$STANDBY = (1 << 2) + (1 << 4), 
  1649.   HPLPowerManagementM$EXT_STANDBY = (1 << 3) + (1 << 4) + (1 << 2)
  1650. };
  1651. static inline 
  1652. uint8_t HPLPowerManagementM$getPowerLevel(void);
  1653. static inline  
  1654. #line 85
  1655. void HPLPowerManagementM$doAdjustment(void);
  1656. static   
  1657. #line 102
  1658. uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void);
  1659. static   
  1660. # 41 "/home/testuser/tinyos-1.x/tos/interfaces/PowerManagement.nc"
  1661. uint8_t HPLSpiM$PowerManagement$adjustPower(void);
  1662. static   
  1663. # 42 "../../tos/platform/mica2/SpiByteFifo.nc"
  1664. result_t HPLSpiM$SpiByteFifo$dataReady(uint8_t arg_0x86357c8);
  1665.  
  1666. # 51 "../../tos/platform/mica2/HPLSpiM.nc"
  1667. uint8_t HPLSpiM$OutgoingByte;
  1668. void __attribute((signal))   __vector_17(void);
  1669. static inline   
  1670. result_t HPLSpiM$SpiByteFifo$writeByte(uint8_t data);
  1671. static inline   
  1672. #line 74
  1673. result_t HPLSpiM$SpiByteFifo$enableIntr(void);
  1674. static   
  1675. result_t HPLSpiM$SpiByteFifo$disableIntr(void);
  1676. static inline   
  1677. result_t HPLSpiM$SpiByteFifo$initSlave(void);
  1678. static inline   
  1679. #line 103
  1680. result_t HPLSpiM$SpiByteFifo$txMode(void);
  1681. static inline   
  1682. result_t HPLSpiM$SpiByteFifo$rxMode(void);
  1683. static   
  1684. # 94 "../../tos/interfaces/SClock.nc"
  1685. result_t HPLSClock$SClock$syncDone(void);
  1686. static   
  1687. #line 88
  1688. result_t HPLSClock$SClock$fire(uint16_t arg_0x8624768);
  1689. # 45 "../../tos/platform/mica2/HPLSClock.nc"
  1690. uint16_t HPLSClock$MTicks;
  1691. GTime HPLSClock$Update;
  1692. uint8_t HPLSClock$sign;
  1693. uint8_t HPLSClock$needupdate;
  1694. static inline   
  1695. #line 66
  1696. result_t HPLSClock$SClock$SetRate(uint16_t interval, char scale);
  1697. static   
  1698. #line 95
  1699. void HPLSClock$SClock$getTime(GTime *t);
  1700. static inline   
  1701. #line 107
  1702. void HPLSClock$SClock$setTime(uint8_t PosOrNeg, GTime *t);
  1703. #line 124
  1704. void __attribute((interrupt))   __vector_26(void);
  1705. static  
  1706. # 75 "/home/testuser/tinyos-1.x/tos/interfaces/ReceiveMsg.nc"
  1707. TOS_MsgPtr FramerM$ReceiveMsg$receive(TOS_MsgPtr arg_0x85b1db0);
  1708. static   
  1709. # 55 "/home/testuser/tinyos-1.x/tos/interfaces/ByteComm.nc"
  1710. result_t FramerM$ByteComm$txByte(uint8_t arg_0x88b07a0);
  1711. static  
  1712. # 63 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
  1713. result_t FramerM$ByteControl$init(void);
  1714. static  
  1715. result_t FramerM$ByteControl$start(void);
  1716. static  
  1717. # 67 "/home/testuser/tinyos-1.x/tos/interfaces/BareSendMsg.nc"
  1718. result_t FramerM$BareSendMsg$sendDone(TOS_MsgPtr arg_0x85bb080, result_t arg_0x85bb1d0);
  1719. static  
  1720. # 75 "/home/testuser/tinyos-1.x/tos/interfaces/TokenReceiveMsg.nc"
  1721. TOS_MsgPtr FramerM$TokenReceiveMsg$receive(TOS_MsgPtr arg_0x88b2338, uint8_t arg_0x88b2480);
  1722. # 82 "/home/testuser/tinyos-1.x/tos/system/FramerM.nc"
  1723. enum FramerM$__nesc_unnamed4288 {
  1724.   FramerM$HDLC_QUEUESIZE = 2, 
  1725.   FramerM$HDLC_MTU = sizeof(TOS_Msg ), 
  1726.   FramerM$HDLC_FLAG_BYTE = 0x7e, 
  1727.   FramerM$HDLC_CTLESC_BYTE = 0x7d, 
  1728.   FramerM$PROTO_ACK = 64, 
  1729.   FramerM$PROTO_PACKET_ACK = 65, 
  1730.   FramerM$PROTO_PACKET_NOACK = 66, 
  1731.   FramerM$PROTO_UNKNOWN = 255
  1732. };
  1733. enum FramerM$__nesc_unnamed4289 {
  1734.   FramerM$RXSTATE_NOSYNC, 
  1735.   FramerM$RXSTATE_PROTO, 
  1736.   FramerM$RXSTATE_TOKEN, 
  1737.   FramerM$RXSTATE_INFO, 
  1738.   FramerM$RXSTATE_ESC
  1739. };
  1740. enum FramerM$__nesc_unnamed4290 {
  1741.   FramerM$TXSTATE_IDLE, 
  1742.   FramerM$TXSTATE_PROTO, 
  1743.   FramerM$TXSTATE_INFO, 
  1744.   FramerM$TXSTATE_ESC, 
  1745.   FramerM$TXSTATE_FCS1, 
  1746.   FramerM$TXSTATE_FCS2, 
  1747.   FramerM$TXSTATE_ENDFLAG, 
  1748.   FramerM$TXSTATE_FINISH, 
  1749.   FramerM$TXSTATE_ERROR
  1750. };
  1751. enum FramerM$__nesc_unnamed4291 {
  1752.   FramerM$FLAGS_TOKENPEND = 0x2, 
  1753.   FramerM$FLAGS_DATAPEND = 0x4, 
  1754.   FramerM$FLAGS_UNKNOWN = 0x8
  1755. };
  1756. TOS_Msg FramerM$gMsgRcvBuf[FramerM$HDLC_QUEUESIZE];
  1757. typedef struct FramerM$_MsgRcvEntry {
  1758.   uint8_t Proto;
  1759.   uint8_t Token;
  1760.   uint16_t Length;
  1761.   TOS_MsgPtr pMsg;
  1762. } FramerM$MsgRcvEntry_t;
  1763. FramerM$MsgRcvEntry_t FramerM$gMsgRcvTbl[FramerM$HDLC_QUEUESIZE];
  1764. uint8_t *FramerM$gpRxBuf;
  1765. uint8_t *FramerM$gpTxBuf;
  1766. uint8_t FramerM$gFlags;
  1767.  
  1768. uint8_t FramerM$gTxState;
  1769.  uint8_t FramerM$gPrevTxState;
  1770.  uint16_t FramerM$gTxProto;
  1771.  uint16_t FramerM$gTxByteCnt;
  1772.  uint16_t FramerM$gTxLength;
  1773.  uint16_t FramerM$gTxRunningCRC;
  1774. uint8_t FramerM$gRxState;
  1775. uint8_t FramerM$gRxHeadIndex;
  1776. uint8_t FramerM$gRxTailIndex;
  1777. uint16_t FramerM$gRxByteCnt;
  1778. uint16_t FramerM$gRxRunningCRC;
  1779. TOS_MsgPtr FramerM$gpTxMsg;
  1780. uint8_t FramerM$gTxTokenBuf;
  1781. uint8_t FramerM$gTxUnknownBuf;
  1782.  uint8_t FramerM$gTxEscByte;
  1783. static  
  1784. void FramerM$PacketSent(void);
  1785. static 
  1786. result_t FramerM$StartTx(void);
  1787. static inline  
  1788. #line 202
  1789. void FramerM$PacketUnknown(void);
  1790. static inline  
  1791. void FramerM$PacketRcvd(void);
  1792. static  
  1793. #line 246
  1794. void FramerM$PacketSent(void);
  1795. static 
  1796. #line 268
  1797. void FramerM$HDLCInitialize(void);
  1798. static inline  
  1799. #line 291
  1800. result_t FramerM$StdControl$init(void);
  1801. static inline  
  1802. result_t FramerM$StdControl$start(void);
  1803. static inline  
  1804. result_t FramerM$BareSendMsg$send(TOS_MsgPtr pMsg);
  1805. static inline  
  1806. #line 328
  1807. result_t FramerM$TokenReceiveMsg$ReflectToken(uint8_t Token);
  1808. static   
  1809. #line 348
  1810. result_t FramerM$ByteComm$rxByteReady(uint8_t data, bool error, uint16_t strength);
  1811. static 
  1812. #line 469
  1813. result_t FramerM$TxArbitraryByte(uint8_t inByte);
  1814. static inline   
  1815. #line 482
  1816. result_t FramerM$ByteComm$txByteReady(bool LastByteSuccess);
  1817. static inline   
  1818. #line 552
  1819. result_t FramerM$ByteComm$txDone(void);
  1820. static  
  1821. # 75 "/home/testuser/tinyos-1.x/tos/interfaces/ReceiveMsg.nc"
  1822. TOS_MsgPtr FramerAckM$ReceiveCombined$receive(TOS_MsgPtr arg_0x85b1db0);
  1823. static  
  1824. # 88 "/home/testuser/tinyos-1.x/tos/interfaces/TokenReceiveMsg.nc"
  1825. result_t FramerAckM$TokenReceiveMsg$ReflectToken(uint8_t arg_0x88b2a98);
  1826. # 72 "/home/testuser/tinyos-1.x/tos/system/FramerAckM.nc"
  1827. uint8_t FramerAckM$gTokenBuf;
  1828. static inline  
  1829. void FramerAckM$SendAckTask(void);
  1830. static inline  
  1831. TOS_MsgPtr FramerAckM$TokenReceiveMsg$receive(TOS_MsgPtr Msg, uint8_t token);
  1832. static inline  
  1833. #line 91
  1834. TOS_MsgPtr FramerAckM$ReceiveMsg$receive(TOS_MsgPtr Msg);
  1835. static   
  1836. # 62 "/home/testuser/tinyos-1.x/tos/interfaces/HPLUART.nc"
  1837. result_t UARTM$HPLUART$init(void);
  1838. static   
  1839. #line 80
  1840. result_t UARTM$HPLUART$put(uint8_t arg_0x88d4ac8);
  1841. static   
  1842. # 83 "/home/testuser/tinyos-1.x/tos/interfaces/ByteComm.nc"
  1843. result_t UARTM$ByteComm$txDone(void);
  1844. static   
  1845. #line 75
  1846. result_t UARTM$ByteComm$txByteReady(bool arg_0x88b1400);
  1847. static   
  1848. #line 66
  1849. result_t UARTM$ByteComm$rxByteReady(uint8_t arg_0x88b0c30, bool arg_0x88b0d78, uint16_t arg_0x88b0ed0);
  1850. # 58 "/home/testuser/tinyos-1.x/tos/system/UARTM.nc"
  1851. bool UARTM$state;
  1852. static inline  
  1853. result_t UARTM$Control$init(void);
  1854. static inline  
  1855. result_t UARTM$Control$start(void);
  1856. static inline   
  1857. result_t UARTM$HPLUART$get(uint8_t data);
  1858. static   
  1859. result_t UARTM$HPLUART$putDone(void);
  1860. static   
  1861. #line 110
  1862. result_t UARTM$ByteComm$txByte(uint8_t data);
  1863. static   
  1864. # 88 "/home/testuser/tinyos-1.x/tos/interfaces/HPLUART.nc"
  1865. result_t HPLUART0M$UART$get(uint8_t arg_0x88d4fc8);
  1866. static   
  1867. result_t HPLUART0M$UART$putDone(void);
  1868. static inline   
  1869. # 60 "../../tos/platform/mica2/HPLUART0M.nc"
  1870. result_t HPLUART0M$UART$init(void);
  1871. #line 90
  1872. void __attribute((signal))   __vector_18(void);
  1873. void __attribute((interrupt))   __vector_20(void);
  1874. static inline   
  1875. result_t HPLUART0M$UART$put(uint8_t data);
  1876. # 74 "/home/testuser/tinyos-1.x/tos/system/NoCRCPacket.nc"
  1877. enum NoCRCPacket$__nesc_unnamed4292 {
  1878.   NoCRCPacket$IDLE, 
  1879.   NoCRCPacket$PACKET, 
  1880.   NoCRCPacket$BYTES
  1881. };
  1882. static  
  1883. # 71 "/home/testuser/tinyos-1.x/tos/interfaces/RouteSelect.nc"
  1884. result_t MultiHopEngineM$RouteSelect$selectRoute(TOS_MsgPtr arg_0x89392f8, uint8_t arg_0x8939440);
  1885. static  
  1886. #line 86
  1887. result_t MultiHopEngineM$RouteSelect$initializeFields(TOS_MsgPtr arg_0x89399b8, uint8_t arg_0x8939b00);
  1888. static  
  1889. # 86 "/home/testuser/tinyos-1.x/tos/interfaces/Intercept.nc"
  1890. result_t MultiHopEngineM$Intercept$intercept(
  1891. # 52 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
  1892. uint8_t arg_0x8913f48, 
  1893. # 86 "/home/testuser/tinyos-1.x/tos/interfaces/Intercept.nc"
  1894. TOS_MsgPtr arg_0x854f548, void *arg_0x854f6a0, uint16_t arg_0x854f7f8);
  1895. static  
  1896. # 49 "/home/testuser/tinyos-1.x/tos/interfaces/RouteControl.nc"
  1897. uint16_t MultiHopEngineM$RouteSelectCntl$getParent(void);
  1898. static  
  1899. # 86 "/home/testuser/tinyos-1.x/tos/interfaces/Intercept.nc"
  1900. result_t MultiHopEngineM$Snoop$intercept(
  1901. # 53 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
  1902. uint8_t arg_0x8916490, 
  1903. # 86 "/home/testuser/tinyos-1.x/tos/interfaces/Intercept.nc"
  1904. TOS_MsgPtr arg_0x854f548, void *arg_0x854f6a0, uint16_t arg_0x854f7f8);
  1905. static  
  1906. # 119 "/home/testuser/tinyos-1.x/tos/interfaces/Send.nc"
  1907. result_t MultiHopEngineM$Send$sendDone(
  1908. # 51 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
  1909. uint8_t arg_0x89138e0, 
  1910. # 119 "/home/testuser/tinyos-1.x/tos/interfaces/Send.nc"
  1911. TOS_MsgPtr arg_0x8563dd8, result_t arg_0x8563f28);
  1912. static  
  1913. # 63 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
  1914. result_t MultiHopEngineM$CommStdControl$init(void);
  1915. static  
  1916. result_t MultiHopEngineM$CommStdControl$start(void);
  1917. static  
  1918. #line 63
  1919. result_t MultiHopEngineM$SubControl$init(void);
  1920. static  
  1921. result_t MultiHopEngineM$SubControl$start(void);
  1922. static  
  1923. # 65 "/home/testuser/tinyos-1.x/tos/interfaces/CommControl.nc"
  1924. result_t MultiHopEngineM$CommControl$setPromiscuous(bool arg_0x85a8158);
  1925. static  
  1926. # 48 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
  1927. result_t MultiHopEngineM$SendMsg$send(
  1928. # 58 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
  1929. uint8_t arg_0x89175b0, 
  1930. # 48 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
  1931. uint16_t arg_0x85a9e28, uint8_t arg_0x85b0010, TOS_MsgPtr arg_0x85b0160);
  1932. # 69 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopEngineM.nc"
  1933. enum MultiHopEngineM$__nesc_unnamed4293 {
  1934.   MultiHopEngineM$FWD_QUEUE_SIZE = 16, 
  1935.   MultiHopEngineM$EMPTY = 0xff
  1936. };
  1937. TOS_Msg MultiHopEngineM$FwdBuffers[MultiHopEngineM$FWD_QUEUE_SIZE];
  1938. TOS_Msg *MultiHopEngineM$FwdBufList[MultiHopEngineM$FWD_QUEUE_SIZE];
  1939. uint8_t MultiHopEngineM$iFwdBufHead;
  1940. #line 82
  1941. uint8_t MultiHopEngineM$iFwdBufTail;
  1942. static void MultiHopEngineM$initialize(void);
  1943. static inline  
  1944. result_t MultiHopEngineM$StdControl$init(void);
  1945. static inline  
  1946. result_t MultiHopEngineM$StdControl$start(void);
  1947. static inline  
  1948. #line 124
  1949. result_t MultiHopEngineM$Send$send(uint8_t id, TOS_MsgPtr pMsg, uint16_t PayloadLen);
  1950. static  
  1951. #line 150
  1952. void *MultiHopEngineM$Send$getBuffer(uint8_t id, TOS_MsgPtr pMsg, uint16_t *length);
  1953. static TOS_MsgPtr MultiHopEngineM$mForward(TOS_MsgPtr pMsg, uint8_t id);
  1954. static  
  1955. #line 182
  1956. TOS_MsgPtr MultiHopEngineM$ReceiveMsg$receive(uint8_t id, TOS_MsgPtr pMsg);
  1957. static  
  1958. #line 205
  1959. result_t MultiHopEngineM$SendMsg$sendDone(uint8_t id, TOS_MsgPtr pMsg, result_t success);
  1960. static inline  
  1961. uint16_t MultiHopEngineM$RouteControl$getParent(void);
  1962. static inline   
  1963. #line 246
  1964. result_t MultiHopEngineM$Send$default$sendDone(uint8_t id, TOS_MsgPtr pMsg, result_t success);
  1965. static inline   
  1966. result_t MultiHopEngineM$Intercept$default$intercept(uint8_t id, TOS_MsgPtr pMsg, void *payload, 
  1967. uint16_t payloadLen);
  1968. static  
  1969. # 59 "/home/testuser/tinyos-1.x/tos/interfaces/Timer.nc"
  1970. result_t MultiHopWMEWMA$Timer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10);
  1971. static  
  1972. #line 59
  1973. result_t MultiHopWMEWMA$ATimer$start(char arg_0x8561bb8, uint32_t arg_0x8561d10);
  1974. static   
  1975. # 106 "/home/testuser/tinyos-1.x/tos/interfaces/Leds.nc"
  1976. result_t MultiHopWMEWMA$Leds$greenToggle(void);
  1977. static   
  1978. #line 131
  1979. result_t MultiHopWMEWMA$Leds$yellowToggle(void);
  1980. static   
  1981. #line 81
  1982. result_t MultiHopWMEWMA$Leds$redToggle(void);
  1983. static  
  1984. # 48 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
  1985. result_t MultiHopWMEWMA$SendMsg$send(uint16_t arg_0x85a9e28, uint8_t arg_0x85b0010, TOS_MsgPtr arg_0x85b0160);
  1986. # 71 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
  1987. enum MultiHopWMEWMA$__nesc_unnamed4294 {
  1988.   MultiHopWMEWMA$NBRFLAG_VALID = 0x01, 
  1989.   MultiHopWMEWMA$NBRFLAG_NEW = 0x02, 
  1990.   MultiHopWMEWMA$NBRFLAG_EST_INIT = 0x04
  1991. };
  1992. enum MultiHopWMEWMA$__nesc_unnamed4295 {
  1993.   MultiHopWMEWMA$BASE_STATION_ADDRESS = 0, 
  1994.   MultiHopWMEWMA$ROUTE_TABLE_SIZE = 16, 
  1995.   MultiHopWMEWMA$ESTIMATE_TO_ROUTE_RATIO = 10, 
  1996.   MultiHopWMEWMA$ACCEPTABLE_MISSED = -20, 
  1997.   MultiHopWMEWMA$DATA_TO_ROUTE_RATIO = 1, 
  1998.   MultiHopWMEWMA$DATA_FREQ = 8192, 
  1999.   MultiHopWMEWMA$SWITCH_THRESHOLD = 384, 
  2000.   MultiHopWMEWMA$MAX_ALLOWABLE_LINK_COST = 256 * 6, 
  2001.   MultiHopWMEWMA$LIVELINESS = 5, 
  2002.   MultiHopWMEWMA$MAX_DESCENDANT_LIVE = 5
  2003. };
  2004. enum MultiHopWMEWMA$__nesc_unnamed4296 {
  2005.   MultiHopWMEWMA$ROUTE_INVALID = 0xff
  2006. };
  2007. struct MultiHopWMEWMA$SortEntry {
  2008.   uint16_t id;
  2009.   uint8_t receiveEst;
  2010. };
  2011. struct MultiHopWMEWMA$SortDbgEntry {
  2012.   uint16_t id;
  2013.   uint8_t sendEst;
  2014.   uint8_t hopcount;
  2015. };
  2016. typedef struct MultiHopWMEWMA$RPEstEntry {
  2017.   uint16_t id;
  2018.   uint8_t receiveEst;
  2019. } __attribute((packed))  MultiHopWMEWMA$RPEstEntry;
  2020. typedef struct MultiHopWMEWMA$RoutePacket {
  2021.   uint16_t parent;
  2022.   uint16_t cost;
  2023.   uint8_t estEntries;
  2024.   MultiHopWMEWMA$RPEstEntry estList[1];
  2025. } __attribute((packed))  MultiHopWMEWMA$RoutePacket;
  2026. typedef struct MultiHopWMEWMA$TableEntry {
  2027.   uint16_t id;
  2028.   uint16_t parent;
  2029.   uint16_t cost;
  2030.   uint8_t childLiveliness;
  2031.   uint16_t missed;
  2032.   uint16_t received;
  2033.   int16_t lastSeqno;
  2034.   uint8_t flags;
  2035.   uint8_t liveliness;
  2036.   uint8_t hop;
  2037.   uint8_t receiveEst;
  2038.   uint8_t sendEst;
  2039. } MultiHopWMEWMA$TableEntry;
  2040. TOS_Msg MultiHopWMEWMA$routeMsg;
  2041. bool MultiHopWMEWMA$gfSendRouteBusy;
  2042. bool MultiHopWMEWMA$gSelfTimer;
  2043. MultiHopWMEWMA$TableEntry MultiHopWMEWMA$BaseStation;
  2044. MultiHopWMEWMA$TableEntry MultiHopWMEWMA$NeighborTbl[MultiHopWMEWMA$ROUTE_TABLE_SIZE];
  2045. MultiHopWMEWMA$TableEntry *MultiHopWMEWMA$gpCurrentParent;
  2046. uint8_t MultiHopWMEWMA$gbCurrentHopCount;
  2047. uint16_t MultiHopWMEWMA$gbCurrentCost;
  2048. int16_t MultiHopWMEWMA$gCurrentSeqNo;
  2049. uint16_t MultiHopWMEWMA$gwEstTicks;
  2050. uint32_t MultiHopWMEWMA$gUpdateInterval;
  2051. static 
  2052. uint8_t MultiHopWMEWMA$findEntry(uint16_t id);
  2053. static inline 
  2054. #line 174
  2055. uint8_t MultiHopWMEWMA$findEntryToBeReplaced(void);
  2056. static 
  2057. #line 198
  2058. void MultiHopWMEWMA$newEntry(uint8_t indes, uint16_t id);
  2059. static inline 
  2060. #line 226
  2061. uint8_t MultiHopWMEWMA$findPreparedIndex(uint16_t id);
  2062. static 
  2063. #line 256
  2064. uint32_t MultiHopWMEWMA$evaluateCost(uint16_t cost, uint8_t sendEst, uint8_t receiveEst);
  2065. static inline 
  2066. #line 268
  2067. void MultiHopWMEWMA$updateEst(MultiHopWMEWMA$TableEntry *Nbr);
  2068. static inline 
  2069. #line 316
  2070. void MultiHopWMEWMA$updateTable(void);
  2071. static 
  2072. #line 332
  2073. bool MultiHopWMEWMA$updateNbrCounters(uint16_t saddr, int16_t seqno, uint8_t *NbrIndex);
  2074. static inline 
  2075. #line 369
  2076. void MultiHopWMEWMA$chooseParent(void);
  2077. #line 445
  2078. uint8_t MultiHopWMEWMA$last_entry_sent;
  2079. static inline  
  2080. void MultiHopWMEWMA$SendRouteTask(void);
  2081. static  
  2082. #line 543
  2083. void MultiHopWMEWMA$TimerTask(void);
  2084. static inline  
  2085. #line 589
  2086. result_t MultiHopWMEWMA$ATimer$fired(void);
  2087. static inline  
  2088. result_t MultiHopWMEWMA$StdControl$init(void);
  2089. static inline  
  2090. #line 612
  2091. result_t MultiHopWMEWMA$StdControl$start(void);
  2092. static inline 
  2093. #line 657
  2094. void MultiHopWMEWMA$updateDescendant(uint16_t id);
  2095. static  
  2096. result_t MultiHopWMEWMA$RouteSelect$selectRoute(TOS_MsgPtr Msg, uint8_t id);
  2097. static inline  
  2098. #line 722
  2099. result_t MultiHopWMEWMA$RouteSelect$initializeFields(TOS_MsgPtr Msg, uint8_t id);
  2100. static inline  
  2101. #line 735
  2102. uint16_t MultiHopWMEWMA$RouteControl$getParent(void);
  2103. static inline  
  2104. #line 792
  2105. result_t MultiHopWMEWMA$Timer$fired(void);
  2106. static inline  
  2107. TOS_MsgPtr MultiHopWMEWMA$ReceiveMsg$receive(TOS_MsgPtr Msg);
  2108. static inline  
  2109. #line 832
  2110. result_t MultiHopWMEWMA$Snoop$intercept(uint8_t id, TOS_MsgPtr Msg, void *Payload, uint16_t Len);
  2111. static inline  
  2112. #line 845
  2113. result_t MultiHopWMEWMA$SendMsg$sendDone(TOS_MsgPtr pMsg, result_t success);
  2114. static inline  
  2115. result_t MultiHopWMEWMA$DebugSendMsg$sendDone(TOS_MsgPtr pMsg, result_t success);
  2116. static  
  2117. # 49 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
  2118. result_t QueuedSendM$QueueSendMsg$sendDone(
  2119. # 60 "/home/testuser/tinyos-1.x/tos/lib/Queue/QueuedSendM.nc"
  2120. uint8_t arg_0x89a2010, 
  2121. # 49 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
  2122. TOS_MsgPtr arg_0x85b0580, result_t arg_0x85b06d0);
  2123. static   
  2124. # 106 "/home/testuser/tinyos-1.x/tos/interfaces/Leds.nc"
  2125. result_t QueuedSendM$Leds$greenToggle(void);
  2126. static   
  2127. #line 81
  2128. result_t QueuedSendM$Leds$redToggle(void);
  2129. static  
  2130. # 48 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
  2131. result_t QueuedSendM$SerialSendMsg$send(
  2132. # 65 "/home/testuser/tinyos-1.x/tos/lib/Queue/QueuedSendM.nc"
  2133. uint8_t arg_0x89a2998, 
  2134. # 48 "/home/testuser/tinyos-1.x/tos/interfaces/SendMsg.nc"
  2135. uint16_t arg_0x85a9e28, uint8_t arg_0x85b0010, TOS_MsgPtr arg_0x85b0160);
  2136. # 74 "/home/testuser/tinyos-1.x/tos/lib/Queue/QueuedSendM.nc"
  2137. enum QueuedSendM$__nesc_unnamed4297 {
  2138.   QueuedSendM$MESSAGE_QUEUE_SIZE = 32, 
  2139.   QueuedSendM$MAX_RETRANSMIT_COUNT = 5
  2140. };
  2141. struct QueuedSendM$_msgq_entry {
  2142.   uint16_t address;
  2143.   uint8_t length;
  2144.   uint8_t id;
  2145.   uint8_t xmit_count;
  2146.   TOS_MsgPtr pMsg;
  2147. } QueuedSendM$msgqueue[QueuedSendM$MESSAGE_QUEUE_SIZE];
  2148. uint16_t QueuedSendM$enqueue_next;
  2149. #line 87
  2150. uint16_t QueuedSendM$dequeue_next;
  2151. bool QueuedSendM$retransmit;
  2152. bool QueuedSendM$fQueueIdle;
  2153. static inline  
  2154. result_t QueuedSendM$StdControl$init(void);
  2155. static inline  
  2156. #line 106
  2157. result_t QueuedSendM$StdControl$start(void);
  2158. static  
  2159. #line 121
  2160. void QueuedSendM$QueueServiceTask(void);
  2161. static  
  2162. #line 143
  2163. result_t QueuedSendM$QueueSendMsg$send(uint8_t id, uint16_t address, uint8_t length, TOS_MsgPtr msg);
  2164. static inline  
  2165. #line 188
  2166. result_t QueuedSendM$SerialSendMsg$sendDone(uint8_t id, TOS_MsgPtr msg, result_t success);
  2167. # 120 "../../tos/platform/mica2/hardware.h"
  2168. static __inline void TOSH_CLR_SERIAL_ID_PIN(void)
  2169. #line 120
  2170. {
  2171. #line 120
  2172.   * (volatile uint8_t *)(0x1B + 0x20) &= ~(1 << 4);
  2173. }
  2174. #line 120
  2175. static __inline void TOSH_MAKE_SERIAL_ID_INPUT(void)
  2176. #line 120
  2177. {
  2178. #line 120
  2179.   * (volatile uint8_t *)(0x1A + 0x20) &= ~(1 << 4);
  2180. }
  2181. #line 145
  2182. static __inline void TOSH_MAKE_SPI_OC1C_INPUT(void)
  2183. #line 145
  2184. {
  2185. #line 145
  2186.   * (volatile uint8_t *)(0x17 + 0x20) &= ~(1 << 7);
  2187. }
  2188. #line 144
  2189. static __inline void TOSH_MAKE_MISO_INPUT(void)
  2190. #line 144
  2191. {
  2192. #line 144
  2193.   * (volatile uint8_t *)(0x17 + 0x20) &= ~(1 << 3);
  2194. }
  2195. #line 127
  2196. static __inline void TOSH_MAKE_CC_PCLK_OUTPUT(void)
  2197. #line 127
  2198. {
  2199. #line 127
  2200.   * (volatile uint8_t *)(0x11 + 0x20) |= 1 << 6;
  2201. }
  2202. #line 126
  2203. static __inline void TOSH_MAKE_CC_PDATA_OUTPUT(void)
  2204. #line 126
  2205. {
  2206. #line 126
  2207.   * (volatile uint8_t *)(0x11 + 0x20) |= 1 << 7;
  2208. }
  2209. #line 128
  2210. static __inline void TOSH_MAKE_CC_PALE_OUTPUT(void)
  2211. #line 128
  2212. {
  2213. #line 128
  2214.   * (volatile uint8_t *)(0x11 + 0x20) |= 1 << 4;
  2215. }
  2216. #line 149
  2217. static __inline void TOSH_MAKE_PW0_OUTPUT(void)
  2218. #line 149
  2219. {
  2220. #line 149
  2221.   * (volatile uint8_t *)(0x14 + 0x20) |= 1 << 0;
  2222. }
  2223. #line 150
  2224. static __inline void TOSH_MAKE_PW1_OUTPUT(void)
  2225. #line 150
  2226. {
  2227. #line 150
  2228.   * (volatile uint8_t *)(0x14 + 0x20) |= 1 << 1;
  2229. }
  2230. #line 151
  2231. static __inline void TOSH_MAKE_PW2_OUTPUT(void)
  2232. #line 151
  2233. {
  2234. #line 151
  2235.   * (volatile uint8_t *)(0x14 + 0x20) |= 1 << 2;
  2236. }
  2237. #line 152
  2238. static __inline void TOSH_MAKE_PW3_OUTPUT(void)
  2239. #line 152
  2240. {
  2241. #line 152
  2242.   * (volatile uint8_t *)(0x14 + 0x20) |= 1 << 3;
  2243. }
  2244. #line 153
  2245. static __inline void TOSH_MAKE_PW4_OUTPUT(void)
  2246. #line 153
  2247. {
  2248. #line 153
  2249.   * (volatile uint8_t *)(0x14 + 0x20) |= 1 << 4;
  2250. }
  2251. #line 154
  2252. static __inline void TOSH_MAKE_PW5_OUTPUT(void)
  2253. #line 154
  2254. {
  2255. #line 154
  2256.   * (volatile uint8_t *)(0x14 + 0x20) |= 1 << 5;
  2257. }
  2258. #line 155
  2259. static __inline void TOSH_MAKE_PW6_OUTPUT(void)
  2260. #line 155
  2261. {
  2262. #line 155
  2263.   * (volatile uint8_t *)(0x14 + 0x20) |= 1 << 6;
  2264. }
  2265. #line 156
  2266. static __inline void TOSH_MAKE_PW7_OUTPUT(void)
  2267. #line 156
  2268. {
  2269. #line 156
  2270.   * (volatile uint8_t *)(0x14 + 0x20) |= 1 << 7;
  2271. }
  2272. #line 125
  2273. static __inline void TOSH_MAKE_CC_CHP_OUT_INPUT(void)
  2274. #line 125
  2275. {
  2276. #line 125
  2277.   * (volatile uint8_t *)(0x1A + 0x20) &= ~(1 << 6);
  2278. }
  2279. static inline 
  2280. #line 171
  2281. void TOSH_SET_PIN_DIRECTIONS(void )
  2282. {
  2283.   TOSH_MAKE_CC_CHP_OUT_INPUT();
  2284.   TOSH_MAKE_PW7_OUTPUT();
  2285.   TOSH_MAKE_PW6_OUTPUT();
  2286.   TOSH_MAKE_PW5_OUTPUT();
  2287.   TOSH_MAKE_PW4_OUTPUT();
  2288.   TOSH_MAKE_PW3_OUTPUT();
  2289.   TOSH_MAKE_PW2_OUTPUT();
  2290.   TOSH_MAKE_PW1_OUTPUT();
  2291.   TOSH_MAKE_PW0_OUTPUT();
  2292.   TOSH_MAKE_CC_PALE_OUTPUT();
  2293.   TOSH_MAKE_CC_PDATA_OUTPUT();
  2294.   TOSH_MAKE_CC_PCLK_OUTPUT();
  2295.   TOSH_MAKE_MISO_INPUT();
  2296.   TOSH_MAKE_SPI_OC1C_INPUT();
  2297.   TOSH_MAKE_SERIAL_ID_INPUT();
  2298.   TOSH_CLR_SERIAL_ID_PIN();
  2299. }
  2300. static inline  
  2301. # 57 "/home/testuser/tinyos-1.x/tos/platform/avrmote/HPLInit.nc"
  2302. result_t HPLInit$init(void)
  2303. #line 57
  2304. {
  2305.   TOSH_SET_PIN_DIRECTIONS();
  2306.   return SUCCESS;
  2307. }
  2308. # 47 "/home/testuser/tinyos-1.x/tos/system/RealMain.nc"
  2309. inline static  result_t RealMain$hardwareInit(void){
  2310. #line 47
  2311.   unsigned char result;
  2312. #line 47
  2313. #line 47
  2314.   result = HPLInit$init();
  2315. #line 47
  2316. #line 47
  2317.   return result;
  2318. #line 47
  2319. }
  2320. #line 47
  2321. static inline  
  2322. # 75 "../../tos/platform/mica2/HPLPotC.nc"
  2323. result_t HPLPotC$Pot$finalise(void)
  2324. #line 75
  2325. {
  2326.   return SUCCESS;
  2327. }
  2328. # 74 "/home/testuser/tinyos-1.x/tos/interfaces/HPLPot.nc"
  2329. inline static  result_t PotM$HPLPot$finalise(void){
  2330. #line 74
  2331.   unsigned char result;
  2332. #line 74
  2333. #line 74
  2334.   result = HPLPotC$Pot$finalise();
  2335. #line 74
  2336. #line 74
  2337.   return result;
  2338. #line 74
  2339. }
  2340. #line 74
  2341. static inline  
  2342. # 66 "../../tos/platform/mica2/HPLPotC.nc"
  2343. result_t HPLPotC$Pot$increase(void)
  2344. #line 66
  2345. {
  2346.   return SUCCESS;
  2347. }
  2348. # 67 "/home/testuser/tinyos-1.x/tos/interfaces/HPLPot.nc"
  2349. inline static  result_t PotM$HPLPot$increase(void){
  2350. #line 67
  2351.   unsigned char result;
  2352. #line 67
  2353. #line 67
  2354.   result = HPLPotC$Pot$increase();
  2355. #line 67
  2356. #line 67
  2357.   return result;
  2358. #line 67
  2359. }
  2360. #line 67
  2361. static inline  
  2362. # 57 "../../tos/platform/mica2/HPLPotC.nc"
  2363. result_t HPLPotC$Pot$decrease(void)
  2364. #line 57
  2365. {
  2366.   return SUCCESS;
  2367. }
  2368. # 59 "/home/testuser/tinyos-1.x/tos/interfaces/HPLPot.nc"
  2369. inline static  result_t PotM$HPLPot$decrease(void){
  2370. #line 59
  2371.   unsigned char result;
  2372. #line 59
  2373. #line 59
  2374.   result = HPLPotC$Pot$decrease();
  2375. #line 59
  2376. #line 59
  2377.   return result;
  2378. #line 59
  2379. }
  2380. #line 59
  2381. static inline 
  2382. # 93 "/home/testuser/tinyos-1.x/tos/system/PotM.nc"
  2383. void PotM$setPot(uint8_t value)
  2384. #line 93
  2385. {
  2386.   uint8_t i;
  2387. #line 95
  2388.   for (i = 0; i < 151; i++) 
  2389.     PotM$HPLPot$decrease();
  2390.   for (i = 0; i < value; i++) 
  2391.     PotM$HPLPot$increase();
  2392.   PotM$HPLPot$finalise();
  2393.   PotM$potSetting = value;
  2394. }
  2395. static inline  result_t PotM$Pot$init(uint8_t initialSetting)
  2396. #line 106
  2397. {
  2398.   PotM$setPot(initialSetting);
  2399.   return SUCCESS;
  2400. }
  2401. # 78 "/home/testuser/tinyos-1.x/tos/interfaces/Pot.nc"
  2402. inline static  result_t RealMain$Pot$init(uint8_t arg_0x85191f0){
  2403. #line 78
  2404.   unsigned char result;
  2405. #line 78
  2406. #line 78
  2407.   result = PotM$Pot$init(arg_0x85191f0);
  2408. #line 78
  2409. #line 78
  2410.   return result;
  2411. #line 78
  2412. }
  2413. #line 78
  2414. static inline 
  2415. # 79 "/home/testuser/tinyos-1.x/tos/system/sched.c"
  2416. void TOSH_sched_init(void )
  2417. {
  2418.   int i;
  2419. #line 82
  2420.   TOSH_sched_free = 0;
  2421.   TOSH_sched_full = 0;
  2422.   for (i = 0; i < TOSH_MAX_TASKS; i++) 
  2423.     TOSH_queue[i].tp = (void *)0;
  2424. }
  2425. static inline 
  2426. # 120 "/home/testuser/tinyos-1.x/tos/system/tos.h"
  2427. result_t rcombine(result_t r1, result_t r2)
  2428. {
  2429.   return r1 == FAIL ? FAIL : r2;
  2430. }
  2431. # 57 "/home/testuser/tinyos-1.x/tos/interfaces/Random.nc"
  2432. inline static   result_t MultiHopTtestM$Random$init(void){
  2433. #line 57
  2434.   unsigned char result;
  2435. #line 57
  2436. #line 57
  2437.   result = RandomLFSR$Random$init();
  2438. #line 57
  2439. #line 57
  2440.   return result;
  2441. #line 57
  2442. }
  2443. #line 57
  2444. static inline 
  2445. # 14 "../../tos/interfaces/SODebug.h"
  2446. void MultiHopTtestM$init_debug(void)
  2447. #line 14
  2448. {
  2449.   * (volatile uint8_t *)0x90 = 0;
  2450.   * (volatile uint8_t *)(0x09 + 0x20) = 15;
  2451.   * (volatile uint8_t *)(0x0B + 0x20) = 1 << 1;
  2452.   * (volatile uint8_t *)0x95 = (1 << 2) | (1 << 1);
  2453.   * (volatile uint8_t *)(0x0C + 0x20);
  2454.   * (volatile uint8_t *)(0x0A + 0x20) = 1 << 3;
  2455. }
  2456. # 25 "MultiHopTtestM.nc"
  2457. inline static   result_t MultiHopTtestM$ResetPower(void){
  2458. #line 25
  2459.   unsigned char result;
  2460. #line 25
  2461. #line 25
  2462.   result = CC1000RadioIntM$ResetPower();
  2463. #line 25
  2464. #line 25
  2465.   return result;
  2466. #line 25
  2467. }
  2468. #line 25
  2469. static inline   
  2470. # 1734 "../../tos/platform/mica2/CC1000RadioIntM.nc"
  2471. result_t CC1000RadioIntM$ResetDataSent(void)
  2472. #line 1734
  2473. {
  2474.   CC1000RadioIntM$dataSent = 0;
  2475.   return SUCCESS;
  2476. }
  2477. # 26 "MultiHopTtestM.nc"
  2478. inline static   result_t MultiHopTtestM$ResetDataSent(void){
  2479. #line 26
  2480.   unsigned char result;
  2481. #line 26
  2482. #line 26
  2483.   result = CC1000RadioIntM$ResetDataSent();
  2484. #line 26
  2485. #line 26
  2486.   return result;
  2487. #line 26
  2488. }
  2489. #line 26
  2490. static inline  
  2491. #line 45
  2492. result_t MultiHopTtestM$StdControl$init(void)
  2493. #line 45
  2494. {
  2495.   uint8_t i;
  2496. #line 47
  2497.   MultiHopTtestM$Rcount = 0;
  2498.   MultiHopTtestM$Scount = 0;
  2499.   MultiHopTtestM$ResetDataSent();
  2500.   MultiHopTtestM$ResetPower();
  2501.   for (i = 0; i < 50; i++) 
  2502.     MultiHopTtestM$eachCount[i] = 0;
  2503.   MultiHopTtestM$txBusy = MultiHopTtestM$startSender = FALSE;
  2504.   MultiHopTtestM$init_debug();
  2505.   MultiHopTtestM$gotFrames = TRUE;
  2506.   MultiHopTtestM$drandFirstTime = FALSE;
  2507.   MultiHopTtestM$Random$init();
  2508.   return SUCCESS;
  2509. }
  2510. static inline 
  2511. # 159 "/home/testuser/tinyos-1.x/tos/system/tos.h"
  2512. void *nmemset(void *to, int val, size_t n)
  2513. {
  2514.   char *cto = to;
  2515.   while (n--) * cto++ = val;
  2516.   return to;
  2517. }
  2518. static inline  
  2519. # 594 "/home/testuser/tinyos-1.x/tos/lib/MintRoute/MultiHopWMEWMA.nc"
  2520. result_t MultiHopWMEWMA$StdControl$init(void)
  2521. #line 594
  2522. {
  2523.   nmemset((void *)MultiHopWMEWMA$NeighborTbl, 0, sizeof(MultiHopWMEWMA$TableEntry ) * MultiHopWMEWMA$ROUTE_TABLE_SIZE);
  2524.   MultiHopWMEWMA$BaseStation.id = TOS_UART_ADDR;
  2525.   MultiHopWMEWMA$BaseStation.parent = TOS_UART_ADDR;
  2526.   MultiHopWMEWMA$BaseStation.flags = MultiHopWMEWMA$NBRFLAG_VALID;
  2527.   MultiHopWMEWMA$BaseStation.hop = 0;
  2528.   MultiHopWMEWMA$gpCurrentParent = (void *)0;
  2529.   MultiHopWMEWMA$gbCurrentHopCount = MultiHopWMEWMA$ROUTE_INVALID;
  2530.   MultiHopWMEWMA$gCurrentSeqNo = 0;
  2531.   MultiHopWMEWMA$gwEstTicks = 0;
  2532.   MultiHopWMEWMA$gUpdateInterval = MultiHopWMEWMA$DATA_TO_ROUTE_RATIO * MultiHopWMEWMA$DATA_FREQ;
  2533.   MultiHopWMEWMA$gfSendRouteBusy = FALSE;
  2534.   MultiHopWMEWMA$gSelfTimer = TRUE;
  2535.   return SUCCESS;
  2536. }
  2537. static inline  
  2538. # 91 "/home/testuser/tinyos-1.x/tos/lib/Queue/QueuedSendM.nc"
  2539. result_t QueuedSendM$StdControl$init(void)
  2540. #line 91
  2541. {
  2542.   int i;
  2543. #line 93
  2544.   for (i = 0; i < QueuedSendM$MESSAGE_QUEUE_SIZE; i++) {
  2545.       QueuedSendM$msgqueue[i].length = 0;
  2546.       QueuedSendM$msgqueue[i].pMsg = (void *)0;
  2547.     }
  2548.   QueuedSendM$retransmit = FALSE;
  2549.   QueuedSendM$enqueue_next = 0;
  2550.   QueuedSendM$dequeue_next = 0;
  2551.   QueuedSendM$fQueueIdle = TRUE;
  2552.   return SUCCESS;
  2553. }
  2554. # 63 "/home/testuser/tinyos-1.x/tos/interfaces/StdControl.nc"
  2555. inline static  result_t MultiHopEngineM$SubControl$init(void){
  2556. #line 63
  2557.   unsigned char result;
  2558. #line 63
  2559. #line 63
  2560.   result = QueuedSendM$StdControl$init();
  2561. #line 63
  2562.   result = rcombine(result, MultiHopWMEWMA$StdControl$init());
  2563. #line 63
  2564. #line 63
  2565.   return result;
  2566. #line 63
  2567. }
  2568. #line 63
  2569. inline static  result_t CC1000RadioIntM$TimerControl$init(void){
  2570. #line 63
  2571.   unsigned char result;
  2572. #line 63
  2573. #line 63
  2574.   result = TimerM$StdControl$init();
  2575. #line 63
  2576. #line 63
  2577.   return result;
  2578. #line 63
  2579. }
  2580. #line 63
  2581. # 57 "/home/testuser/tinyos-1.x/tos/interfaces/Random.nc"
  2582. inline static   result_t CC1000RadioIntM$Random$init(void){
  2583. #line 57
  2584.   unsigned char result;
  2585. #line 57
  2586. #line 57
  2587.   result = RandomLFSR$Random$init();
  2588. #line 57
  2589. #line 57
  2590.   return result;
  2591. #line 57
  2592. }
  2593. #line 57
  2594. static inline   
  2595. # 90 "../../tos/platform/mica2/HPLADCM.nc"
  2596. result_t HPLADCM$ADC$init(void)
  2597. #line 90
  2598. {
  2599.   HPLADCM$init_portmap();
  2600.   { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
  2601. #line 95
  2602.     {
  2603.       * (volatile uint8_t *)(0x06 + 0x20) = (1 << 3) | (6 << 0);
  2604.       * (volatile uint8_t *)(0x07 + 0x20) = 0;
  2605.     }
  2606. #line 99
  2607.     __nesc_atomic_end(__nesc_atomic); }
  2608.   return SUCCESS;
  2609. }
  2610. # 54 "/home/testuser/tinyos-1.x/tos/interfaces/HPLADC.nc"
  2611. inline static   result_t ADCREFM$HPLADC$init(void){
  2612. #line 54
  2613.   unsigned char result;
  2614. #line 54
  2615. #line 54
  2616.   result = HPLADCM$ADC$init();
  2617. #line 54
  2618. #line 54
  2619.   return result;
  2620. #line 54
  2621. }
  2622. #line 54
  2623. static inline  
  2624. # 99 "../../tos/platform/mica2/ADCREFM.nc"
  2625. result_t ADCREFM$ADCControl$init(void)
  2626. #line 99
  2627. {
  2628.   { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
  2629. #line 100
  2630.     {
  2631.       ADCREFM$ReqPort = 0;
  2632.       ADCREFM$ReqVector = ADCREFM$ContReqMask = ADCREFM$CalReqMask = 0;
  2633.       ADCREFM$RefVal = 381;
  2634.     }
  2635. #line 104
  2636.     __nesc_atomic_end(__nesc_atomic); }
  2637.   {
  2638.   }
  2639. #line 105
  2640.   ;
  2641.   return ADCREFM$HPLADC$init();
  2642. }
  2643. # 77 "../../tos/platform/mica2/ADCControl.nc"
  2644. inline static  result_t CC1000RadioIntM$ADCControl$init(void){
  2645. #line 77
  2646.   unsigned char result;
  2647. #line 77
  2648. #line 77
  2649.   result = ADCREFM$ADCControl$init();
  2650. #line 77
  2651. #line 77
  2652.   return result;
  2653. #line 77
  2654. }
  2655. #line 77
  2656. static inline   
  2657. # 110 "../../tos/platform/mica2/HPLADCM.nc"
  2658. result_t HPLADCM$ADC$bindPort(uint8_t port, uint8_t adcPort)
  2659. #line 110
  2660. {
  2661.   if (
  2662. #line 111
  2663.   port < TOSH_ADC_PORTMAPSIZE && 
  2664.   port != TOS_ADC_BANDGAP_PORT && 
  2665.   port != TOS_ADC_GND_PORT) {
  2666.       HPLADCM$init_portmap();
  2667.       { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start();
  2668. #line 115
  2669.         HPLADCM$TOSH_adc_portmap[port] = adcPort;
  2670. #line 115
  2671.         __nesc_atomic_end(__nesc_atomic); }
  2672.       return SUCCESS;
  2673.     }
  2674.   else {
  2675.     return FAIL;
  2676.     }
  2677. }
  2678. # 70 "/home/testuser/tinyos-1.x/tos/interfaces/HPLADC.nc"
  2679. inline static   result_t ADCREFM$HPLADC$bindPort(uint8_t arg_0x87f8060, uint8_t arg_0x87f81a8){
  2680. #line 70
  2681.   unsigned char result;
  2682. #line 70
  2683. #line 70
  2684.   result = HPLADCM$ADC$bindPort(arg_0x87f8060, arg_0x87f81a8);
  2685. #line 70
  2686. #line 70
  2687.   return result;
  2688. #line 70
  2689. }
  2690. #line 70
  2691. static inline  
  2692. # 114 "../../tos/platform/mica2/ADCREFM.nc"
  2693. result_t ADCREFM$ADCControl$bindPort(uint8_t port, uint8_t adcPort)
  2694. #line 114
  2695. {
  2696.   return ADCREFM$HPLADC$bindPort(port, adcPort);
  2697. }
  2698. # 116 "../../tos/platform/mica2/ADCControl.nc"
  2699. inline static  result_t CC1000RadioIntM$ADCControl$bindPort(uint8_t arg_0x8630810, uint8_t arg_0x8630958){
  2700. #line 116
  2701.   unsigned char result;
  2702. #line 116
  2703. #line 116
  2704.   result = ADCREFM$ADCControl$bindPort(arg_0x8630810, arg_0x8630958);
  2705. #line 116
  2706. #line 116
  2707.   return result;
  2708. #line 116
  2709. }
  2710. #line 116
  2711. static inline  
  2712. # 517 "../../tos/platform/mica2/CC1000ControlM.nc"
  2713. bool CC1000ControlM$CC1000Control$GetLOStatus(void)
  2714. #line 517
  2715. {
  2716.   return CC1000ControlM$gCurrentParameters[0x1e];
  2717. }
  2718. # 190 "../../tos/platform/mica2/CC1000Control.nc"
  2719. inline static  bool CC1000RadioIntM$CC1000Control$GetLOStatus(void){
  2720. #line 190
  2721.   unsigned char result;
  2722. #line 190
  2723. #line 190
  2724.   result = CC1000ControlM$CC1000Control$GetLOStatus();
  2725. #line 190
  2726. #line 190
  2727.   return result;
  2728. #line 190
  2729. }
  2730. #line 190
  2731. # 58 "../../tos/platform/mica2/HPLCC1000.nc"
  2732. inline static   result_t CC1000ControlM$HPLChipcon$write(uint8_t arg_0x87b1768, uint8_t arg_0x87b18b0){
  2733. #line 58
  2734.   unsigned char result;
  2735. #line 58
  2736. #line 58
  2737.   result = HPLCC1000M$HPLCC1000$write(arg_0x87b1768, arg_0x87b18b0);
  2738. #line 58
  2739. #line 58
  2740.   return result;
  2741. #line 58
  2742. }
  2743. #line 58
  2744. static inline  
  2745. # 505 "../../tos/platform/mica2/CC1000ControlM.nc"
  2746. result_t CC1000ControlM$CC1000Control$SelectLock(uint8_t Value)
  2747. #line 505
  2748. {
  2749.   CC1000ControlM$gCurrentParameters[0xd] = Value << 4;
  2750.   return CC1000ControlM$HPLChipcon$write(0x0D, Value << 4);
  2751. }
  2752. # 170 "../../tos/platform/mica2/CC1000Control.nc"
  2753. inline static  result_t CC1000RadioIntM$CC1000Control$SelectLock(uint8_t arg_0x856d710){
  2754. #line 170
  2755.   unsigned char result;
  2756. #line 170
  2757. #line 170
  2758.   result = CC1000ControlM$CC1000Control$SelectLock(arg_0x856d710);
  2759. #line 170
  2760. #line 170
  2761.   return result;
  2762. #line 170
  2763. }
  2764. #line 170
  2765. # 65 "../../tos/platform/mica2/HPLCC1000.nc"
  2766. inline static   uint8_t CC1000ControlM$HPLChipcon$read(uint8_t arg_0x87b1d20){
  2767. #line 65
  2768.   unsigned char result;
  2769. #line 65
  2770. #line 65
  2771.   result = HPLCC1000M$HPLCC1000$read(arg_0x87b1d20);
  2772. #line 65
  2773. #line 65
  2774.   return result;
  2775. #line 65
  2776. }
  2777. #line 65
  2778. static inline 
  2779. # 131 "../../tos/platform/mica2/CC1000ControlM.nc"
  2780. result_t CC1000ControlM$chipcon_cal(void)
  2781. {
  2782.   CC1000ControlM$HPLChipcon$write(0x0B, 0x00);
  2783.   CC1000ControlM$HPLChipcon$write(0x42, 0x3f);
  2784.   CC1000ControlM$HPLChipcon$write(0x00, (
  2785.   1 << 4) | (1 << 0));
  2786.   CC1000ControlM$HPLChipcon$write(0x0E, ((
  2787.   1 << 7) | (
  2788.   1 << 5)) | (6 << 0));
  2789.   while ((CC1000ControlM$HPLChipcon$read(0x0E) & (1 << 3)) == 0) ;
  2790.   CC1000ControlM$HPLChipcon$write(0x0E, (
  2791.   1 << 5) | (6 << 0));
  2792.   CC1000ControlM$HPLChipcon$write(0x00, (((
  2793.   1 << 7) | (1 << 6)) | (1 << 5)) | (
  2794.   1 << 0));
  2795.   CC1000ControlM$HPLChipcon$write(0x09, CC1000ControlM$gCurrentParameters[29]);
  2796.   CC1000ControlM$HPLChipcon$write(0x0B, 0x00);
  2797.   CC1000ControlM$HPLChipcon$write(0x0E, ((
  2798.   1 << 7) | (
  2799.   1 << 5)) | (6 << 0));
  2800.   while ((CC1000ControlM$HPLChipcon$read(0x0E) & (1 << 3)) == 0) ;
  2801.   CC1000ControlM$HPLChipcon$write(0x0E, (
  2802.   1 << 5) | (6 << 0));
  2803.   return SUCCESS;
  2804. }
  2805. static inline void CC1000ControlM$cc1000SetFreq(void)
  2806. #line 187
  2807. {
  2808.   uint8_t i;
  2809.   for (i = 1; i < 0x0d; i++) {
  2810.       CC1000ControlM$HPLChipcon$write(i, CC1000ControlM$gCurrentParameters[i]);
  2811.     }
  2812.   CC1000ControlM$HPLChipcon$write(0x12, CC1000ControlM$gCurrentParameters[0x12]);
  2813.   CC1000ControlM$chipcon_cal();
  2814.   return;
  2815. }
  2816. static inline  
  2817. #line 400
  2818. result_t CC1000ControlM$CC1000Control$TunePreset(uint8_t freq)
  2819. #line 400
  2820. {
  2821.   int i;
  2822.   for (i = 1; i < 31; i++) {
  2823.       CC1000ControlM$gCurrentParameters[i] = ({
  2824. #line 405
  2825.         uint16_t __addr16 = (uint16_t )(uint16_t )&CC1K_Params[freq][i];
  2826. #line 405
  2827.         uint8_t __result;
  2828. #line 405
  2829.          __asm ("lpm %0, Z""nt" : "=r"(__result) : "z"(__addr16));__result;
  2830.       }
  2831.       );
  2832.     }
  2833. #line 407
  2834.   CC1000ControlM$cc1000SetFreq();
  2835.   return SUCCESS;
  2836. }
  2837. static inline 
  2838. #line 203
  2839. void CC1000ControlM$cc1000SetModem(void)
  2840. #line 203
  2841. {
  2842.   CC1000ControlM$HPLChipcon$write(0x0F, CC1000ControlM$gCurrentParameters[0x0f]);
  2843.   CC1000ControlM$HPLChipcon$write(0x10, CC1000ControlM$gCurrentParameters[0x10]);
  2844.   CC1000ControlM$HPLChipcon$write(0x11, CC1000ControlM$gCurrentParameters[0x11]);
  2845.   return;
  2846. }
  2847. static 
  2848. # 101 "../../tos/platform/mica2/hardware.h"
  2849. void __inline TOSH_uwait(int u_sec)
  2850. #line 101
  2851. {
  2852.   while (u_sec > 0) {
  2853.        __asm volatile ("nop");
  2854.        __asm volatile ("nop");
  2855.        __asm volatile ("nop");
  2856.        __asm volatile ("nop");
  2857.        __asm volatile ("nop");
  2858.        __asm volatile ("nop");
  2859.        __asm volatile ("nop");
  2860.        __asm volatile ("nop");
  2861.       u_sec--;
  2862.     }
  2863. }
  2864. #line 127
  2865. static __inline void TOSH_SET_CC_PCLK_PIN(void)
  2866. #line 127
  2867. {
  2868. #line 127
  2869.   * (volatile uint8_t *)(0x12 + 0x20) |= 1 << 6;
  2870. }
  2871. #line 126
  2872. static __inline void TOSH_SET_CC_PDATA_PIN(void)
  2873. #line 126
  2874. {
  2875. #line 126
  2876.   * (volatile uint8_t *)(0x12 + 0x20) |= 1 << 7;
  2877. }
  2878. #line 128
  2879. static __inline void TOSH_SET_CC_PALE_PIN(void)
  2880. #line 128
  2881. {
  2882. #line 128
  2883.   * (volatile uint8_t *)(0x12 + 0x20) |= 1 << 4;
  2884. }
  2885. static inline  
  2886. # 51 "../../tos/platform/mica2/HPLCC1000M.nc"
  2887. result_t HPLCC1000M$HPLCC1000$init(void)
  2888. #line 51
  2889. {
  2890.   TOSH_MAKE_CC_CHP_OUT_INPUT();
  2891.   TOSH_MAKE_CC_PALE_OUTPUT();
  2892.   TOSH_MAKE_CC_PCLK_OUTPUT();
  2893.   TOSH_MAKE_CC_PDATA_OUTPUT();
  2894.   TOSH_SET_CC_PALE_PIN();
  2895.   TOSH_SET_CC_PDATA_PIN();
  2896.   TOSH_SET_CC_PCLK_PIN();
  2897.   return SUCCESS;
  2898. }
  2899. # 51 "../../tos/platform/mica2/HPLCC1000.nc"
  2900. inline static  result_t CC1000ControlM$HPLChipcon$init(void){
  2901. #line 51
  2902.   unsigned char result;
  2903. #line 51
  2904. #line 51
  2905.   result = HPLCC1000M$HPLCC1000$init();
  2906. #line 51
  2907. #line 51
  2908.   return result;
  2909. #line 51
  2910. }
  2911. #line 51
  2912. static inline  
  2913. # 342 "../../tos/platform/mica2/CC1000ControlM.nc"
  2914. result_t CC1000ControlM$StdControl$init(void)
  2915. #line 342
  2916. {
  2917.   * (volatile uint8_t *)0x8A = 0x41;
  2918.   CC1000ControlM$HPLChipcon$init();
  2919.   CC1000ControlM$HPLChipcon$write(0x00, (((
  2920.   1 << 5) | (1 << 4)) | (
  2921.   1 << 3)) | (1 << 1));
  2922.   CC1000ControlM$HPLChipcon$write(0x00, ((((
  2923.   1 << 5) | (1 << 4)) | (
  2924.   1 << 3)) | (1 << 1)) | (
  2925.   1 << 0));
  2926.   TOSH_uwait(2000);
  2927.   CC1000ControlM$gCurrentParameters[0xb] = (8 << 4) | (0 << 0);
  2928.   CC1000ControlM$HPLChipcon$write(0x0B, CC1000ControlM$gCurrentParameters[0xb]);
  2929.   CC1000ControlM$gCurrentParameters[0xd] = 9 << 4;
  2930.   CC1000ControlM$HPLChipcon$write(4, CC1000ControlM$gCurrentParameters[0xd]);
  2931.   CC1000ControlM$gCurrentParameters[0xf] = 0;
  2932.   CC1000ControlM$gCurrentParameters[0x10] = (((3 << 5) | (1 << 3)) | (