summaryrefslogtreecommitdiff
path: root/avr/Tupfile
diff options
context:
space:
mode:
authorLeo C2014-12-02 11:45:40 +0100
committerLeo C2014-12-02 11:45:40 +0100
commitbe5cfb4b00c91be32cb736369a452faef8c24760 (patch)
treee9f43c6bd189880b7de66aab0bf0ed16960f5f1a /avr/Tupfile
parente63b2f75607905fedf00cfd9fe644b26af715ffd (diff)
downloadz180-stamp-be5cfb4b00c91be32cb736369a452faef8c24760.zip
System time: Init from rtc on startup, update in timer inerrupt.
Diffstat (limited to 'avr/Tupfile')
-rw-r--r--avr/Tupfile12
1 files changed, 12 insertions, 0 deletions
diff --git a/avr/Tupfile b/avr/Tupfile
index 6c40649..9fc0739 100644
--- a/avr/Tupfile
+++ b/avr/Tupfile
@@ -16,6 +16,9 @@ SRC += $(FATFS) $(TOP)/fatfs/src/option/unicode.c
#TODO: time lib
SRC += ../time/asctime_r.c ../time/gmtime_r.c ../time/mk_gmtime.c
SRC += ../time/print_lz.c ../time/isLeap.c
+SRC += ../time/system_time.c ../time/set_system_time.c
+
+ASRC += ../time/system_tick.S
SRC_Z = ../z180/hdrom.c
@@ -74,17 +77,26 @@ CFLAGS += $(INCLUDES)
CPPFLAGS += $(DEFS)
+#ASFLAGS += -Wa,-adhlns=$(<:.S=.lst),-gstabs
+ASFLAGS += -mmcu=$(MCU_TARGET) -x assembler-with-cpp $(ASFLAGS)
+
# Linker flags
LDFLAGS += -Wl,--gc-sections
LDFLAGS += -Wl,--cref
+# Assemble: create object files from assembler source files.
+#.S.o:
+# $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
+!as = |> ^ AS %f^ $(CC) $(ASFLAGS) -c %f -o %o |> %B.o
!cc = |> ^ CC %f^ $(CC) $(CFLAGS) $(CPPFLAGS) $(CFLAGS_%f) -c %f -o %o |> %B.o
!LINK = |> ^ LINK %o^ $(LD) $(CFLAGS) $(LDFLAGS) -Wl,-Map=%O.map %f $(LDLIBS) -o %o |> | %O.map
!OBJCOPY= |> ^ OBJCOPY %o^ $(OBJCOPY) -Oihex %f %o |>
!OBJDUMP= |> ^ OBJDUMP %o^ $(OBJDUMP) -h -S %f > %o |> %O.lss
!SIZE = |> ^ SIZE^ $(SIZE) %f |>
+: foreach $(ASRC) |> !as |> {objs}
: foreach $(SRC) | ../z180/hdrom.h |> !cc |> {objs}
: $(SRC_Z) |> !cc -D'const=const __flash' |> {objs}