Project

General

Profile

Statistics
| Revision:

root / branches / autonomous_recharging / code / projects / libwireless / bayboardTest / main.c @ 714

History | View | Annotate | Download (762 Bytes)

1
#include <bayboard_lib.h>
2
#include <wireless.h>
3
#include <wl_token_ring.h>
4

    
5
void test_bom_on (void)
6
{
7
        set_orb(0,200,0);
8
}
9

    
10
void test_bom_off(void)
11
{
12
        set_orb(0,0,0);
13
}
14

    
15
int test_nothing(void)
16
{
17
        return -1;
18
}
19

    
20
void do_nothing (void) {
21
        
22
}
23

    
24
int main(void)
25
{
26
        bayboard_init(ALL_ON);
27
        usb_puts("reset\n");
28
        set_orb(0,0,200);
29
        delay_ms(500);
30
        set_orb(0,0,0);
31
        usb_puts("Start?\r\n");
32
        wl_init();
33
        
34
        usb_puts("Attempting to set bom functions\r\n");
35
        wl_token_ring_set_bom_functions(do_nothing, do_nothing, test_nothing);
36
        usb_puts("Attempting to register\r\n");
37
        wl_token_ring_register();
38
        usb_puts("Attempting to join\r\n");
39
        if (wl_token_ring_join())
40
                set_orb(200,0,0);
41
        else 
42
                set_orb(0,200,0);
43
        
44
        usb_puts("Wireless initialized.\r\n");
45

    
46
        while (1)
47
                wl_do();
48
}