Project

General

Profile

Revision 336

Updated wireless to use a circular buffer instead of a queue using malloc. Tested on both the computer and robots with a token ring, and was successful.

View differences:

main.c
1 1
#include <dragonfly_lib.h>
2 2
#include <wireless.h>
3 3
#include <wl_token_ring.h>
4
#include <xbee.h>
4 5

  
5 6
int main(void)
6 7
{
8
	//usb_puts("Turned on.\n");
7 9
	dragonfly_init(ALL_ON);
8
	usb_puts("Start.\r\n");
9
	orb_set_color(GREEN);
10
	usb_puts("Dragonfly initialized.\n");
11
	//range_init();
12
	//orb_enable();
13
	//usb_puts("Rangefinders initialized.\n");
10 14
	wl_init();
11
	orb_set_color(YELLOW);
12 15
	usb_puts("Wireless initialized.\n");
16

  
17
	wl_set_channel(0xF);
18
	usb_puts("Wireless channel set.\n");
13 19
	wl_token_ring_register();
20
	usb_puts("Token ring initialized.\n");
14 21
	wl_token_ring_join();
15
	orb_set_color(CYAN);
22
	usb_puts("Token ring joined.\n");
16 23
	while (1)
24
	{
17 25
		wl_do();
26
	}
18 27
}
28

  

Also available in: Unified diff