From 880303b1cf1a8e44268021eb8b64e4381dd82a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Tue, 6 Sep 2011 15:01:33 +0200 Subject: [PATCH] Added a simple main for the example --- examples/MissionComputer_for_Core/build | 8 +++- examples/MissionComputer_for_Core/main.c | 52 ++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 examples/MissionComputer_for_Core/main.c diff --git a/examples/MissionComputer_for_Core/build b/examples/MissionComputer_for_Core/build index 2b6aa11..6cbc390 100755 --- a/examples/MissionComputer_for_Core/build +++ b/examples/MissionComputer_for_Core/build @@ -32,8 +32,10 @@ for f in ${sources[@]}; do $HEPTC $HEPTC_OPTIONS -target c $f done +#$HEPTC $HEPTC_OPTIONS -target c -s dv_fighterdebug debug.ept + source_dirs=(debug_c dv_c digital_c math_c mc_c trackslib_c verif_c typeBase_c typeTracks_c typeArray_c cstArrayInit_c cstBaseInit_c cstPhysics_c cstTracksInit_c mc_TypeInputs_c mc_TypeLists_c mc_TypeSensors_c) -other_files=(mathext.c mathext.h mc_ext.c mc_ext.h) +other_files=(mathext.c mathext.h mc_ext.c mc_ext.h main.c) if [ -d _build ]; then rm -r _build fi @@ -47,6 +49,8 @@ for f in ${other_files[@]}; do cp ../$f . done -$GCC $GCC_OPTIONS *.c +$GCC $GCC_OPTIONS *.c -o mission_control + +cp mission_control .. cd .. \ No newline at end of file diff --git a/examples/MissionComputer_for_Core/main.c b/examples/MissionComputer_for_Core/main.c new file mode 100644 index 0000000..2aa6f3b --- /dev/null +++ b/examples/MissionComputer_for_Core/main.c @@ -0,0 +1,52 @@ +#include +#include +#include +#include "debug.h" + +void print_mission_track(TypeArray__tmissiontracksarray mt) { + for(int i = 0; i < TypeArray__ksizemissiontracksarray; i++) { + printf("track nb %d\n", i); + printf("pos: x=%f -- y=%f \n", mt[i].m_pos.x, mt[i].m_pos.y); + printf("speed: sx=%f -- sy=%f\n", mt[i].m_speed.sx, mt[i].m_speed.sy); + } +} + +int main(int argc, char** argv) { + int step_c; + int step_max; + + Debug__fighterdebug_mem _mem; + Debug__fighterdebug_out _res; + + int res; + int rdronoffclicked; + int iffonoffclicked; + + step_c = 0; + step_max = 0; + if ((argc==2)) { + step_max = atoi(argv[1]); + }; + Debug__fighterdebug_reset(&_mem); + + while ((!(step_max)||(step_c \n"); + print_mission_track(_res.missiontracks); + puts(""); + fflush(stdout); + }; + return 0; +} +