From f04a5c79306ccd6b75f44bfd612d9de358109f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Wed, 12 Feb 2020 21:00:35 +0100 Subject: [PATCH] Restructure include hierarchy --- stm-firmware/Makefile | 2 +- stm-firmware/adc-meas.c | 10 ++++---- stm-firmware/clock-enable-manager.c | 2 +- stm-firmware/digio.c | 8 +++---- stm-firmware/{ => include}/cmsis/core_cm4.h | 6 ++--- .../{ => include}/cmsis/core_cm4_simd.h | 0 .../{ => include}/cmsis/core_cmFunc.h | 0 .../{ => include}/cmsis/core_cmInstr.h | 0 .../{ => reflow-controller}/adc-meas.h | 2 +- .../include/{ => reflow-controller}/digio.h | 0 .../include/{ => reflow-controller}/shell.h | 0 .../include/{ => reflow-controller}/systick.h | 0 .../include/{ => setup}/system_stm32f4xx.h | 0 .../{ => stm-periph}/clock-enable-manager.h | 2 +- .../{ => stm-periph}/stm32-gpio-macros.h | 0 .../{ => stm-periph}/uart/dma-ring-buffer.h | 2 +- .../include/{ => stm-periph}/uart/uart.h | 0 .../include/{ => stm32}/stm32f407xx.h | 4 ++-- stm-firmware/include/{ => stm32}/stm32f4xx.h | 0 stm-firmware/main.c | 23 +++++++++++-------- .../{cmsis_boot => setup}/system_stm32f4xx.c | 2 +- stm-firmware/shell.c | 10 ++++---- stm-firmware/syscalls.c | 2 +- stm-firmware/systick.c | 6 ++--- stm-firmware/uart/dma-ring-buffer.c | 4 ++-- stm-firmware/uart/uart.c | 10 ++++---- 26 files changed, 49 insertions(+), 46 deletions(-) rename stm-firmware/{ => include}/cmsis/core_cm4.h (98%) rename stm-firmware/{ => include}/cmsis/core_cm4_simd.h (100%) rename stm-firmware/{ => include}/cmsis/core_cmFunc.h (100%) rename stm-firmware/{ => include}/cmsis/core_cmInstr.h (100%) rename stm-firmware/include/{ => reflow-controller}/adc-meas.h (99%) rename stm-firmware/include/{ => reflow-controller}/digio.h (100%) rename stm-firmware/include/{ => reflow-controller}/shell.h (100%) rename stm-firmware/include/{ => reflow-controller}/systick.h (100%) rename stm-firmware/include/{ => setup}/system_stm32f4xx.h (100%) rename stm-firmware/include/{ => stm-periph}/clock-enable-manager.h (97%) rename stm-firmware/include/{ => stm-periph}/stm32-gpio-macros.h (100%) rename stm-firmware/include/{ => stm-periph}/uart/dma-ring-buffer.h (98%) rename stm-firmware/include/{ => stm-periph}/uart/uart.h (100%) rename stm-firmware/include/{ => stm32}/stm32f407xx.h (98%) rename stm-firmware/include/{ => stm32}/stm32f4xx.h (100%) rename stm-firmware/{cmsis_boot => setup}/system_stm32f4xx.c (97%) diff --git a/stm-firmware/Makefile b/stm-firmware/Makefile index f2476c6..9178e78 100644 --- a/stm-firmware/Makefile +++ b/stm-firmware/Makefile @@ -3,7 +3,7 @@ #Compiler: arm-none-eabi ##################################################################################### #Add Files and Folders below######################################################### -CFILES = main.c syscalls.c cmsis_boot/system_stm32f4xx.c systick.c +CFILES = main.c syscalls.c setup/system_stm32f4xx.c systick.c ASFILES = boot/startup_stm32f4xx.S INCLUDEPATH = -Icmsis -Iinclude diff --git a/stm-firmware/adc-meas.c b/stm-firmware/adc-meas.c index 6ac2e7e..3dff159 100644 --- a/stm-firmware/adc-meas.c +++ b/stm-firmware/adc-meas.c @@ -1,9 +1,9 @@ -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include static float pt1000_offset; static float pt1000_sens_dev; diff --git a/stm-firmware/clock-enable-manager.c b/stm-firmware/clock-enable-manager.c index ce7ef64..48012a7 100644 --- a/stm-firmware/clock-enable-manager.c +++ b/stm-firmware/clock-enable-manager.c @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/stm-firmware/digio.c b/stm-firmware/digio.c index 5342b9c..048c244 100644 --- a/stm-firmware/digio.c +++ b/stm-firmware/digio.c @@ -1,7 +1,7 @@ -#include -#include -#include -#include +#include +#include +#include +#include #include static const uint8_t digio_pins[] = {DIGIO_PINS}; diff --git a/stm-firmware/cmsis/core_cm4.h b/stm-firmware/include/cmsis/core_cm4.h similarity index 98% rename from stm-firmware/cmsis/core_cm4.h rename to stm-firmware/include/cmsis/core_cm4.h index 024302e..2ec271f 100644 --- a/stm-firmware/cmsis/core_cm4.h +++ b/stm-firmware/include/cmsis/core_cm4.h @@ -151,9 +151,9 @@ #endif #include /* standard types definitions */ -#include /* Core Instruction Access */ -#include /* Core Function Access */ -#include /* Compiler specific SIMD Intrinsics */ +#include /* Core Instruction Access */ +#include /* Core Function Access */ +#include /* Compiler specific SIMD Intrinsics */ #endif /* __CORE_CM4_H_GENERIC */ diff --git a/stm-firmware/cmsis/core_cm4_simd.h b/stm-firmware/include/cmsis/core_cm4_simd.h similarity index 100% rename from stm-firmware/cmsis/core_cm4_simd.h rename to stm-firmware/include/cmsis/core_cm4_simd.h diff --git a/stm-firmware/cmsis/core_cmFunc.h b/stm-firmware/include/cmsis/core_cmFunc.h similarity index 100% rename from stm-firmware/cmsis/core_cmFunc.h rename to stm-firmware/include/cmsis/core_cmFunc.h diff --git a/stm-firmware/cmsis/core_cmInstr.h b/stm-firmware/include/cmsis/core_cmInstr.h similarity index 100% rename from stm-firmware/cmsis/core_cmInstr.h rename to stm-firmware/include/cmsis/core_cmInstr.h diff --git a/stm-firmware/include/adc-meas.h b/stm-firmware/include/reflow-controller/adc-meas.h similarity index 99% rename from stm-firmware/include/adc-meas.h rename to stm-firmware/include/reflow-controller/adc-meas.h index ca8a924..1419890 100644 --- a/stm-firmware/include/adc-meas.h +++ b/stm-firmware/include/reflow-controller/adc-meas.h @@ -3,7 +3,7 @@ #include #include -#include +#include /** * @brief Moving average filter coefficient for PT1000 measurement */ diff --git a/stm-firmware/include/digio.h b/stm-firmware/include/reflow-controller/digio.h similarity index 100% rename from stm-firmware/include/digio.h rename to stm-firmware/include/reflow-controller/digio.h diff --git a/stm-firmware/include/shell.h b/stm-firmware/include/reflow-controller/shell.h similarity index 100% rename from stm-firmware/include/shell.h rename to stm-firmware/include/reflow-controller/shell.h diff --git a/stm-firmware/include/systick.h b/stm-firmware/include/reflow-controller/systick.h similarity index 100% rename from stm-firmware/include/systick.h rename to stm-firmware/include/reflow-controller/systick.h diff --git a/stm-firmware/include/system_stm32f4xx.h b/stm-firmware/include/setup/system_stm32f4xx.h similarity index 100% rename from stm-firmware/include/system_stm32f4xx.h rename to stm-firmware/include/setup/system_stm32f4xx.h diff --git a/stm-firmware/include/clock-enable-manager.h b/stm-firmware/include/stm-periph/clock-enable-manager.h similarity index 97% rename from stm-firmware/include/clock-enable-manager.h rename to stm-firmware/include/stm-periph/clock-enable-manager.h index 3b24d60..bf78dca 100644 --- a/stm-firmware/include/clock-enable-manager.h +++ b/stm-firmware/include/stm-periph/clock-enable-manager.h @@ -2,7 +2,7 @@ #define __CLOCK_ENABLE_MANAGER_H__ #include -#include +#include /** * @brief The RCC Enable Manager uses static memory with a fixed maximum diff --git a/stm-firmware/include/stm32-gpio-macros.h b/stm-firmware/include/stm-periph/stm32-gpio-macros.h similarity index 100% rename from stm-firmware/include/stm32-gpio-macros.h rename to stm-firmware/include/stm-periph/stm32-gpio-macros.h diff --git a/stm-firmware/include/uart/dma-ring-buffer.h b/stm-firmware/include/stm-periph/uart/dma-ring-buffer.h similarity index 98% rename from stm-firmware/include/uart/dma-ring-buffer.h rename to stm-firmware/include/stm-periph/uart/dma-ring-buffer.h index 8ede524..b5c27ff 100644 --- a/stm-firmware/include/uart/dma-ring-buffer.h +++ b/stm-firmware/include/stm-periph/uart/dma-ring-buffer.h @@ -2,7 +2,7 @@ #define __DMA_RING_BUFFER_H__ #include -#include +#include #include struct dma_ring_buffer_to_mem { diff --git a/stm-firmware/include/uart/uart.h b/stm-firmware/include/stm-periph/uart/uart.h similarity index 100% rename from stm-firmware/include/uart/uart.h rename to stm-firmware/include/stm-periph/uart/uart.h diff --git a/stm-firmware/include/stm32f407xx.h b/stm-firmware/include/stm32/stm32f407xx.h similarity index 98% rename from stm-firmware/include/stm32f407xx.h rename to stm-firmware/include/stm32/stm32f407xx.h index 6b7ba0c..c61a9a6 100644 --- a/stm-firmware/include/stm32f407xx.h +++ b/stm-firmware/include/stm32/stm32f407xx.h @@ -181,8 +181,8 @@ typedef enum * @} */ -#include "core_cm4.h" /* Cortex-M4 processor and core peripherals */ -#include "system_stm32f4xx.h" +#include /* Cortex-M4 processor and core peripherals */ +#include #include /** @addtogroup Peripheral_registers_structures diff --git a/stm-firmware/include/stm32f4xx.h b/stm-firmware/include/stm32/stm32f4xx.h similarity index 100% rename from stm-firmware/include/stm32f4xx.h rename to stm-firmware/include/stm32/stm32f4xx.h diff --git a/stm-firmware/main.c b/stm-firmware/main.c index ff53de0..193a5fb 100644 --- a/stm-firmware/main.c +++ b/stm-firmware/main.c @@ -4,18 +4,20 @@ * Created on: Apr 25, 2015 * Author: mari */ -#include -#include -//#include -#include -#include + #include #include -#include -#include -#include -#include -#include +/* #include */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include static void setup_nvic_priorities() { @@ -25,6 +27,7 @@ static void setup_nvic_priorities() /* Setup Priorities */ NVIC_SetPriority(ADC_IRQn, 2); NVIC_SetPriority(DMA2_Stream0_IRQn, 1); + NVIC_SetPriority(DMA2_Stream7_IRQn, 3); } static float pt1000_value; diff --git a/stm-firmware/cmsis_boot/system_stm32f4xx.c b/stm-firmware/setup/system_stm32f4xx.c similarity index 97% rename from stm-firmware/cmsis_boot/system_stm32f4xx.c rename to stm-firmware/setup/system_stm32f4xx.c index 5ec21da..b2d4bb7 100644 --- a/stm-firmware/cmsis_boot/system_stm32f4xx.c +++ b/stm-firmware/setup/system_stm32f4xx.c @@ -114,7 +114,7 @@ * @{ */ -#include "stm32f4xx.h" +#include /** * @} diff --git a/stm-firmware/shell.c b/stm-firmware/shell.c index 1e05803..a548c02 100644 --- a/stm-firmware/shell.c +++ b/stm-firmware/shell.c @@ -1,11 +1,11 @@ -#include -#include +#include +#include #include -#include -#include +#include +#include #include #include -#include +#include #ifndef GIT_VER #define GIT_VER "VERSION NOT SET" diff --git a/stm-firmware/syscalls.c b/stm-firmware/syscalls.c index 4940f2b..69aabc6 100644 --- a/stm-firmware/syscalls.c +++ b/stm-firmware/syscalls.c @@ -1,4 +1,4 @@ -#include +#include char* _sbrk(int incr) { extern char heap_low; // Defined by the linker diff --git a/stm-firmware/systick.c b/stm-firmware/systick.c index 815051b..6e6180c 100644 --- a/stm-firmware/systick.c +++ b/stm-firmware/systick.c @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include volatile uint32_t wait_tick_ms; volatile uint64_t global_tick_ms; diff --git a/stm-firmware/uart/dma-ring-buffer.c b/stm-firmware/uart/dma-ring-buffer.c index aadc34f..2bdc405 100644 --- a/stm-firmware/uart/dma-ring-buffer.c +++ b/stm-firmware/uart/dma-ring-buffer.c @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include #include diff --git a/stm-firmware/uart/uart.c b/stm-firmware/uart/uart.c index 1314543..f384532 100644 --- a/stm-firmware/uart/uart.c +++ b/stm-firmware/uart/uart.c @@ -8,11 +8,11 @@ //PA2 => TX //PA3 => RX //Alternate Function 7 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include static struct dma_ring_buffer_to_mem ring_buff_rx;