Revision 1213
Finished rangefinders test implementation
hardware_wall.c | ||
---|---|---|
1 | 1 |
#include "hardware_wall.h" |
2 | 2 |
|
3 |
uint16_t simulated_wall_position; // TODO remove and replace with real wall |
|
4 |
|
|
3 | 5 |
void wall_init () |
4 | 6 |
{ |
5 | 7 |
// FIXME implement |
8 |
|
|
9 |
simulated_wall_position=0; |
|
6 | 10 |
} |
7 | 11 |
|
8 |
char *wall_direction_string (uint8_t direction) |
|
9 |
{ |
|
10 |
if (direction==1) |
|
11 |
return "out"; |
|
12 |
else if (direction==2) |
|
13 |
return "in"; |
|
14 |
else |
|
15 |
return "?"; |
|
16 |
} |
|
17 | 12 |
|
18 | 13 |
void wall_set_position (uint16_t position) |
19 | 14 |
{ |
... | ... | |
23 | 18 |
|
24 | 19 |
// FIXME implement |
25 | 20 |
|
26 |
usb_puts ("# Wall position reached"); |
|
21 |
simulated_wall_position=position+1; |
|
22 |
|
|
23 |
usb_puts ("# Wall position reached" NL); |
|
27 | 24 |
} |
28 | 25 |
|
29 | 26 |
// We might also need this because the wall_set_position might not reach the exact position |
30 | 27 |
uint16_t wall_get_position () |
31 | 28 |
{ |
32 | 29 |
// FIXME implement |
33 |
return 0; |
|
30 |
//return 0; |
|
31 |
|
|
32 |
return simulated_wall_position; |
|
34 | 33 |
} |
Also available in: Unified diff