Revision 1460
put lcd and rangefinder lookup tables into program space
removed TODO inline comments from wireless library
wl_token_ring.c | ||
---|---|---|
47 | 47 |
#include <time.h> |
48 | 48 |
#endif |
49 | 49 |
|
50 |
//TODO: why is this in both this file and sensor_matrix.c? If it is needed in both places, |
|
51 |
// put it in sensor_matrix.h. This file already includes sensor_matrix.h |
|
52 |
#define DEFAULT_SENSOR_MATRIX_SIZE 20 |
|
53 | 50 |
|
51 |
//#define DEFAULT_SENSOR_MATRIX_SIZE 20 |
|
52 |
|
|
54 | 53 |
/*Ring States*/ |
55 | 54 |
|
56 | 55 |
#define NONMEMBER 0 |
... | ... | |
155 | 154 |
* alerting others of its location, but continues storing the |
156 | 155 |
* locations of other robots. |
157 | 156 |
**/ |
158 |
//TODO: this function is so simple, it *may* be beneficial to inline this function. testing of if |
|
159 |
// it reduces code size or not should be done to be sure. |
|
160 | 157 |
void wl_token_ring_leave() |
161 | 158 |
{ |
162 | 159 |
ringState = LEAVING; |
... | ... | |
190 | 187 |
/** |
191 | 188 |
* Removes the packet group from the wireless library. |
192 | 189 |
**/ |
193 |
//TODO: this function is so simple, it *may* be beneficial to inline this function. testing of if |
|
194 |
// it reduces code size or not should be done to be sure. |
|
195 | 190 |
void wl_token_ring_unregister() |
196 | 191 |
{ |
197 | 192 |
wl_unregister_packet_group(&wl_token_ring_handler); |
... | ... | |
220 | 215 |
/** |
221 | 216 |
* Called to cleanup the token ring packet group. |
222 | 217 |
**/ |
223 |
//TODO: this function is so simple, it *may* be beneficial to inline this function. testing of if |
|
224 |
// it reduces code size or not should be done to be sure. |
|
225 | 218 |
static void wl_token_ring_cleanup() |
226 | 219 |
{ |
227 | 220 |
} |
... | ... | |
362 | 355 |
* @return a BOM reading from us to robot dest, in the range |
363 | 356 |
* 0-15, or -1 if it is unkown |
364 | 357 |
**/ |
365 |
//TODO: this function is so simple, it *may* be beneficial to inline this function. testing of if |
|
366 |
// it reduces code size or not should be done to be sure. |
|
367 | 358 |
int wl_token_get_my_sensor_reading(int dest) |
368 | 359 |
{ |
369 | 360 |
return wl_token_get_sensor_reading(wl_get_xbee_id(), dest); |
... | ... | |
375 | 366 |
* |
376 | 367 |
* @return the number of robots in the token ring |
377 | 368 |
**/ |
378 |
//TODO: this function is so simple, it *may* be beneficial to inline this function. testing of if |
|
379 |
// it reduces code size or not should be done to be sure. |
|
380 | 369 |
int wl_token_get_robots_in_ring(void) |
381 | 370 |
{ |
382 | 371 |
return sensor_matrix_get_joined(); |
... | ... | |
389 | 378 |
* @param robot the robot to check for whether it is in the token ring |
390 | 379 |
* @return nonzero if the robot is in the token ring, zero otherwise |
391 | 380 |
**/ |
392 |
//TODO: this function is so simple, it *may* be beneficial to inline this function. testing of if |
|
393 |
// it reduces code size or not should be done to be sure. |
|
394 | 381 |
int wl_token_is_robot_in_ring(int robot) |
395 | 382 |
{ |
396 | 383 |
return sensor_matrix_get_in_ring(robot); |
... | ... | |
429 | 416 |
* |
430 | 417 |
* @see wl_token_iterator_begin, wl_token_iterator_next |
431 | 418 |
**/ |
432 |
//TODO: this function is so simple, it *may* be beneficial to inline this function. testing of if |
|
433 |
// it reduces code size or not should be done to be sure. |
|
434 | 419 |
int wl_token_iterator_has_next(void) |
435 | 420 |
{ |
436 | 421 |
return iteratorCount != -1; |
... | ... | |
473 | 458 |
* |
474 | 459 |
* @return the number of robots in the token ring |
475 | 460 |
**/ |
476 |
//TODO: this function is so simple, it *may* be beneficial to inline this function. testing of if |
|
477 |
// it reduces code size or not should be done to be sure. |
|
478 | 461 |
int wl_token_get_num_robots(void) |
479 | 462 |
{ |
480 | 463 |
return sensor_matrix_get_joined(); |
... | ... | |
485 | 468 |
* |
486 | 469 |
* @return the number of robots in the sensor matrix |
487 | 470 |
**/ |
488 |
//TODO: this function is so simple, it *may* be beneficial to inline this function. testing of if |
|
489 |
// it reduces code size or not should be done to be sure. |
|
490 | 471 |
int wl_token_get_matrix_size(void) |
491 | 472 |
{ |
492 | 473 |
return sensor_matrix_get_size(); |
Also available in: Unified diff