summaryrefslogtreecommitdiff
path: root/digital/io/src/path.c
diff options
context:
space:
mode:
authorNicolas Schodet2008-04-30 13:20:03 +0200
committerNicolas Schodet2008-04-30 13:20:03 +0200
commit960a716bceeeb0fbf58dec1859725a070d486f74 (patch)
tree1e0a64c4771011ab1171d5af884971f2e31634b4 /digital/io/src/path.c
parentc2f9b6a00b3fd23aa01c668725638800a28c540c (diff)
* host/inter, digital/io/src:
- added computed path drawing.
Diffstat (limited to 'digital/io/src/path.c')
-rw-r--r--digital/io/src/path.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/digital/io/src/path.c b/digital/io/src/path.c
index 959f299e..50724f59 100644
--- a/digital/io/src/path.c
+++ b/digital/io/src/path.c
@@ -26,9 +26,11 @@
#include "path.h"
#include "playground.h"
+#include "simu.host.h"
#include "modules/math/fixed/fixed.h"
#include "modules/utils/utils.h"
+#include "modules/host/mex.h"
/** Number of possible obstacles. */
#define PATH_OBSTACLES_NB 2
@@ -288,6 +290,17 @@ path_update (void)
path_compute_points ();
path_compute_arcs ();
path_dijkstra ();
+#if defined (HOST)
+ uint8_t len, i;
+ uint16_t points[PATH_POINTS_NB * 2];
+ len = 0;
+ for (i = 1; i != 0xff; i = path.points[i].next)
+ {
+ points[len++] = path.points[i].x;
+ points[len++] = path.points[i].y;
+ }
+ simu_send_path (len, points);
+#endif
}
/** Retrieve first path point coordinates. Return 0 on failure. */