From 3e0f2aacf966b9999cf7a60b706c26ce9837fa51 Mon Sep 17 00:00:00 2001 From: Kizarm Date: Tue, 16 Jan 2024 20:05:11 +0100 Subject: [PATCH] add systick --- Makefile | 4 ++-- io.cpp | 4 ---- main.cpp | 4 +++- sys.cpp | 22 ++++++++++++++++++++++ 4 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 sys.cpp diff --git a/Makefile b/Makefile index 6a89cf5..ec201a4 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ VPATH = . ./$(TARGET) # zdrojaky -> objekty OBJS = STM32L4x2_startup.o system.o -MOBJS = main.o io.o +MOBJS = main.o io.o sys.o BOBJS = $(addprefix $(BLD),$(OBJS)) @@ -48,7 +48,7 @@ $(BLD)%.o: %.cpp $(BLD): mkdir $(BLD) # MODULES # -main.o: main.cpp io.pcm +main.o: main.cpp io.pcm sys.pcm %.o: %.cpp -@echo [CXM $(TARGET)] $@ @$(CXX) $(VFLAGS) -c $(MFLAGS) $< -o $@ diff --git a/io.cpp b/io.cpp index 6ca90b5..d0e042b 100644 --- a/io.cpp +++ b/io.cpp @@ -179,8 +179,4 @@ namespace io { RCC.AHB2ENR.R |= cPortTab[port].clkMask; setMode (type); } - export void wait (const unsigned ms = 500000u) { - volatile unsigned n; - for (n=0u; n