From 5e9193f6375be27e5f7a0321fd34b6acfe81247f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 14 May 2013 09:12:29 -0700 Subject: altos: Add 'g' command to ublox GPS code. Take the gps_dump function from ao_gps_skytraq.c and move it to a new file so it can be shared with the u-blox driver. That affects every skytraq and u-blox user as they need to include the new file. Signed-off-by: Keith Packard --- src/telemega-v0.1/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'src/telemega-v0.1/Makefile') diff --git a/src/telemega-v0.1/Makefile b/src/telemega-v0.1/Makefile index a72d08f2..bf756e96 100644 --- a/src/telemega-v0.1/Makefile +++ b/src/telemega-v0.1/Makefile @@ -59,6 +59,7 @@ ALTOS_SRC = \ ao_mutex.c \ ao_serial_stm.c \ ao_gps_skytraq.c \ + ao_gps_show.c \ ao_gps_report_mega.c \ ao_ignite.c \ ao_freq.c \ -- cgit v1.2.3 From d8d3835fedf9b7c4d203f321e72c2b086ebb3b97 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 10 Oct 2013 00:00:05 -0700 Subject: altos: Use installed pdclib Switch over to the installed pdclib everywhere Signed-off-by: Keith Packard --- configure.ac | 17 +++++++++++++++-- src/easymini-v1.0/Makefile | 4 +--- src/lpc/Makefile-flash.defs | 43 +++++------------------------------------- src/lpc/Makefile-lpc.defs | 44 +++++++++++++++++++++++++++++++++++++++++++ src/lpc/Makefile.defs | 36 ++--------------------------------- src/lpcxpresso/Makefile | 2 +- src/megadongle-v0.1/Makefile | 2 +- src/stm-demo/Makefile | 2 +- src/stm-flash/Makefile | 2 +- src/stm/Makefile-flash.defs | 6 ++---- src/stm/Makefile.defs | 6 ++---- src/telegps-v0.1/Makefile | 2 +- src/telegps-v0.3/Makefile | 2 +- src/telelco-v0.1/Makefile | 2 +- src/telelco-v0.2/Makefile | 2 +- src/telemega-v0.1/Makefile | 2 +- src/telemega-v0.3/Makefile | 2 +- src/telemetrum-v2.0/Makefile | 2 +- src/telescience-v0.2/Makefile | 2 +- 19 files changed, 83 insertions(+), 97 deletions(-) create mode 100644 src/lpc/Makefile-lpc.defs (limited to 'src/telemega-v0.1/Makefile') diff --git a/configure.ac b/configure.ac index de344335..8024b7c6 100644 --- a/configure.ac +++ b/configure.ac @@ -242,22 +242,35 @@ AC_SUBST(ARM_CC) if test "x$HAVE_ARM_CC" = "xyes"; then save_CC="$CC" save_CFLAGS="$CFLAGS" + save_LIBS="$LIBS" CC="$ARM_CC" CFLAGS="-mthumb -mcpu=cortex-m0" + LIBS="-ffreestanding -nostdlib" AC_LANG_PUSH([C]) AC_MSG_CHECKING([if ]$ARM_CC[ supports cortex-m0]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int i;])], [HAVE_ARM_M0_CC=yes], [HAVE_ARM_M0_CC=no]) - AC_MSG_RESULT([$HAVE_ARM_M0]) + AC_MSG_RESULT([$HAVE_ARM_M0_CC]) + + AC_CHECK_LIB(pdclib-cortex-m0,memcpy, + [], + [HAVE_ARM_M0_CC=no]) + CFLAGS="-mthumb -mcpu=cortex-m3" AC_MSG_CHECKING([if ]$ARM_CC[ supports cortex-m3]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int i;])], [HAVE_ARM_M3_CC=yes], [HAVE_ARM_M3_CC=no]) - AC_MSG_RESULT([$HAVE_ARM_M3]) + AC_MSG_RESULT([$HAVE_ARM_M3_CC]) + + AC_CHECK_LIB(pdclib-cortex-m3,memcpy, + [], + [HAVE_ARM_M3_CC=no]) + AC_LANG_POP([C]) + LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" CC="$save_CC" else diff --git a/src/easymini-v1.0/Makefile b/src/easymini-v1.0/Makefile index ec305c94..6ab79425 100644 --- a/src/easymini-v1.0/Makefile +++ b/src/easymini-v1.0/Makefile @@ -60,10 +60,8 @@ OBJ=$(SRC:.c=.o) all: $(PROG) -LDFLAGS=-L../lpc -Wl,-Taltos.ld - $(PROG): Makefile $(OBJ) altos.ld - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) ao_product.h: ao-make-product.5c ../Version $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@ diff --git a/src/lpc/Makefile-flash.defs b/src/lpc/Makefile-flash.defs index ab7181b9..bb90b0d7 100644 --- a/src/lpc/Makefile-flash.defs +++ b/src/lpc/Makefile-flash.defs @@ -1,39 +1,4 @@ -vpath % $(TOPDIR)/lpc:$(TOPDIR)/product:$(TOPDIR)/drivers:$(TOPDIR)/core:$(TOPDIR)/util:$(TOPDIR) -vpath ao-make-product.5c $(TOPDIR)/util - -.SUFFIXES: .elf .ihx - -.elf.ihx: - objcopy -O ihex $*.elf $@ - - -ifndef VERSION -include $(TOPDIR)/Version -endif -include $(TOPDIR)/Makedefs - -CC=$(ARM_CC) -SAT=/opt/cortex -SAT_CLIB=$(SAT)/lib/pdclib-cortex-m0.a -SAT_CFLAGS=-I$(SAT)/include - -AO_CFLAGS=-I. -I$(TOPDIR)/lpc -I$(TOPDIR)/core -I$(TOPDIR)/drivers -I$(TOPDIR)/product -I$(TOPDIR) -STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m0 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS) $(SAT_CFLAGS) - -LDFLAGS=-L$(TOPDIR)/lpc -Wl,-Taltos-loader.ld - -NICKLE=nickle - -V=0 -# The user has explicitly enabled quiet compilation. -ifeq ($(V),0) -quiet = @printf " $1 $2 $@\n"; $($1) -endif -# Otherwise, print the full command line. -quiet ?= $($1) - -.c.o: - $(call quiet,CC) -c $(CFLAGS) -o $@ $< +include $(TOPDIR)/lpc/Makefile-lpc.defs INC = \ ao.h \ @@ -68,13 +33,15 @@ PRODUCT=AltosFlash-$(VERSION) PRODUCT_DEF=-DALTOS_FLASH IDPRODUCT=0x000a -CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) -g -Os +CFLAGS = $(PRODUCT_DEF) $(LPC_CFLAGS) -g -Os + +LDFLAGS=$(CFLAGS) -L$(TOPDIR)/lpc -Wl,-Taltos-loader.ld PROGNAME=altos-flash PROG=$(HARDWARE)-$(PROGNAME)-$(VERSION).elf $(PROG): Makefile $(OBJ) altos-loader.ld - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) ao_product.h: ao-make-product.5c $(TOPDIR)/Version $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@ diff --git a/src/lpc/Makefile-lpc.defs b/src/lpc/Makefile-lpc.defs new file mode 100644 index 00000000..32a02a4c --- /dev/null +++ b/src/lpc/Makefile-lpc.defs @@ -0,0 +1,44 @@ +ifndef TOPDIR +TOPDIR=.. +endif + +include $(TOPDIR)/Makedefs + +vpath % $(TOPDIR)/lpc:$(TOPDIR)/product:$(TOPDIR)/drivers:$(TOPDIR)/core:$(TOPDIR)/util:$(TOPDIR)/kalman:$(TOPDIR/aes):$(TOPDIR) +vpath make-altitude $(TOPDIR)/util +vpath make-kalman $(TOPDIR)/util +vpath kalman.5c $(TOPDIR)/kalman +vpath kalman_filter.5c $(TOPDIR)/kalman +vpath load_csv.5c $(TOPDIR)/kalman +vpath matrix.5c $(TOPDIR)/kalman +vpath ao-make-product.5c $(TOPDIR)/util + +.SUFFIXES: .elf .ihx + +.elf.ihx: + objcopy -O ihex $*.elf $@ + + +ifndef VERSION +include $(TOPDIR)/Version +endif + +CC=$(ARM_CC) + +AO_CFLAGS=-I. -I$(TOPDIR)/lpc -I$(TOPDIR)/core -I$(TOPDIR)/drivers -I$(TOPDIR)/product -I$(TOPDIR) +LPC_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m0 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS) + +NICKLE=nickle + +LIBS=-lpdclib-cortex-m0 -lgcc + +V=0 +# The user has explicitly enabled quiet compilation. +ifeq ($(V),0) +quiet = @printf " $1 $2 $@\n"; $($1) +endif +# Otherwise, print the full command line. +quiet ?= $($1) + +.c.o: + $(call quiet,CC) -c $(CFLAGS) -o $@ $< diff --git a/src/lpc/Makefile.defs b/src/lpc/Makefile.defs index d541230a..b6d739c2 100644 --- a/src/lpc/Makefile.defs +++ b/src/lpc/Makefile.defs @@ -1,43 +1,11 @@ -vpath % ../lpc:../product:../drivers:../core:../util:../kalman:../aes:.. -vpath make-altitude ../util -vpath make-kalman ../util -vpath kalman.5c ../kalman -vpath kalman_filter.5c ../kalman -vpath load_csv.5c ../kalman -vpath matrix.5c ../kalman -vpath ao-make-product.5c ../util - ifndef TOPDIR TOPDIR=.. endif -ifndef VERSION -include $(TOPDIR)/Version -endif +include $(TOPDIR)/lpc/Makefile-lpc.defs include $(TOPDIR)/Makedefs -CC=$(ARM_CC) -SAT=/opt/cortex -SAT_CLIB=$(SAT)/lib/pdclib-cortex-m0.a -SAT_CFLAGS=-I$(SAT)/include - -AO_CFLAGS=-I. -I$(TOPDIR)/lpc -I$(TOPDIR)/core -I$(TOPDIR)/drivers -I$(TOPDIR) -LPC_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m0 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS) $(SAT_CFLAGS) - -LDFLAGS=$(LPC_CFLAGS) -L$(TOPDIR)/stm -Wl,-Taltos.ld - -NICKLE=nickle - -V=0 -# The user has explicitly enabled quiet compilation. -ifeq ($(V),0) -quiet = @printf " $1 $2 $@\n"; $($1) -endif -# Otherwise, print the full command line. -quiet ?= $($1) - -.c.o: - $(call quiet,CC) -c $(CFLAGS) $< +LDFLAGS=$(CFLAGS) -L$(TOPDIR)/lpc -Wl,-Taltos.ld ao_serial_lpc.h: $(TOPDIR)/lpc/baud_rate ao_pins.h nickle $(TOPDIR)/lpc/baud_rate `awk '/AO_LPC_CLKOUT/{print $$3}' ao_pins.h` > $@ diff --git a/src/lpcxpresso/Makefile b/src/lpcxpresso/Makefile index 3745f283..374c052f 100644 --- a/src/lpcxpresso/Makefile +++ b/src/lpcxpresso/Makefile @@ -45,7 +45,7 @@ all: $(PROG) LDFLAGS=-L../lpc -Wl,-Taltos.ld $(PROG): Makefile $(OBJ) - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) ao_product.h: ao-make-product.5c ../Version $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@ diff --git a/src/megadongle-v0.1/Makefile b/src/megadongle-v0.1/Makefile index 7f12963f..268f186f 100644 --- a/src/megadongle-v0.1/Makefile +++ b/src/megadongle-v0.1/Makefile @@ -69,7 +69,7 @@ OBJ=$(SRC:.c=.o) all: $(PROG) $(PROG): Makefile $(OBJ) altos.ld - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) $(OBJ): $(INC) diff --git a/src/stm-demo/Makefile b/src/stm-demo/Makefile index 48fa07eb..990968c2 100644 --- a/src/stm-demo/Makefile +++ b/src/stm-demo/Makefile @@ -56,7 +56,7 @@ all: $(ELF) $(IHX) LDFLAGS=-L../stm -Wl,-Taltos.ld $(ELF): Makefile $(OBJ) - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJ) $(LIBS) ao_product.h: ao-make-product.5c ../Version $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@ diff --git a/src/stm-flash/Makefile b/src/stm-flash/Makefile index 1ea35581..5c0699e1 100644 --- a/src/stm-flash/Makefile +++ b/src/stm-flash/Makefile @@ -41,7 +41,7 @@ all: $(PROG) LDFLAGS=-L../stm -Wl,-Taltos-loader.ld $(PROG): Makefile $(OBJ) - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) ao_product.h: ao-make-product.5c ../Version $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@ diff --git a/src/stm/Makefile-flash.defs b/src/stm/Makefile-flash.defs index f429d9bd..159f8b9c 100644 --- a/src/stm/Makefile-flash.defs +++ b/src/stm/Makefile-flash.defs @@ -12,9 +12,7 @@ endif include $(TOPDIR)/Makedefs CC=$(ARM_CC) -SAT=/opt/cortex -SAT_CLIB=$(SAT)/lib/pdclib-cortex-m3.a -SAT_CFLAGS=-I$(SAT)/include +LIBS=-lpdclib-cortex-m3 -lgcc AO_CFLAGS=-I. -I$(TOPDIR)/stm -I$(TOPDIR)/core -I$(TOPDIR)/drivers -I$(TOPDIR)/product -I$(TOPDIR) STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS) $(SAT_CFLAGS) @@ -73,7 +71,7 @@ PROGNAME=altos-flash PROG=$(HARDWARE)-$(PROGNAME)-$(VERSION).elf $(PROG): Makefile $(OBJ) altos-loader.ld - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) ao_product.h: ao-make-product.5c $(TOPDIR)/Version $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@ diff --git a/src/stm/Makefile.defs b/src/stm/Makefile.defs index ede75f80..ee1cb658 100644 --- a/src/stm/Makefile.defs +++ b/src/stm/Makefile.defs @@ -22,12 +22,10 @@ endif include $(TOPDIR)/Makedefs CC=$(ARM_CC) -SAT=/opt/cortex -SAT_CLIB=$(SAT)/lib/pdclib-cortex-m3.a -SAT_CFLAGS=-I$(SAT)/include +LIBS=-lpdclib-cortex-m3 -lgcc AO_CFLAGS=-I. -I../stm -I../core -I../drivers -I.. -STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS) $(SAT_CFLAGS) +STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS) LDFLAGS=-L../stm -Wl,-Taltos.ld diff --git a/src/telegps-v0.1/Makefile b/src/telegps-v0.1/Makefile index 64deddc6..170294e6 100644 --- a/src/telegps-v0.1/Makefile +++ b/src/telegps-v0.1/Makefile @@ -82,7 +82,7 @@ OBJ=$(SRC:.c=.o) all: $(PROG) $(PROG): Makefile $(OBJ) altos.ld - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) $(OBJ): $(INC) diff --git a/src/telegps-v0.3/Makefile b/src/telegps-v0.3/Makefile index ca7d7c2b..d129d295 100644 --- a/src/telegps-v0.3/Makefile +++ b/src/telegps-v0.3/Makefile @@ -66,7 +66,7 @@ all: $(PROG) LDFLAGS=-L../lpc -Wl,-Taltos.ld $(PROG): Makefile $(OBJ) altos.ld - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) $(OBJ): $(INC) diff --git a/src/telelco-v0.1/Makefile b/src/telelco-v0.1/Makefile index 24083308..0f61788c 100644 --- a/src/telelco-v0.1/Makefile +++ b/src/telelco-v0.1/Makefile @@ -76,7 +76,7 @@ OBJ=$(SRC:.c=.o) all: $(PROG) $(PROG): Makefile $(OBJ) altos.ld - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) ../altitude.h: make-altitude nickle $< > $@ diff --git a/src/telelco-v0.2/Makefile b/src/telelco-v0.2/Makefile index f78ca9e2..bc5f8571 100644 --- a/src/telelco-v0.2/Makefile +++ b/src/telelco-v0.2/Makefile @@ -85,7 +85,7 @@ OBJ=$(SRC:.c=.o) all: $(PROG) $(PROG): Makefile $(OBJ) altos.ld - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) ../altitude.h: make-altitude nickle $< > $@ diff --git a/src/telemega-v0.1/Makefile b/src/telemega-v0.1/Makefile index bf756e96..bbf46f3c 100644 --- a/src/telemega-v0.1/Makefile +++ b/src/telemega-v0.1/Makefile @@ -112,7 +112,7 @@ OBJ=$(SRC:.c=.o) all: $(PROG) $(PROG): Makefile $(OBJ) altos.ld - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) ../altitude-pa.h: make-altitude-pa nickle $< > $@ diff --git a/src/telemega-v0.3/Makefile b/src/telemega-v0.3/Makefile index f2c0625f..6e5da721 100644 --- a/src/telemega-v0.3/Makefile +++ b/src/telemega-v0.3/Makefile @@ -112,7 +112,7 @@ OBJ=$(SRC:.c=.o) all: $(PROG) $(PROG): Makefile $(OBJ) altos.ld - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) ../altitude-pa.h: make-altitude-pa nickle $< > $@ diff --git a/src/telemetrum-v2.0/Makefile b/src/telemetrum-v2.0/Makefile index c03a5539..be72d493 100644 --- a/src/telemetrum-v2.0/Makefile +++ b/src/telemetrum-v2.0/Makefile @@ -101,7 +101,7 @@ OBJ=$(SRC:.c=.o) all: $(PROG) $(PROG): Makefile $(OBJ) altos.ld - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) ../altitude-pa.h: make-altitude-pa nickle $< > $@ diff --git a/src/telescience-v0.2/Makefile b/src/telescience-v0.2/Makefile index f16ef268..c53a6cc3 100644 --- a/src/telescience-v0.2/Makefile +++ b/src/telescience-v0.2/Makefile @@ -68,7 +68,7 @@ OBJ=$(SRC:.c=.o) all: $(PROG) $(PROG): Makefile $(OBJ) altos.ld - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) $(OBJ): $(INC) -- cgit v1.2.3 From e838bd2847e5684ce93b6f7cbe736ebed681c3c6 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 27 Oct 2013 23:46:54 -0700 Subject: altos: Make telemega v0.1 compile with new quaternion code Adds the necessary math code Signed-off-by: Keith Packard --- src/telemega-v0.1/Makefile | 17 +++++++++++++++++ src/telemega-v0.1/ao_pins.h | 2 -- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src/telemega-v0.1/Makefile') diff --git a/src/telemega-v0.1/Makefile b/src/telemega-v0.1/Makefile index bbf46f3c..7acaedd2 100644 --- a/src/telemega-v0.1/Makefile +++ b/src/telemega-v0.1/Makefile @@ -25,6 +25,8 @@ INC = \ ao_task.h \ ao_whiten.h \ ao_sample_profile.h \ + ao_quaternion.h \ + math.h \ ao_mpu.h \ stm32l.h \ Makefile @@ -44,6 +46,20 @@ INC = \ #STACK_GUARD=ao_mpu_stm.c #STACK_GUARD_DEF=-DHAS_STACK_GUARD=1 +MATH_SRC=\ + ef_acos.c \ + ef_sqrt.c \ + ef_rem_pio2.c \ + kf_cos.c \ + kf_sin.c \ + kf_rem_pio2.c \ + sf_copysign.c \ + sf_cos.c \ + sf_sin.c \ + sf_fabs.c \ + sf_floor.c \ + sf_scalbn.c + ALTOS_SRC = \ ao_boot_chain.c \ ao_interrupt.c \ @@ -95,6 +111,7 @@ ALTOS_SRC = \ ao_aprs.c \ $(PROFILE) \ $(SAMPLE_PROFILE) \ + $(MATH_SRC) \ $(STACK_GUARD) PRODUCT=TeleMega-v0.1 diff --git a/src/telemega-v0.1/ao_pins.h b/src/telemega-v0.1/ao_pins.h index 78e887c3..11934bd2 100644 --- a/src/telemega-v0.1/ao_pins.h +++ b/src/telemega-v0.1/ao_pins.h @@ -319,8 +319,6 @@ struct ao_adc { #define AO_MPU6000_INT_PIN 13 #define AO_MPU6000_I2C_INDEX STM_I2C_INDEX(1) -#define HAS_HIGHG_ACCEL 0 - /* * mma655x */ -- cgit v1.2.3 From 52b19511222980138faddb2047707baceff0a596 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 8 Dec 2013 11:14:29 -0800 Subject: altos: Build .ihx files for all arm projects The .ihx version can be processed by the java loader Signed-off-by: Keith Packard --- src/easymini-v1.0/Makefile | 5 +++-- src/lpc/Makefile-lpc.defs | 3 ++- src/megadongle-v0.1/Makefile | 3 ++- src/stm/Makefile.defs | 3 ++- src/telegps-v0.1/Makefile | 3 ++- src/telelco-v0.1/Makefile | 3 ++- src/telelco-v0.2/Makefile | 3 ++- src/telemega-v0.1/Makefile | 3 ++- src/telemega-v0.3/Makefile | 3 ++- src/telemetrum-v2.0/Makefile | 3 ++- src/telescience-v0.2/Makefile | 3 ++- 11 files changed, 23 insertions(+), 12 deletions(-) (limited to 'src/telemega-v0.1/Makefile') diff --git a/src/easymini-v1.0/Makefile b/src/easymini-v1.0/Makefile index 6ab79425..8042874f 100644 --- a/src/easymini-v1.0/Makefile +++ b/src/easymini-v1.0/Makefile @@ -54,11 +54,12 @@ CFLAGS = $(PRODUCT_DEF) $(LPC_CFLAGS) -g -Os PROGNAME=easymini-v1.0 PROG=$(PROGNAME)-$(VERSION).elf +HEX=$(PROGNAME)-$(VERSION).ihx SRC=$(ALTOS_SRC) ao_easymini.c OBJ=$(SRC:.c=.o) -all: $(PROG) +all: $(PROG) $(HEX) $(PROG): Makefile $(OBJ) altos.ld $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) @@ -74,7 +75,7 @@ load: $(PROG) distclean: clean clean: - rm -f *.o $(PROG) + rm -f *.o $(PROGNAME)-*.elf rm -f ao_product.h install: diff --git a/src/lpc/Makefile-lpc.defs b/src/lpc/Makefile-lpc.defs index 32a02a4c..fbd413b0 100644 --- a/src/lpc/Makefile-lpc.defs +++ b/src/lpc/Makefile-lpc.defs @@ -16,13 +16,14 @@ vpath ao-make-product.5c $(TOPDIR)/util .SUFFIXES: .elf .ihx .elf.ihx: - objcopy -O ihex $*.elf $@ + $(ELFTOHEX) --output=$@ $*.elf ifndef VERSION include $(TOPDIR)/Version endif +ELFTOHEX=$(TOPDIR)/../ao-tools/ao-elftohex/ao-elftohex CC=$(ARM_CC) AO_CFLAGS=-I. -I$(TOPDIR)/lpc -I$(TOPDIR)/core -I$(TOPDIR)/drivers -I$(TOPDIR)/product -I$(TOPDIR) diff --git a/src/megadongle-v0.1/Makefile b/src/megadongle-v0.1/Makefile index 268f186f..a8c3a584 100644 --- a/src/megadongle-v0.1/Makefile +++ b/src/megadongle-v0.1/Makefile @@ -62,11 +62,12 @@ CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) $(PROFILE_DEF) $(SAMPLE_PROFILE_DEF) $(STA PROGNAME=megadongle-v0.1 PROG=$(PROGNAME)-$(VERSION).elf +HEX=$(PROGNAME)-$(VERSION).ihx SRC=$(ALTOS_SRC) ao_megadongle.c OBJ=$(SRC:.c=.o) -all: $(PROG) +all: $(PROG) $(HEX) $(PROG): Makefile $(OBJ) altos.ld $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) diff --git a/src/stm/Makefile.defs b/src/stm/Makefile.defs index 0710d747..b1998f93 100644 --- a/src/stm/Makefile.defs +++ b/src/stm/Makefile.defs @@ -10,7 +10,7 @@ vpath ao-make-product.5c ../util .SUFFIXES: .elf .ihx .elf.ihx: - objcopy -O ihex $*.elf $@ + $(ELFTOHEX) --output=$@ $*.elf ifndef TOPDIR TOPDIR=.. @@ -30,6 +30,7 @@ STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -no LDFLAGS=-L../stm -Wl,-Taltos.ld NICKLE=nickle +ELFTOHEX=$(TOPDIR)/../ao-tools/ao-elftohex/ao-elftohex V=0 # The user has explicitly enabled quiet compilation. diff --git a/src/telegps-v0.1/Makefile b/src/telegps-v0.1/Makefile index f5533d51..96366cfc 100644 --- a/src/telegps-v0.1/Makefile +++ b/src/telegps-v0.1/Makefile @@ -74,11 +74,12 @@ CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) $(PROFILE_DEF) $(SAMPLE_PROFILE_DEF) $(STA PROGNAME=telegps-v0.1 PROG=$(PROGNAME)-$(VERSION).elf +HEX=$(PROGNAME)-$(VERSION).ihx SRC=$(ALTOS_SRC) ao_telegps.c OBJ=$(SRC:.c=.o) -all: $(PROG) +all: $(PROG) $(HEX) $(PROG): Makefile $(OBJ) altos.ld $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) diff --git a/src/telelco-v0.1/Makefile b/src/telelco-v0.1/Makefile index 0f61788c..e494403c 100644 --- a/src/telelco-v0.1/Makefile +++ b/src/telelco-v0.1/Makefile @@ -69,11 +69,12 @@ CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) $(PROFILE_DEF) -Os -g PROGNAME=telelco-v0.1 PROG=$(PROGNAME)-$(VERSION).elf +HEX=$(PROGNAME)-$(VERSION).ihx SRC=$(ALTOS_SRC) ao_telelco.c OBJ=$(SRC:.c=.o) -all: $(PROG) +all: $(PROG) $(HEX) $(PROG): Makefile $(OBJ) altos.ld $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) diff --git a/src/telelco-v0.2/Makefile b/src/telelco-v0.2/Makefile index 2fb4db5e..32cf7edd 100644 --- a/src/telelco-v0.2/Makefile +++ b/src/telelco-v0.2/Makefile @@ -77,11 +77,12 @@ CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) $(PROFILE_DEF) -Os -g PROGNAME=telelco-v0.2 PROG=$(PROGNAME)-$(VERSION).elf +HEX=$(PROGNAME)-$(VERSION).ihx SRC=$(ALTOS_SRC) ao_telelco.c OBJ=$(SRC:.c=.o) -all: $(PROG) +all: $(PROG) $(HEX) $(PROG): Makefile $(OBJ) altos.ld $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) diff --git a/src/telemega-v0.1/Makefile b/src/telemega-v0.1/Makefile index 7acaedd2..0166ebc9 100644 --- a/src/telemega-v0.1/Makefile +++ b/src/telemega-v0.1/Makefile @@ -122,11 +122,12 @@ CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) $(PROFILE_DEF) $(SAMPLE_PROFILE_DEF) $(STA PROGNAME=telemega-v0.1 PROG=$(PROGNAME)-$(VERSION).elf +HEX=$(PROGNAME)-$(VERSION).ihx SRC=$(ALTOS_SRC) ao_telemega.c OBJ=$(SRC:.c=.o) -all: $(PROG) +all: $(PROG) $(HEX) $(PROG): Makefile $(OBJ) altos.ld $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) diff --git a/src/telemega-v0.3/Makefile b/src/telemega-v0.3/Makefile index a25b8b68..12e4152c 100644 --- a/src/telemega-v0.3/Makefile +++ b/src/telemega-v0.3/Makefile @@ -124,11 +124,12 @@ CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) $(PROFILE_DEF) $(SAMPLE_PROFILE_DEF) $(STA PROGNAME=telemega-v0.3 PROG=$(PROGNAME)-$(VERSION).elf +HEX=$(PROGNAME)-$(VERSION).ihx SRC=$(ALTOS_SRC) ao_telemega.c OBJ=$(SRC:.c=.o) -all: $(PROG) +all: $(PROG) $(HEX) $(PROG): Makefile $(OBJ) altos.ld $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) diff --git a/src/telemetrum-v2.0/Makefile b/src/telemetrum-v2.0/Makefile index a5370224..16408b03 100644 --- a/src/telemetrum-v2.0/Makefile +++ b/src/telemetrum-v2.0/Makefile @@ -95,11 +95,12 @@ CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) $(PROFILE_DEF) $(SAMPLE_PROFILE_DEF) $(STA PROGNAME=telemetrum-v2.0 PROG=$(PROGNAME)-$(VERSION).elf +HEX=$(PROGNAME)-$(VERSION).ihx SRC=$(ALTOS_SRC) ao_telemetrum.c OBJ=$(SRC:.c=.o) -all: $(PROG) +all: $(PROG) $(HEX) $(PROG): Makefile $(OBJ) altos.ld $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) diff --git a/src/telescience-v0.2/Makefile b/src/telescience-v0.2/Makefile index c53a6cc3..d76183c5 100644 --- a/src/telescience-v0.2/Makefile +++ b/src/telescience-v0.2/Makefile @@ -61,11 +61,12 @@ CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) $(PROFILE_DEF) $(SAMPLE_PROFILE_DEF) $(STA PROGNAME=telescience-v0.2 PROG=$(PROGNAME)-$(VERSION).elf +HEX=$(PROGNAME)-$(VERSION).ihx SRC=$(ALTOS_SRC) ao_telescience.c OBJ=$(SRC:.c=.o) -all: $(PROG) +all: $(PROG) $(HEX) $(PROG): Makefile $(OBJ) altos.ld $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) -- cgit v1.2.3 From a4596c134aa5e7867f1ca1d86d36afb2af9b8999 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 10 Dec 2013 00:39:52 -0800 Subject: altos: Remove ARM .ihx files on 'make clean' Signed-off-by: Keith Packard --- src/easymini-v1.0/Makefile | 2 +- src/megadongle-v0.1/Makefile | 2 +- src/stm-demo/Makefile | 2 +- src/telegps-v0.1/Makefile | 2 +- src/telegps-v0.3/Makefile | 2 +- src/telelco-v0.1/Makefile | 2 +- src/telelco-v0.2/Makefile | 2 +- src/telemega-v0.1/Makefile | 2 +- src/telemega-v1.0/Makefile | 2 +- src/telemetrum-v2.0/Makefile | 2 +- src/telescience-v0.2/Makefile | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/telemega-v0.1/Makefile') diff --git a/src/easymini-v1.0/Makefile b/src/easymini-v1.0/Makefile index 8042874f..7dae2692 100644 --- a/src/easymini-v1.0/Makefile +++ b/src/easymini-v1.0/Makefile @@ -75,7 +75,7 @@ load: $(PROG) distclean: clean clean: - rm -f *.o $(PROGNAME)-*.elf + rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.ihx rm -f ao_product.h install: diff --git a/src/megadongle-v0.1/Makefile b/src/megadongle-v0.1/Makefile index a8c3a584..6035c348 100644 --- a/src/megadongle-v0.1/Makefile +++ b/src/megadongle-v0.1/Makefile @@ -80,7 +80,7 @@ ao_product.h: ao-make-product.5c ../Version distclean: clean clean: - rm -f *.o $(PROGNAME)-*.elf + rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.ihx rm -f ao_product.h install: diff --git a/src/stm-demo/Makefile b/src/stm-demo/Makefile index 2c7e9df5..98fcd9e5 100644 --- a/src/stm-demo/Makefile +++ b/src/stm-demo/Makefile @@ -66,7 +66,7 @@ $(OBJ): $(INC) distclean: clean clean: - rm -f *.o stm-demo-*.elf + rm -f *.o *.elf *.ihx rm -f ao_product.h install: diff --git a/src/telegps-v0.1/Makefile b/src/telegps-v0.1/Makefile index 96366cfc..49e325ac 100644 --- a/src/telegps-v0.1/Makefile +++ b/src/telegps-v0.1/Makefile @@ -92,7 +92,7 @@ ao_product.h: ao-make-product.5c ../Version distclean: clean clean: - rm -f *.o $(PROGNAME)-*.elf + rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.ihx rm -f ao_product.h install: diff --git a/src/telegps-v0.3/Makefile b/src/telegps-v0.3/Makefile index d129d295..bb9c8c64 100644 --- a/src/telegps-v0.3/Makefile +++ b/src/telegps-v0.3/Makefile @@ -76,7 +76,7 @@ ao_product.h: ao-make-product.5c ../Version distclean: clean clean: - rm -f *.o ao_serial_lpc.h $(PROGNAME)-*.elf + rm -f *.o ao_serial_lpc.h $(PROGNAME)-*.elf $(PROGNAME)-*.ihx rm -f ao_product.h install: diff --git a/src/telelco-v0.1/Makefile b/src/telelco-v0.1/Makefile index e494403c..44d9237f 100644 --- a/src/telelco-v0.1/Makefile +++ b/src/telelco-v0.1/Makefile @@ -90,7 +90,7 @@ ao_product.h: ao-make-product.5c ../Version distclean: clean clean: - rm -f *.o $(PROGNAME)-*.elf + rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.ihx rm -f ao_product.h install: diff --git a/src/telelco-v0.2/Makefile b/src/telelco-v0.2/Makefile index 32cf7edd..f28bdd32 100644 --- a/src/telelco-v0.2/Makefile +++ b/src/telelco-v0.2/Makefile @@ -98,7 +98,7 @@ ao_product.h: ao-make-product.5c ../Version distclean: clean clean: - rm -f *.o $(PROGNAME)-*.elf + rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.ihx rm -f ao_product.h install: diff --git a/src/telemega-v0.1/Makefile b/src/telemega-v0.1/Makefile index 0166ebc9..26afa38d 100644 --- a/src/telemega-v0.1/Makefile +++ b/src/telemega-v0.1/Makefile @@ -143,7 +143,7 @@ ao_product.h: ao-make-product.5c ../Version distclean: clean clean: - rm -f *.o $(PROGNAME)-*.elf + rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.ihx rm -f ao_product.h install: diff --git a/src/telemega-v1.0/Makefile b/src/telemega-v1.0/Makefile index e3204c11..543f7e74 100644 --- a/src/telemega-v1.0/Makefile +++ b/src/telemega-v1.0/Makefile @@ -145,7 +145,7 @@ ao_product.h: ao-make-product.5c ../Version distclean: clean clean: - rm -f *.o $(PROGNAME)-*.elf + rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.ihx rm -f ao_product.h install: diff --git a/src/telemetrum-v2.0/Makefile b/src/telemetrum-v2.0/Makefile index 16408b03..cebc9cab 100644 --- a/src/telemetrum-v2.0/Makefile +++ b/src/telemetrum-v2.0/Makefile @@ -116,7 +116,7 @@ ao_product.h: ao-make-product.5c ../Version distclean: clean clean: - rm -f *.o $(PROGNAME)-*.elf + rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.ihx rm -f ao_product.h install: diff --git a/src/telescience-v0.2/Makefile b/src/telescience-v0.2/Makefile index d76183c5..6b7ea8c7 100644 --- a/src/telescience-v0.2/Makefile +++ b/src/telescience-v0.2/Makefile @@ -79,7 +79,7 @@ ao_product.h: ao-make-product.5c ../Version distclean: clean clean: - rm -f *.o $(PROGNAME)-*.elf + rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.ihx rm -f ao_product.h install: -- cgit v1.2.3 From 18852efa108ba6e6e69dfd5076d4f4c01f62b4ef Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 18 Dec 2013 01:12:11 -0800 Subject: altos: Make TeleMega v0.1 work more like TeleMega v1.0 I've still got one working v0.1 board which is useful for testing stuff, so make it work more like the released TeleMega: * Use E for drogue, F for main * Use on-chip eeprom for config * Fix ADC report printf to match Signed-off-by: Keith Packard --- src/telemega-v0.1/Makefile | 3 +- src/telemega-v0.1/ao_pins.h | 98 ++++++++++++++++++++--------------------- src/telemega-v0.1/ao_telemega.c | 2 + 3 files changed, 52 insertions(+), 51 deletions(-) (limited to 'src/telemega-v0.1/Makefile') diff --git a/src/telemega-v0.1/Makefile b/src/telemega-v0.1/Makefile index 26afa38d..0145f49c 100644 --- a/src/telemega-v0.1/Makefile +++ b/src/telemega-v0.1/Makefile @@ -90,6 +90,7 @@ ALTOS_SRC = \ ao_hmc5883.c \ ao_adc_stm.c \ ao_beep_stm.c \ + ao_eeprom_stm.c \ ao_storage.c \ ao_m25.c \ ao_usb_stm.c \ @@ -109,9 +110,9 @@ ALTOS_SRC = \ ao_companion.c \ ao_pyro.c \ ao_aprs.c \ + $(MATH_SRC) \ $(PROFILE) \ $(SAMPLE_PROFILE) \ - $(MATH_SRC) \ $(STACK_GUARD) PRODUCT=TeleMega-v0.1 diff --git a/src/telemega-v0.1/ao_pins.h b/src/telemega-v0.1/ao_pins.h index 11934bd2..7ba3a1a7 100644 --- a/src/telemega-v0.1/ao_pins.h +++ b/src/telemega-v0.1/ao_pins.h @@ -64,8 +64,11 @@ #define ao_gps_set_speed ao_serial3_set_speed #define ao_gps_fifo (ao_stm_usart3.rx_fifo) +#define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX (1024 * 1024) #define HAS_EEPROM 1 #define USE_INTERNAL_FLASH 0 +#define USE_EEPROM_CONFIG 1 +#define USE_STORAGE_CONFIG 0 #define HAS_USB 1 #define HAS_BEEP 1 #define HAS_RADIO 1 @@ -111,6 +114,7 @@ #define HAS_GPS 1 #define HAS_FLIGHT 1 #define HAS_ADC 1 +#define HAS_ADC_TEMP 1 #define HAS_LOG 1 /* @@ -120,34 +124,39 @@ #define HAS_IGNITE 1 #define HAS_IGNITE_REPORT 1 -#define AO_SENSE_DROGUE(p) ((p)->adc.sense[0]) -#define AO_SENSE_MAIN(p) ((p)->adc.sense[1]) +#define AO_SENSE_PYRO(p,n) ((p)->adc.sense[n]) +#define AO_SENSE_DROGUE(p) ((p)->adc.sense[4]) +#define AO_SENSE_MAIN(p) ((p)->adc.sense[5]) #define AO_IGNITER_CLOSED 400 #define AO_IGNITER_OPEN 60 -#define AO_IGNITER_DROGUE_PORT (&stm_gpiod) -#define AO_IGNITER_DROGUE_PIN 6 +/* Pyro A */ +#define AO_PYRO_PORT_0 (&stm_gpiod) +#define AO_PYRO_PIN_0 6 -#define AO_IGNITER_MAIN_PORT (&stm_gpiod) -#define AO_IGNITER_MAIN_PIN 7 +/* Pyro B */ +#define AO_PYRO_PORT_1 (&stm_gpiod) +#define AO_PYRO_PIN_1 7 -#define AO_PYRO_PORT_0 (&stm_gpiob) -#define AO_PYRO_PIN_0 5 +/* Pyro C */ +#define AO_PYRO_PORT_2 (&stm_gpiob) +#define AO_PYRO_PIN_2 5 -#define AO_PYRO_PORT_1 (&stm_gpioe) -#define AO_PYRO_PIN_1 4 +/* Pyro D */ +#define AO_PYRO_PORT_3 (&stm_gpioe) +#define AO_PYRO_PIN_3 4 -#define AO_PYRO_PORT_2 (&stm_gpioe) -#define AO_PYRO_PIN_2 6 +/* Drogue */ +#define AO_IGNITER_DROGUE_PORT (&stm_gpioe) +#define AO_IGNITER_DROGUE_PIN 6 -#define AO_PYRO_PORT_3 (&stm_gpioe) -#define AO_PYRO_PIN_3 5 +/* Main */ +#define AO_IGNITER_MAIN_PORT (&stm_gpioe) +#define AO_IGNITER_MAIN_PIN 5 /* Number of general purpose pyro channels available */ #define AO_PYRO_NUM 4 -#define AO_SENSE_PYRO(a,p) ((a)->adc.sense[(p) + 2]) - #define AO_IGNITER_SET_DROGUE(v) stm_gpio_set(AO_IGNITER_DROGUE_PORT, AO_IGNITER_DROGUE_PIN, v) #define AO_IGNITER_SET_MAIN(v) stm_gpio_set(AO_IGNITER_MAIN_PORT, AO_IGNITER_MAIN_PIN, v) @@ -161,11 +170,16 @@ struct ao_adc { int16_t sense[AO_ADC_NUM_SENSE]; int16_t v_batt; int16_t v_pbatt; - int16_t accel_ref; - int16_t accel; int16_t temp; }; +#define AO_ADC_DUMP(p) \ + printf("tick: %5u A: %5d B: %5d C: %5d D: %5d drogue: %5d main: %5d batt: %5d pbatt: %5d temp: %5d\n", \ + (p)->tick, \ + (p)->adc.sense[0], (p)->adc.sense[1], (p)->adc.sense[2], \ + (p)->adc.sense[3], (p)->adc.sense[4], (p)->adc.sense[5], \ + (p)->adc.v_batt, (p)->adc.v_pbatt, (p)->adc.temp) + #define AO_ADC_SENSE_A 0 #define AO_ADC_SENSE_A_PORT (&stm_gpioa) #define AO_ADC_SENSE_A_PIN 0 @@ -182,13 +196,13 @@ struct ao_adc { #define AO_ADC_SENSE_D_PORT (&stm_gpioa) #define AO_ADC_SENSE_D_PIN 3 -#define AO_ADC_SENSE_E 4 -#define AO_ADC_SENSE_E_PORT (&stm_gpioa) -#define AO_ADC_SENSE_E_PIN 4 +#define AO_ADC_SENSE_DROGUE 4 +#define AO_ADC_SENSE_DROGUE_PORT (&stm_gpioa) +#define AO_ADC_SENSE_DROGUE_PIN 4 -#define AO_ADC_SENSE_F 22 -#define AO_ADC_SENSE_F_PORT (&stm_gpioe) -#define AO_ADC_SENSE_F_PIN 7 +#define AO_ADC_SENSE_MAIN 22 +#define AO_ADC_SENSE_MAIN_PORT (&stm_gpioe) +#define AO_ADC_SENSE_MAIN_PIN 7 #define AO_ADC_V_BATT 8 #define AO_ADC_V_BATT_PORT (&stm_gpiob) @@ -198,22 +212,13 @@ struct ao_adc { #define AO_ADC_V_PBATT_PORT (&stm_gpiob) #define AO_ADC_V_PBATT_PIN 1 -#define AO_ADC_ACCEL_REF 10 -#define AO_ADC_ACCEL_REF_PORT (&stm_gpioc) -#define AO_ADC_ACCEL_REF_PIN 0 - -#define AO_ADC_ACCEL 11 -#define AO_ADC_ACCEL_PORT (&stm_gpioc) -#define AO_ADC_ACCEL_PIN 1 - #define AO_ADC_TEMP 16 #define AO_ADC_RCC_AHBENR ((1 << STM_RCC_AHBENR_GPIOAEN) | \ (1 << STM_RCC_AHBENR_GPIOEEN) | \ - (1 << STM_RCC_AHBENR_GPIOBEN) | \ - (1 << STM_RCC_AHBENR_GPIOCEN)) + (1 << STM_RCC_AHBENR_GPIOBEN)) -#define AO_NUM_ADC_PIN (AO_ADC_NUM_SENSE + 4) +#define AO_NUM_ADC_PIN (AO_ADC_NUM_SENSE + 2) #define AO_ADC_PIN0_PORT AO_ADC_SENSE_A_PORT #define AO_ADC_PIN0_PIN AO_ADC_SENSE_A_PIN @@ -223,32 +228,26 @@ struct ao_adc { #define AO_ADC_PIN2_PIN AO_ADC_SENSE_C_PIN #define AO_ADC_PIN3_PORT AO_ADC_SENSE_D_PORT #define AO_ADC_PIN3_PIN AO_ADC_SENSE_D_PIN -#define AO_ADC_PIN4_PORT AO_ADC_SENSE_E_PORT -#define AO_ADC_PIN4_PIN AO_ADC_SENSE_E_PIN -#define AO_ADC_PIN5_PORT AO_ADC_SENSE_F_PORT -#define AO_ADC_PIN5_PIN AO_ADC_SENSE_F_PIN +#define AO_ADC_PIN4_PORT AO_ADC_SENSE_DROGUE_PORT +#define AO_ADC_PIN4_PIN AO_ADC_SENSE_DROGUE_PIN +#define AO_ADC_PIN5_PORT AO_ADC_SENSE_MAIN_PORT +#define AO_ADC_PIN5_PIN AO_ADC_SENSE_MAIN_PIN #define AO_ADC_PIN6_PORT AO_ADC_V_BATT_PORT #define AO_ADC_PIN6_PIN AO_ADC_V_BATT_PIN #define AO_ADC_PIN7_PORT AO_ADC_V_PBATT_PORT #define AO_ADC_PIN7_PIN AO_ADC_V_PBATT_PIN -#define AO_ADC_PIN8_PORT AO_ADC_ACCEL_REF_PORT -#define AO_ADC_PIN8_PIN AO_ADC_ACCEL_REF_PIN -#define AO_ADC_PIN9_PORT AO_ADC_ACCEL_PORT -#define AO_ADC_PIN9_PIN AO_ADC_ACCEL_PIN -#define AO_NUM_ADC (AO_ADC_NUM_SENSE + 5) +#define AO_NUM_ADC (AO_ADC_NUM_SENSE + 3) #define AO_ADC_SQ1 AO_ADC_SENSE_A #define AO_ADC_SQ2 AO_ADC_SENSE_B #define AO_ADC_SQ3 AO_ADC_SENSE_C #define AO_ADC_SQ4 AO_ADC_SENSE_D -#define AO_ADC_SQ5 AO_ADC_SENSE_E -#define AO_ADC_SQ6 AO_ADC_SENSE_F +#define AO_ADC_SQ5 AO_ADC_SENSE_DROGUE +#define AO_ADC_SQ6 AO_ADC_SENSE_MAIN #define AO_ADC_SQ7 AO_ADC_V_BATT #define AO_ADC_SQ8 AO_ADC_V_PBATT -#define AO_ADC_SQ9 AO_ADC_ACCEL_REF -#define AO_ADC_SQ10 AO_ADC_ACCEL -#define AO_ADC_SQ11 AO_ADC_TEMP +#define AO_ADC_SQ9 AO_ADC_TEMP /* * Pressure sensor settings @@ -298,7 +297,6 @@ struct ao_adc { #define AO_CC1120_MARC_GPIO 3 #define AO_CC1120_MARC_GPIO_IOCFG CC1120_IOCFG3 - #define HAS_BOOT_RADIO 0 /* diff --git a/src/telemega-v0.1/ao_telemega.c b/src/telemega-v0.1/ao_telemega.c index fbdab64a..7b035269 100644 --- a/src/telemega-v0.1/ao_telemega.c +++ b/src/telemega-v0.1/ao_telemega.c @@ -24,6 +24,7 @@ #include #include #include +#include #if HAS_SAMPLE_PROFILE #include #endif @@ -71,6 +72,7 @@ main(void) ao_mma655x_init(); #endif + ao_eeprom_init(); ao_storage_init(); ao_flight_init(); -- cgit v1.2.3