From: phfr24 Date: Mon, 13 Jul 2026 21:41:39 +0000 (-0300) Subject: restructure X-Git-Url: https://git.wirehaze.ovh/stm32f411ceu6.git/commitdiff_plain/cef403c131fbb65f09837b0501b7e558e1462765?ds=sidebyside;hp=4bfee77ecbb19ef2143a1cd486cfa92bd3aceef4 restructure --- diff --git a/Makefile b/Makefile index 3c19779..24367ad 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ # preprocessor, 'cpp'. The precise recipe is '$(CPP) $(CPPFLAGS)'. CPP := arm-none-eabi-cpp -CPPFLAGS := +CPPFLAGS := -I sys/include AS := arm-none-eabi-as ASFLAGS := @@ -47,7 +47,7 @@ OCFLAGS := --output-target=binary # --------------------------------------------------------------------------- # -objs := $(patsubst %.c, %.o, $(wildcard *.c)) +objs := $(patsubst %.c, %.o, $(wildcard sys/*/*.c)) lds := kernel.ld LDFLAGS += -T $(lds) diff --git a/exceptions.c b/sys/core/exceptions.c similarity index 95% rename from exceptions.c rename to sys/core/exceptions.c index b3afaaa..77e67d7 100644 --- a/exceptions.c +++ b/sys/core/exceptions.c @@ -1,7 +1,7 @@ -#include "link.h" -#include "led.h" #include "sysclk.h" -#include "uart.h" +#include +#include +#include /* Initialize just enough to be able to handle a fault. */ __attribute__ ((noinline, used)) static void diff --git a/kentry.c b/sys/core/kentry.c similarity index 95% rename from kentry.c rename to sys/core/kentry.c index e9eab94..7fcc4b8 100644 --- a/kentry.c +++ b/sys/core/kentry.c @@ -1,5 +1,5 @@ -#include "uart.h" -#include "led.h" +#include +#include __attribute__ ((noreturn)) void kentry (void); diff --git a/sysclk.c b/sys/core/sysclk.c similarity index 97% rename from sysclk.c rename to sys/core/sysclk.c index a106774..61f2c5a 100644 --- a/sysclk.c +++ b/sys/core/sysclk.c @@ -1,5 +1,5 @@ #include "sysclk.h" -#include "stm32f411.h" +#include void sysclk_init (void) diff --git a/sysclk.h b/sys/core/sysclk.h similarity index 100% rename from sysclk.h rename to sys/core/sysclk.h diff --git a/led.c b/sys/dev/led.c similarity index 92% rename from led.c rename to sys/dev/led.c index 6627535..222bcb5 100644 --- a/led.c +++ b/sys/dev/led.c @@ -1,5 +1,5 @@ -#include "led.h" -#include "stm32f411.h" +#include +#include void led_init (void) diff --git a/uart.c b/sys/dev/uart.c similarity index 97% rename from uart.c rename to sys/dev/uart.c index 7174979..de68974 100644 --- a/uart.c +++ b/sys/dev/uart.c @@ -1,5 +1,5 @@ -#include "uart.h" -#include "stm32f411.h" +#include +#include /* Wait for data to be transferred into the shift register. */ static void diff --git a/led.h b/sys/include/led.h similarity index 100% rename from led.h rename to sys/include/led.h diff --git a/link.h b/sys/include/link.h similarity index 100% rename from link.h rename to sys/include/link.h diff --git a/stm32f411.h b/sys/include/stm32f411.h similarity index 100% rename from stm32f411.h rename to sys/include/stm32f411.h diff --git a/uart.h b/sys/include/uart.h similarity index 100% rename from uart.h rename to sys/include/uart.h