Revision 413
tested/fixed new BOM code. bom_refresh() did not use the lookup table before calling analog_get8(). but now it works. run main in template directory to see new BOM buffer compared to old get_max_bom() values.
main.c | ||
---|---|---|
2 | 2 |
|
3 | 3 |
int main(void) { |
4 | 4 |
unsigned int count = 0; |
5 |
int count2 = 0;
|
|
6 |
dragonfly_init(ALL_ON);
|
|
5 |
int maxbom = -1;
|
|
6 |
dragonfly_init(ALL_ON);
|
|
7 | 7 |
range_init(); |
8 | 8 |
//analog_stop_loop(); |
9 |
usb_puts("starting"); |
|
9 |
usb_puts("starting\n\r");
|
|
10 | 10 |
while (1) { |
11 |
if (count == 50000) { |
|
12 |
for(int i=2; i<7; i++) { |
|
13 |
usb_puti( linearize_distance(analog8(i)) ); |
|
14 |
usb_puts(" "); |
|
15 |
} |
|
16 |
usb_puts("\n\r"); |
|
17 |
count = 0; |
|
18 |
} |
|
19 |
/* |
|
20 |
if (count2 == 5000) { |
|
21 |
usb_puts("Loop stopped\n\r"); |
|
22 |
analog_stop_loop(); |
|
23 |
} |
|
24 |
|
|
25 |
if (count2 == 10000) { |
|
26 |
usb_puts("Loop started\n\r"); |
|
27 |
analog_start_loop(); |
|
28 |
count2 = 0; |
|
29 |
}*/ |
|
30 |
|
|
31 |
|
|
32 |
count++; |
|
33 |
//count2++; |
|
11 |
//bom_leds_on(BOM_ALL); |
|
12 |
bom_refresh(BOM_ALL); |
|
13 |
usb_puts("refreshed\n\r"); |
|
14 |
maxbom = bom_get_max(); |
|
15 |
usb_puts("maxbom: "); |
|
16 |
usb_puti(maxbom); |
|
17 |
usb_puts("\n\n\r"); |
|
18 |
delay_ms(100); |
|
34 | 19 |
} |
35 | 20 |
|
36 | 21 |
return 0; |
Also available in: Unified diff