From cef403c131fbb65f09837b0501b7e558e1462765 Mon Sep 17 00:00:00 2001 From: phfr24 Date: Mon, 13 Jul 2026 18:41:39 -0300 Subject: [PATCH 1/1] restructure --- Makefile | 4 ++-- exceptions.c => sys/core/exceptions.c | 6 +++--- kentry.c => sys/core/kentry.c | 4 ++-- sysclk.c => sys/core/sysclk.c | 2 +- sysclk.h => sys/core/sysclk.h | 0 led.c => sys/dev/led.c | 4 ++-- uart.c => sys/dev/uart.c | 4 ++-- led.h => sys/include/led.h | 0 link.h => sys/include/link.h | 0 stm32f411.h => sys/include/stm32f411.h | 0 uart.h => sys/include/uart.h | 0 11 files changed, 12 insertions(+), 12 deletions(-) rename exceptions.c => sys/core/exceptions.c (95%) rename kentry.c => sys/core/kentry.c (95%) rename sysclk.c => sys/core/sysclk.c (97%) rename sysclk.h => sys/core/sysclk.h (100%) rename led.c => sys/dev/led.c (92%) rename uart.c => sys/dev/uart.c (97%) rename led.h => sys/include/led.h (100%) rename link.h => sys/include/link.h (100%) rename stm32f411.h => sys/include/stm32f411.h (100%) rename uart.h => sys/include/uart.h (100%) 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 -- 2.54.0