From 02c350de9a29cc88c6ea83bde9691667d2f65aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Wed, 7 Sep 2011 13:24:08 +0200 Subject: [PATCH] Small fixes for the example --- examples/MissionComputer_for_Core/build | 4 ++-- examples/MissionComputer_for_Core/main.c | 25 +++++++++++++++++++++++- examples/MissionComputer_for_Core/mc.ept | 2 +- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/examples/MissionComputer_for_Core/build b/examples/MissionComputer_for_Core/build index 6cbc390..ad7e0f3 100755 --- a/examples/MissionComputer_for_Core/build +++ b/examples/MissionComputer_for_Core/build @@ -1,9 +1,9 @@ #!/bin/bash HEPTC=../../compiler/heptc.byte -HEPTC_OPTIONS= +HEPTC_OPTIONS=-memalloc GCC=gcc -GCC_OPTIONS="-std=c99 -I ../../../lib/c" +GCC_OPTIONS="-g -O2 -std=c99 -I ../../../lib/c" VERBOSE=1 diff --git a/examples/MissionComputer_for_Core/main.c b/examples/MissionComputer_for_Core/main.c index 2aa6f3b..91ea817 100644 --- a/examples/MissionComputer_for_Core/main.c +++ b/examples/MissionComputer_for_Core/main.c @@ -11,6 +11,11 @@ void print_mission_track(TypeArray__tmissiontracksarray mt) { } } +/* fighterdebug(res, rdronoffclicked, iffonoffclicked) + res est le reset: mettre a 1 le premier coup puis a 0 + + */ + int main(int argc, char** argv) { int step_c; int step_max; @@ -29,9 +34,26 @@ int main(int argc, char** argv) { }; Debug__fighterdebug_reset(&_mem); + Debug__fighterdebug_step(true, false, false, &_res, &_mem); + Debug__fighterdebug_step(false, false, false, &_res, &_mem); + Debug__fighterdebug_step(false, true, false, &_res, &_mem); + Debug__fighterdebug_step(false, false, false, &_res, &_mem); + Debug__fighterdebug_step(false, false, false, &_res, &_mem); + Debug__fighterdebug_step(false, true, false, &_res, &_mem); + Debug__fighterdebug_step(false, false, true, &_res, &_mem); + Debug__fighterdebug_step(false, false, false, &_res, &_mem); + Debug__fighterdebug_step(false, false, true, &_res, &_mem); + Debug__fighterdebug_step(false, false, false, &_res, &_mem); + + printf("init:\n"); + printf("=> \n"); + print_mission_track(_res.missiontracks); + fflush(stdout); + while ((!(step_max)||(step_c \n"); print_mission_track(_res.missiontracks); - puts(""); fflush(stdout); }; return 0; diff --git a/examples/MissionComputer_for_Core/mc.ept b/examples/MissionComputer_for_Core/mc.ept index 8ace2d5..17d163c 100644 --- a/examples/MissionComputer_for_Core/mc.ept +++ b/examples/MissionComputer_for_Core/mc.ept @@ -239,7 +239,7 @@ let 0., 0., 0., 0., 0))(); *) (sloperad, speedt, x0, y0, id) = if res then createtracks_createonetrack_init_rand() - else (0.0, 0.0, 0.0, 0.0, 0) -> pre (sloperad, speedt, x0, y0, id); + else (0.0, 0.0, 0.0, 0.0, 0) fby (sloperad, speedt, x0, y0, id); l18 = y0 -> Mathext.sinr(sloperad) *. speedt +. (y0 -> pre l18); l9 = x0 -> (x0 -> pre l9) +. speedt *. Mathext.cosr(sloperad); track = { t_pos = { x = l9; y = l18 }; t_id = id };