summaryrefslogtreecommitdiffstats
path: root/app/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'app/Makefile')
-rw-r--r--app/Makefile39
1 files changed, 29 insertions, 10 deletions
diff --git a/app/Makefile b/app/Makefile
index 20e34f1..c0bbf4c 100644
--- a/app/Makefile
+++ b/app/Makefile
@@ -25,8 +25,9 @@ PROG=msf
V=1
default: ${PROG}.elf
-CSRCS=led.c ticker.c ring.c usart.c stdio.c lwip_glue.c steth.c msf.c abs.c pll.c main.c time_fn.c ntp.c dcf77.c util.c stats.c gps.c hexdump.c bits.c
-HSRCS=project.h ring.h pins.h gps.h ubx.h
+CSRCS=led.c ticker.c ring.c usart.c stdio.c lwip_glue.c steth.c msf.c abs.c pll.c main.c time_fn.c ntp.c dcf77.c util.c stats.c gps.c hexdump.c bits.c max7219.c report.c
+HSRCS= events.h gps.h project.h ring.h steth.h time_fn.h ubx.h
+
@@ -63,7 +64,7 @@ objs:${OBJS}
${MYOBJS}: project.h prototypes.h
${LWIP_OBJS}: lwip/lwipopts.h
-OBJS=${MYOBJS} ${LWIP_OBJS} almanac.o
+OBJS=${MYOBJS} ${LWIP_OBJS}
include ../Makefile.include
@@ -73,11 +74,26 @@ CPPFLAGS += -I../libopencm3-local -I${LWIP_PATH}/${LWIP}/src/include -Il
fish: ${OBJS}
echo ${OBJS}
+HOST=clock-lnx
+#HOST=10.32.91.140
+
+
+reset:
+ $(Q)$(OOCD) -f ../oocd/interface/$(OOCD_INTERFACE).cfg \
+ -f ../oocd/board/$(OOCD_BOARD).cfg \
+ -c "init" -c "reset run" \
+ -c shutdown
+
+
+fl: ${PROG}.hex
+ ssh ${HOST} flash_stm32 < ${PROG}.hex
+
program: ${PROG}.hex
- echo init | nc -t localhost 4444
- echo reset init | nc -t localhost 4444
- echo flash write_image erase ${PWD}/$< | nc -t localhost 4444
- echo reset run | nc -t localhost 4444
+ scp $< ${HOST}:/tmp/img.hex
+ echo init | nc -t ${HOST} 4444
+ echo reset init | nc -t ${HOST} 4444
+ echo flash write_image erase /tmp/img.hex | nc -t ${HOST} 4444
+ echo reset run | nc -t ${HOST} 4444
ds:
$(Q)$(OOCD) -f ../oocd/interface/$(OOCD_INTERFACE).cfg \
@@ -93,9 +109,12 @@ protos: ${CSRCS}
${CPROTO} -E "${CPP} $(CPPFLAGS)" -e -v ${CSRCS} > prototypes.h.tmp
mv -f prototypes.h.tmp prototypes.h
-almanac.c:almanac.alp
- echo const > $@
- xxd -i $< >> $@
+almanac.txt:
+ wget -O $@ 'https://navcen.uscg.gov/?pageName=currentAlmanac&format=yuma'
+
+almanac.h:alamanc.txt parse_alamanc.pl
+ ./parse_alamanc.pl < almanac.txt > $@ || /bin/rm -f $@
+
almanac.alp: almanac