amiro-os / devices / DiWheelDrive / amiro_map.cpp @ e1f1c4b5
History | View | Annotate | Download (538 Bytes)
1 | e1f1c4b5 | galberding | #include "amiro_map.hpp" |
---|---|---|---|
2 | |||
3 | |||
4 | void AmiroMap::initialize(int8_t (&config)[MAX_NODES][NODE_ATTRIBUTES]){
|
||
5 | |||
6 | uint8_t nodeCount = 0;
|
||
7 | bool end = false; |
||
8 | |||
9 | for (int i=0; i<MAX_NODES; i++){ |
||
10 | if(config[i][NODE_ATTRIBUTES - 1] == 255){ |
||
11 | end = true;
|
||
12 | break;
|
||
13 | } |
||
14 | nodeCount++; |
||
15 | } |
||
16 | if (!end || nodeCount == 0 ){ |
||
17 | |||
18 | // Failed to determine the amount of nodes
|
||
19 | return;
|
||
20 | } |
||
21 | |||
22 | this->nodeList = (struct node*) malloc(nodeCount * sizeof(struct node)); |
||
23 | |||
24 | |||
25 | |||
26 | } |
||
27 | |||
28 | |||
29 | void AmiroMap::update(){
|
||
30 | |||
31 | } |
||
32 | |||
33 | |||
34 | void AmiroMap::uninitialize(){
|
||
35 | |||
36 | } |