Revision 43
Wireless library updated. Ran successfuly for 15 minutes on 4 robots.
trunk/code/projects/libwireless/lib/wl_token_ring.c | ||
---|---|---|
15 | 15 |
|
16 | 16 |
#define DEFAULT_SENSOR_MATRIX_SIZE 20 |
17 | 17 |
|
18 |
//TODO: idea: if the xbee can handle many packets at once, we could have everyone |
|
19 |
//send their BOM reading for a particular robot right after getting it. |
|
20 |
|
|
21 | 18 |
/*Ring States*/ |
22 | 19 |
|
23 | 20 |
#define NONMEMBER 0 |
... | ... | |
168 | 165 |
WL_DEBUG_PRINT_INT(wl_token_next_robot); |
169 | 166 |
WL_DEBUG_PRINT(" has died.\r\n"); |
170 | 167 |
} |
171 |
wl_token_pass_token(); |
|
168 |
|
|
169 |
// we may have been dropped from the ring when this is received |
|
170 |
if (ringState == MEMBER) |
|
171 |
wl_token_pass_token(); |
|
172 | 172 |
} |
173 | 173 |
|
174 | 174 |
//we must start our own token ring, no one is responding to us |
... | ... | |
377 | 377 |
|
378 | 378 |
if (i == wl_get_xbee_id() && ringState == MEMBER) |
379 | 379 |
{ |
380 |
sensor_matrix_set_in_ring(sensorMatrix, |
|
381 |
wl_get_xbee_id(), 1); |
|
382 | 380 |
ringState = NONMEMBER; |
383 | 381 |
wl_token_ring_join(); |
384 | 382 |
|
... | ... | |
535 | 533 |
{ |
536 | 534 |
WL_DEBUG_PRINT("We should have left the token ring, but didn't.\r\n"); |
537 | 535 |
} |
536 |
return; |
|
538 | 537 |
} |
539 | 538 |
|
540 | 539 |
//check for interruption requests |
trunk/code/projects/libwireless/lib/Makefile | ||
---|---|---|
172 | 172 |
$(DOXYGEN) |
173 | 173 |
$(COPY) docs/html/* $(COLONYROOT)/docs/$(TARGET) |
174 | 174 |
|
175 |
|
|
176 | 175 |
build: $(OBJ) |
177 | 176 |
$(AR) $(ALL_ASFLAGS) $(TARGET).a $(OBJ) |
178 | 177 |
|
178 |
computer: |
|
179 |
gcc *.c -g -I. -c |
|
180 |
ar rcs $(TARGET).a $(OBJ) |
|
181 |
|
|
179 | 182 |
# Eye candy. |
180 | 183 |
# AVR Studio 3.x does not check make's exit code but relies on |
181 | 184 |
# the following magic strings to be generated by the compile job. |
Also available in: Unified diff