summaryrefslogtreecommitdiff
path: root/src/lpc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lpc')
-rw-r--r--src/lpc/Makefile-flash.defs10
-rw-r--r--src/lpc/Makefile.defs27
-rw-r--r--src/lpc/ao_arch_funcs.h1
3 files changed, 22 insertions, 16 deletions
diff --git a/src/lpc/Makefile-flash.defs b/src/lpc/Makefile-flash.defs
index 6bdd204c..ab7181b9 100644
--- a/src/lpc/Makefile-flash.defs
+++ b/src/lpc/Makefile-flash.defs
@@ -6,14 +6,16 @@ vpath ao-make-product.5c $(TOPDIR)/util
.elf.ihx:
objcopy -O ihex $*.elf $@
-CC=arm-none-eabi-gcc
-SAT=/opt/cortex
-SAT_CLIB=$(SAT)/lib/pdclib-cortex-m0.a
-SAT_CFLAGS=-I$(SAT)/include
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)
diff --git a/src/lpc/Makefile.defs b/src/lpc/Makefile.defs
index 9e87cee1..d541230a 100644
--- a/src/lpc/Makefile.defs
+++ b/src/lpc/Makefile.defs
@@ -7,21 +7,24 @@ vpath load_csv.5c ../kalman
vpath matrix.5c ../kalman
vpath ao-make-product.5c ../util
-CC=/usr/bin/arm-none-eabi-gcc
-SAT=/opt/cortex
-SAT_CLIB=$(SAT)/lib/pdclib-cortex-m0.a
-SAT_CFLAGS=-I$(SAT)/include
-
-#CC=/opt/arm-gcc-bits/bin/arm-none-eabi-gcc
+ifndef TOPDIR
+TOPDIR=..
+endif
ifndef VERSION
-include ../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../lpc -I../core -I../drivers -I..
+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=-L../stm -Wl,-Taltos.ld
+LDFLAGS=$(LPC_CFLAGS) -L$(TOPDIR)/stm -Wl,-Taltos.ld
NICKLE=nickle
@@ -34,10 +37,10 @@ endif
quiet ?= $($1)
.c.o:
- $(call quiet,CC) -c $(CFLAGS) -o $@ $<
+ $(call quiet,CC) -c $(CFLAGS) $<
-ao_serial_lpc.h: ../lpc/baud_rate ao_pins.h
- nickle ../lpc/baud_rate `awk '/AO_LPC_CLKOUT/{print $$3}' ao_pins.h` > $@
+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` > $@
ao_serial_lpc.o: ao_serial_lpc.h
diff --git a/src/lpc/ao_arch_funcs.h b/src/lpc/ao_arch_funcs.h
index 9a3219a2..0891903e 100644
--- a/src/lpc/ao_arch_funcs.h
+++ b/src/lpc/ao_arch_funcs.h
@@ -235,6 +235,7 @@ static inline void ao_arch_start_scheduler(void) {
asm("mrs %0,control" : "=&r" (control));
control |= (1 << 1);
asm("msr control,%0" : : "r" (control));
+ asm("isb");
}
#endif /* _AO_ARCH_FUNCS_H_ */