Project

General

Profile

Revision 190

Token ring speed doubled, bugs fixed.

View differences:

wl_token_ring.c
265 265
{
266 266
	WL_DEBUG_PRINT("Joining the token ring.\r\n");
267 267
	ringState = JOINING;
268
	joinDelay = JOIN_DELAY;
268
	joinDelay = DEATH_DELAY * 2;
269 269
	wl_send_global_packet(WL_TOKEN_RING_GROUP, WL_TOKEN_JOIN,
270 270
		NULL, 0, 0);
271 271
}
......
493 493
	WL_DEBUG_PRINT_INT(source);
494 494
	WL_DEBUG_PRINT(" has flashed its bom.\r\n");
495 495

  
496
	//make sure we don't declare the robot dead if it's
497
	//flashing its BOM
498
	if (source == wl_token_next_robot)
499
		deathDelay = DEATH_DELAY;
500 496
	sensor_matrix_set_reading(sensorMatrix, wl_get_xbee_id(), 
501 497
		source, get_max_bom_function());
502 498
}
......
517 513
			wl_get_xbee_id(), 1);
518 514
		WL_DEBUG_PRINT("Now a member of the token ring.\r\n");
519 515
		ringState = MEMBER;
516
		joinDelay = -1;
520 517
	}
521 518

  
522 519
	if (ringState == LEAVING || ringState == NONMEMBER)
......
596 593
	WL_DEBUG_PRINT_INT(source);
597 594
	WL_DEBUG_PRINT(" into the token ring.\r\n");
598 595

  
599
	joinDelay = -1;
600
	
601 596
	// the token ring has not started yet
602 597
	if (sensor_matrix_get_joined(sensorMatrix) == 1)
603 598
		wl_token_pass_token();
......
615 610
	WL_DEBUG_PRINT("Accepted into the token ring by robot ");
616 611
	WL_DEBUG_PRINT_INT(source);
617 612
	WL_DEBUG_PRINT(".\r\n");
618
	joinDelay = -1;
613
	joinDelay = JOIN_DELAY;
619 614
	ringState = ACCEPTED;
620 615
	acceptor = source;
621 616

  

Also available in: Unified diff