From 1ae3f467a1d7be2fc3b1a45ba12568a3a25a0099 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 10 Jul 2012 15:11:36 -0700 Subject: [PATCH] altos: Rename *_mm.c back to *.c Was just a temporary hack to keep cc1111 products building during MM development. Signed-off-by: Keith Packard --- src/core/{ao_flight_mm.c => ao_flight.c} | 0 src/core/{ao_sample_mm.c => ao_sample.c} | 0 src/megametrum-v0.1/Makefile | 4 +-- src/product/Makefile.telemetrum | 4 +-- src/product/Makefile.telemini | 4 +-- src/product/Makefile.telenano | 2 +- src/test/Makefile | 9 ++++-- src/test/ao_flight_test.c | 35 +++++++++++++++--------- 8 files changed, 35 insertions(+), 23 deletions(-) rename src/core/{ao_flight_mm.c => ao_flight.c} (100%) rename src/core/{ao_sample_mm.c => ao_sample.c} (100%) diff --git a/src/core/ao_flight_mm.c b/src/core/ao_flight.c similarity index 100% rename from src/core/ao_flight_mm.c rename to src/core/ao_flight.c diff --git a/src/core/ao_sample_mm.c b/src/core/ao_sample.c similarity index 100% rename from src/core/ao_sample_mm.c rename to src/core/ao_sample.c diff --git a/src/megametrum-v0.1/Makefile b/src/megametrum-v0.1/Makefile index 6fc9324e..13e46c97 100644 --- a/src/megametrum-v0.1/Makefile +++ b/src/megametrum-v0.1/Makefile @@ -67,9 +67,9 @@ ALTOS_SRC = \ ao_convert_pa.c \ ao_log.c \ ao_log_mega.c \ - ao_sample_mm.c \ + ao_sample.c \ ao_kalman.c \ - ao_flight_mm.c \ + ao_flight.c \ ao_telemetry.c \ ao_packet_slave.c \ ao_packet.c \ diff --git a/src/product/Makefile.telemetrum b/src/product/Makefile.telemetrum index fba2c19a..57586c95 100644 --- a/src/product/Makefile.telemetrum +++ b/src/product/Makefile.telemetrum @@ -36,8 +36,8 @@ CORE_SRC = \ ao_stdio.c \ ao_storage.c \ ao_task.c \ - ao_flight_mm.c \ - ao_sample_mm.c \ + ao_flight.c \ + ao_sample.c \ ao_kalman.c \ ao_log.c \ ao_log_big.c \ diff --git a/src/product/Makefile.telemini b/src/product/Makefile.telemini index f0ab2b14..23aed1c7 100644 --- a/src/product/Makefile.telemini +++ b/src/product/Makefile.telemini @@ -24,14 +24,14 @@ CORE_SRC = \ ao_cmd.c \ ao_config.c \ ao_convert.c \ - ao_flight_mm.c \ + ao_flight.c \ ao_kalman.c \ ao_log.c \ ao_log_tiny.c \ ao_mutex.c \ ao_panic.c \ ao_report.c \ - ao_sample_mm.c \ + ao_sample.c \ ao_stdio.c \ ao_storage.c \ ao_task.c \ diff --git a/src/product/Makefile.telenano b/src/product/Makefile.telenano index a55bcf95..ca719bbf 100644 --- a/src/product/Makefile.telenano +++ b/src/product/Makefile.telenano @@ -31,7 +31,7 @@ CORE_SRC = \ ao_mutex.c \ ao_panic.c \ ao_report.c \ - ao_sample_mm.c \ + ao_sample.c \ ao_stdio.c \ ao_storage.c \ ao_task.c \ diff --git a/src/test/Makefile b/src/test/Makefile index 4631fb78..963f4131 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -4,7 +4,7 @@ PROGS=ao_flight_test ao_flight_test_baro ao_flight_test_accel ao_flight_test_noi KALMAN=make-kalman -CFLAGS=-I.. -I. -I../core -I../drivers -O0 -g -Wall +CFLAGS=-I.. -I. -I../core -I../drivers -O3 -g -Wall all: $(PROGS) @@ -13,10 +13,10 @@ clean: install: -ao_flight_test: ao_flight_test.c ao_host.h ao_flight_mm.c ao_sample_mm.c ao_kalman.c altitude.h ao_kalman.h +ao_flight_test: ao_flight_test.c ao_host.h ao_flight.c ao_sample.c ao_kalman.c altitude.h ao_kalman.h cc $(CFLAGS) -o $@ $< -ao_flight_test_noisy_accel: ao_flight_test.c ao_host.h ao_flight_mm.c ao_sample_mm.c ao_kalman.c altitude.h ao_kalman.h +ao_flight_test_noisy_accel: ao_flight_test.c ao_host.h ao_flight.c ao_sample.c ao_kalman.c altitude.h ao_kalman.h cc -DNOISY_ACCEL=1 $(CFLAGS) -o $@ $< ao_flight_test_baro: ao_flight_test.c ao_host.h ao_flight.c ao_sample.c ao_kalman.c altitude.h ao_kalman.h @@ -42,3 +42,6 @@ ao_kalman.h: $(KALMAN) ao_fec_test: ao_fec_test.c ao_fec_tx.c ao_fec_rx.c cc $(CFLAGS) -DAO_FEC_DEBUG=1 -o $@ ao_fec_test.c ../core/ao_fec_tx.c ../core/ao_fec_rx.c -lm + +check: ao_fec_test ao_flight_test ao_flight_test_baro run-tests + ./ao_fec_test && ./run-tests \ No newline at end of file diff --git a/src/test/ao_flight_test.c b/src/test/ao_flight_test.c index baf2ad1d..9bb03d68 100644 --- a/src/test/ao_flight_test.c +++ b/src/test/ao_flight_test.c @@ -141,7 +141,7 @@ struct ao_task { int dummy; }; -#define ao_add_task(t,f,n) +#define ao_add_task(t,f,n) ((void) (t)) #define ao_log_start() #define ao_log_stop() @@ -156,6 +156,7 @@ int ao_flight_debug; FILE *emulator_in; char *emulator_app; char *emulator_name; +char *emulator_info; double emulator_error_max = 4; double emulator_height_error_max = 20; /* noise in the baro sensor */ @@ -199,6 +200,7 @@ struct ao_config ao_config; #define DATA_TO_XDATA(x) (x) #define HAS_FLIGHT 1 +#define HAS_IGNITE 1 #define HAS_ADC 1 #define HAS_USB 1 #define HAS_GPS 1 @@ -223,8 +225,8 @@ int ao_sample_prev_tick; uint16_t prev_tick; #include "ao_kalman.c" -#include "ao_sample_mm.c" -#include "ao_flight_mm.c" +#include "ao_sample.c" +#include "ao_flight.c" #define to_double(f) ((f) / 65536.0) @@ -259,10 +261,11 @@ ao_test_exit(void) main_error = fabs(ao_test_main_height_time - main_time); landed_error = fabs(ao_test_landed_height - landed_height); landed_time_error = ao_test_landed_time - landed_time; - if (drogue_error > emulator_error_max || main_error > emulator_error_max || - landed_time_error > emulator_error_max || landed_error > emulator_height_error_max) { + if (drogue_error > emulator_error_max || main_error > emulator_error_max) { printf ("%s %s\n", emulator_app, emulator_name); + if (emulator_info) + printf ("\t%s\n", emulator_info); printf ("\tApogee error %g\n", drogue_error); printf ("\tMain error %g\n", main_error); printf ("\tLanded height error %g\n", landed_error); @@ -477,10 +480,9 @@ void ao_sleep(void *wchan) { if (wchan == &ao_data_head) { - char type; - uint16_t tick; - uint16_t a, b; - int ret; + char type = 0; + uint16_t tick = 0; + uint16_t a = 0, b = 0; uint8_t bytes[1024]; union ao_telemetry_all telem; char line[1024]; @@ -676,13 +678,15 @@ ao_dump_state(void) static const struct option options[] = { { .name = "summary", .has_arg = 0, .val = 's' }, { .name = "debug", .has_arg = 0, .val = 'd' }, + { .name = "info", .has_arg = 1, .val = 'i' }, { 0, 0, 0, 0}, }; -void run_flight_fixed(char *name, FILE *f, int summary) +void run_flight_fixed(char *name, FILE *f, int summary, char *info) { emulator_name = name; emulator_in = f; + emulator_info = info; ao_summary = summary; ao_flight_init(); ao_flight(); @@ -694,13 +698,14 @@ main (int argc, char **argv) int summary = 0; int c; int i; + char *info = NULL; #if HAS_ACCEL emulator_app="full"; #else emulator_app="baro"; #endif - while ((c = getopt_long(argc, argv, "sd", options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "sdi:", options, NULL)) != -1) { switch (c) { case 's': summary = 1; @@ -708,11 +713,14 @@ main (int argc, char **argv) case 'd': ao_flight_debug = 1; break; + case 'i': + info = optarg; + break; } } if (optind == argc) - run_flight_fixed("", stdin, summary); + run_flight_fixed("", stdin, summary, info); else for (i = optind; i < argc; i++) { FILE *f = fopen(argv[i], "r"); @@ -720,7 +728,8 @@ main (int argc, char **argv) perror(argv[i]); continue; } - run_flight_fixed(argv[i], f, summary); + run_flight_fixed(argv[i], f, summary, info); fclose(f); } + exit(0); } -- 2.30.2