diff --git a/.gitignore b/.gitignore index 567609b..69fa449 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -build/ +_build/ diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index bd491f1..c39ec3d 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -3,7 +3,8 @@ { "name": "Linux", "includePath": [ - "${workspaceFolder}/**" + "${workspaceFolder}/**", + "${workspaceFolder}/base" ], "defines": [], "compilerPath": "/usr/bin/clang", diff --git a/.vscode/launch.json b/.vscode/launch.json index c292221..308edaa 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,7 @@ "name": "gdb Launch Debug", "type": "cppdbg", "request": "launch", - "program": "${workspaceFolder}/build/firmware.elf", + "program": "${workspaceFolder}/_build/firmware.elf", "args": [ "-d","${workspaceFolder}/Core/Src", "-d","${workspaceFolder}/Core/Startup", @@ -53,7 +53,7 @@ }, { "description": "Load executable into debugger.", - "text": "file ${workspaceFolder}/build/firmware.elf", + "text": "file ${workspaceFolder}/_build/firmware.elf", "ignoreFailures": false }, { diff --git a/Core/Src/main.cc b/Core/main.cc similarity index 91% rename from Core/Src/main.cc rename to Core/main.cc index e1bb58d..b67de4c 100644 --- a/Core/Src/main.cc +++ b/Core/main.cc @@ -5,13 +5,15 @@ #include "main.h" +#include "platform/stm32g0xx/Gpio.h" + IWDG_HandleTypeDef hiwdg; UART_HandleTypeDef huart2; static void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_USART2_UART_Init(void); -static void MX_IWDG_Init(void); +// static void MX_IWDG_Init(void); #define SYS_TICK_PRIO 0 @@ -64,7 +66,11 @@ int main(void) j = 800; } printf("%u: Hello World\r\n", i++); +<<<<<<< HEAD HAL_GPIO_TogglePin(LED_GREEN_GPIO_Port, LED_GREEN_Pin); +======= + green_led.toggle(); +>>>>>>> 133286e (fix: format) HAL_Delay(j); // HAL_IWDG_Refresh(&hiwdg); } @@ -137,16 +143,16 @@ void SystemClock_Config(void) MODIFY_REG(RCC->CCIPR, RCC_CCIPR_USART2SEL, RCC_USART2CLKSOURCE_PCLK1); } -static void MX_IWDG_Init(void) -{ - hiwdg.Instance = IWDG; - hiwdg.Init.Prescaler = IWDG_PRESCALER_4; - hiwdg.Init.Window = 4095; - hiwdg.Init.Reload = 4095; - if (HAL_IWDG_Init(&hiwdg) != HAL_OK) { - Error_Handler(); - } -} +// static void MX_IWDG_Init(void) +// { +// hiwdg.Instance = IWDG; +// hiwdg.Init.Prescaler = IWDG_PRESCALER_4; +// hiwdg.Init.Window = 4095; +// hiwdg.Init.Reload = 4095; +// if (HAL_IWDG_Init(&hiwdg) != HAL_OK) { +// Error_Handler(); +// } +// } static void MX_USART2_UART_Init(void) { diff --git a/Core/Inc/main.h b/Core/main.h similarity index 100% rename from Core/Inc/main.h rename to Core/main.h diff --git a/Core/Src/print.c b/Core/print.c similarity index 100% rename from Core/Src/print.c rename to Core/print.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h b/Legacy/STM32G0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_cortex.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_cortex.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_cortex.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_cortex.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_def.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_def.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_def.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_def.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_dma.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_dma.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_dma.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_dma.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_dma_ex.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_dma_ex.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_dma_ex.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_dma_ex.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_exti.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_exti.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_exti.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_exti.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_flash.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_flash.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_flash.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_flash.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_flash_ex.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_flash_ex.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_flash_ex.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_flash_ex.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_gpio.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_gpio.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_gpio.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_gpio.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_gpio_ex.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_gpio_ex.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_gpio_ex.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_gpio_ex.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_iwdg.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_iwdg.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_iwdg.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_iwdg.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_pwr.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_pwr.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_pwr.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_pwr.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_pwr_ex.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_pwr_ex.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_pwr_ex.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_pwr_ex.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_rcc.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_rcc.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_rcc.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_rcc.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_rcc_ex.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_rcc_ex.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_rcc_ex.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_rcc_ex.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_tim.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_tim.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_tim.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_tim.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_tim_ex.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_tim_ex.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_tim_ex.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_tim_ex.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_uart.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_uart.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_uart.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_uart.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_uart_ex.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_uart_ex.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_uart_ex.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_uart_ex.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_dma.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_dma.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_dma.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_dma.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_dmamux.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_dmamux.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_dmamux.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_dmamux.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_rcc.h b/Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_rcc.h similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_rcc.h rename to Legacy/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_rcc.h diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_cortex.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_cortex.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_cortex.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_cortex.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_dma.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_dma.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_dma.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_dma.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_dma_ex.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_dma_ex.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_dma_ex.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_dma_ex.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_exti.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_exti.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_exti.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_exti.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_flash.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_flash.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_flash.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_flash.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_flash_ex.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_flash_ex.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_flash_ex.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_flash_ex.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_gpio.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_gpio.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_gpio.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_gpio.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_iwdg.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_iwdg.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_iwdg.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_iwdg.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr_ex.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr_ex.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr_ex.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr_ex.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc_ex.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc_ex.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc_ex.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc_ex.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim_ex.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim_ex.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim_ex.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim_ex.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart_ex.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart_ex.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart_ex.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart_ex.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_dma.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_dma.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_dma.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_dma.c diff --git a/Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rcc.c b/Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rcc.c similarity index 100% rename from Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rcc.c rename to Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rcc.c diff --git a/Makefile b/Makefile index 2e5fa12..5f15b63 100644 --- a/Makefile +++ b/Makefile @@ -3,40 +3,32 @@ TARGET = firmware DEBUG = 1 OPT = -O0 -BUILD_DIR = build +BUILD_DIR = _build CC_SOURCES = \ -Core/Src/main.cc \ +Core/main.cc \ +platform/stm32g0xx/Gpio.cc \ C_SOURCES = \ -Core/Src/stm32g0xx_it.c \ -Core/Src/stm32g0xx_hal_msp.c \ -Core/Src/system_stm32g0xx.c \ -Core/Src/syscalls.c \ -Core/Src/sysmem.c \ -Core/Src/print.c \ -Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc.c \ -Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal.c \ -Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_cortex.c \ -Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc_ex.c \ -Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr.c \ -Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr_ex.c \ -Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_iwdg.c \ -Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart_ex.c \ -Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart.c \ -Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_gpio.c -# Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim.c \ -# Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim_ex.c \ -# Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rcc.c \ -# Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_flash.c \ -# Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_flash_ex.c \ -# Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_dma.c \ -# Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_dma_ex.c \ - -# Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_exti.c +platform/stm32g0xx/stm32g0xx_it.c \ +platform/stm32g0xx/stm32g0xx_hal_msp.c \ +platform/stm32g0xx/system_stm32g0xx.c \ +platform/stm32g0xx/syscalls.c \ +platform/stm32g0xx/sysmem.c \ +Core/print.c \ +Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc.c \ +Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal.c \ +Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_cortex.c \ +Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc_ex.c \ +Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr.c \ +Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr_ex.c \ +Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_iwdg.c \ +Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart_ex.c \ +Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart.c \ +Legacy/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_gpio.c ASM_SOURCES = \ -Core/Startup/startup_stm32g071rbtx.s +platform/stm32g0xx/startup_stm32g071rbtx.s PREFIX = arm-none-eabi- CC = $(PREFIX)gcc @@ -51,22 +43,18 @@ BIN = $(CP) -O binary -S CPU = -mcpu=cortex-m0plus MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI) -AS_DEFS = - C_DEFS = \ -DUSE_HAL_DRIVER \ -DSTM32G071xx - -AS_INCLUDES = - C_INCLUDES = \ --ICore/Inc \ --IDrivers/STM32G0xx_HAL_Driver/Inc \ --IDrivers/STM32G0xx_HAL_Driver/Inc/Legacy \ --IDrivers/CMSIS/Device/ST/STM32G0xx/Include \ --IDrivers/CMSIS/Include - +-I. \ +-ICore \ +-ILegacy/STM32G0xx_HAL_Driver/Inc \ +-ILegacy/STM32G0xx_HAL_Driver/Inc/Legacy \ +-Iarch/CMSIS/Device/ST/STM32G0xx/Include \ +-Iarch/CMSIS/Include \ +-Iplatform/stm32g0xx ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections @@ -77,7 +65,7 @@ endif CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" -LDSCRIPT = STM32G071RBTX_FLASH.ld +LDSCRIPT = platform/stm32g0xx/STM32G071RBTX_FLASH.ld LIBS = -lc -lm -lnosys LIBDIR = @@ -105,7 +93,6 @@ $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile $(CXX) $(OBJECTS) $(LDFLAGS) -o $@ - # $(CC) $(OBJECTS) $(LDFLAGS) -o $@ $(SZ) $@ $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) diff --git a/Drivers/CMSIS/Device/ST/STM32G0xx/Include/stm32g071xx.h b/arch/CMSIS/Device/ST/STM32G0xx/Include/stm32g071xx.h similarity index 100% rename from Drivers/CMSIS/Device/ST/STM32G0xx/Include/stm32g071xx.h rename to arch/CMSIS/Device/ST/STM32G0xx/Include/stm32g071xx.h diff --git a/Drivers/CMSIS/Device/ST/STM32G0xx/Include/stm32g0xx.h b/arch/CMSIS/Device/ST/STM32G0xx/Include/stm32g0xx.h similarity index 100% rename from Drivers/CMSIS/Device/ST/STM32G0xx/Include/stm32g0xx.h rename to arch/CMSIS/Device/ST/STM32G0xx/Include/stm32g0xx.h diff --git a/Drivers/CMSIS/Device/ST/STM32G0xx/Include/system_stm32g0xx.h b/arch/CMSIS/Device/ST/STM32G0xx/Include/system_stm32g0xx.h similarity index 100% rename from Drivers/CMSIS/Device/ST/STM32G0xx/Include/system_stm32g0xx.h rename to arch/CMSIS/Device/ST/STM32G0xx/Include/system_stm32g0xx.h diff --git a/Drivers/CMSIS/Include/cmsis_armcc.h b/arch/CMSIS/Include/cmsis_armcc.h similarity index 100% rename from Drivers/CMSIS/Include/cmsis_armcc.h rename to arch/CMSIS/Include/cmsis_armcc.h diff --git a/Drivers/CMSIS/Include/cmsis_armclang.h b/arch/CMSIS/Include/cmsis_armclang.h similarity index 100% rename from Drivers/CMSIS/Include/cmsis_armclang.h rename to arch/CMSIS/Include/cmsis_armclang.h diff --git a/Drivers/CMSIS/Include/cmsis_armclang_ltm.h b/arch/CMSIS/Include/cmsis_armclang_ltm.h similarity index 100% rename from Drivers/CMSIS/Include/cmsis_armclang_ltm.h rename to arch/CMSIS/Include/cmsis_armclang_ltm.h diff --git a/Drivers/CMSIS/Include/cmsis_compiler.h b/arch/CMSIS/Include/cmsis_compiler.h similarity index 100% rename from Drivers/CMSIS/Include/cmsis_compiler.h rename to arch/CMSIS/Include/cmsis_compiler.h diff --git a/Drivers/CMSIS/Include/cmsis_gcc.h b/arch/CMSIS/Include/cmsis_gcc.h similarity index 100% rename from Drivers/CMSIS/Include/cmsis_gcc.h rename to arch/CMSIS/Include/cmsis_gcc.h diff --git a/Drivers/CMSIS/Include/cmsis_iccarm.h b/arch/CMSIS/Include/cmsis_iccarm.h similarity index 100% rename from Drivers/CMSIS/Include/cmsis_iccarm.h rename to arch/CMSIS/Include/cmsis_iccarm.h diff --git a/Drivers/CMSIS/Include/cmsis_version.h b/arch/CMSIS/Include/cmsis_version.h similarity index 100% rename from Drivers/CMSIS/Include/cmsis_version.h rename to arch/CMSIS/Include/cmsis_version.h diff --git a/Drivers/CMSIS/Include/core_armv81mml.h b/arch/CMSIS/Include/core_armv81mml.h similarity index 100% rename from Drivers/CMSIS/Include/core_armv81mml.h rename to arch/CMSIS/Include/core_armv81mml.h diff --git a/Drivers/CMSIS/Include/core_armv8mbl.h b/arch/CMSIS/Include/core_armv8mbl.h similarity index 100% rename from Drivers/CMSIS/Include/core_armv8mbl.h rename to arch/CMSIS/Include/core_armv8mbl.h diff --git a/Drivers/CMSIS/Include/core_armv8mml.h b/arch/CMSIS/Include/core_armv8mml.h similarity index 100% rename from Drivers/CMSIS/Include/core_armv8mml.h rename to arch/CMSIS/Include/core_armv8mml.h diff --git a/Drivers/CMSIS/Include/core_cm0.h b/arch/CMSIS/Include/core_cm0.h similarity index 100% rename from Drivers/CMSIS/Include/core_cm0.h rename to arch/CMSIS/Include/core_cm0.h diff --git a/Drivers/CMSIS/Include/core_cm0plus.h b/arch/CMSIS/Include/core_cm0plus.h similarity index 100% rename from Drivers/CMSIS/Include/core_cm0plus.h rename to arch/CMSIS/Include/core_cm0plus.h diff --git a/Drivers/CMSIS/Include/core_cm1.h b/arch/CMSIS/Include/core_cm1.h similarity index 100% rename from Drivers/CMSIS/Include/core_cm1.h rename to arch/CMSIS/Include/core_cm1.h diff --git a/Drivers/CMSIS/Include/core_cm23.h b/arch/CMSIS/Include/core_cm23.h similarity index 100% rename from Drivers/CMSIS/Include/core_cm23.h rename to arch/CMSIS/Include/core_cm23.h diff --git a/Drivers/CMSIS/Include/core_cm3.h b/arch/CMSIS/Include/core_cm3.h similarity index 100% rename from Drivers/CMSIS/Include/core_cm3.h rename to arch/CMSIS/Include/core_cm3.h diff --git a/Drivers/CMSIS/Include/core_cm33.h b/arch/CMSIS/Include/core_cm33.h similarity index 100% rename from Drivers/CMSIS/Include/core_cm33.h rename to arch/CMSIS/Include/core_cm33.h diff --git a/Drivers/CMSIS/Include/core_cm35p.h b/arch/CMSIS/Include/core_cm35p.h similarity index 100% rename from Drivers/CMSIS/Include/core_cm35p.h rename to arch/CMSIS/Include/core_cm35p.h diff --git a/Drivers/CMSIS/Include/core_cm4.h b/arch/CMSIS/Include/core_cm4.h similarity index 100% rename from Drivers/CMSIS/Include/core_cm4.h rename to arch/CMSIS/Include/core_cm4.h diff --git a/Drivers/CMSIS/Include/core_cm7.h b/arch/CMSIS/Include/core_cm7.h similarity index 100% rename from Drivers/CMSIS/Include/core_cm7.h rename to arch/CMSIS/Include/core_cm7.h diff --git a/Drivers/CMSIS/Include/core_sc000.h b/arch/CMSIS/Include/core_sc000.h similarity index 100% rename from Drivers/CMSIS/Include/core_sc000.h rename to arch/CMSIS/Include/core_sc000.h diff --git a/Drivers/CMSIS/Include/core_sc300.h b/arch/CMSIS/Include/core_sc300.h similarity index 100% rename from Drivers/CMSIS/Include/core_sc300.h rename to arch/CMSIS/Include/core_sc300.h diff --git a/Drivers/CMSIS/Include/mpu_armv7.h b/arch/CMSIS/Include/mpu_armv7.h similarity index 100% rename from Drivers/CMSIS/Include/mpu_armv7.h rename to arch/CMSIS/Include/mpu_armv7.h diff --git a/Drivers/CMSIS/Include/mpu_armv8.h b/arch/CMSIS/Include/mpu_armv8.h similarity index 100% rename from Drivers/CMSIS/Include/mpu_armv8.h rename to arch/CMSIS/Include/mpu_armv8.h diff --git a/Drivers/CMSIS/Include/tz_context.h b/arch/CMSIS/Include/tz_context.h similarity index 100% rename from Drivers/CMSIS/Include/tz_context.h rename to arch/CMSIS/Include/tz_context.h diff --git a/STM32G071RBTX_FLASH.ld b/platform/stm32g0xx/STM32G071RBTX_FLASH.ld similarity index 100% rename from STM32G071RBTX_FLASH.ld rename to platform/stm32g0xx/STM32G071RBTX_FLASH.ld diff --git a/Core/Startup/startup_stm32g071rbtx.s b/platform/stm32g0xx/startup_stm32g071rbtx.s similarity index 100% rename from Core/Startup/startup_stm32g071rbtx.s rename to platform/stm32g0xx/startup_stm32g071rbtx.s diff --git a/Core/Inc/stm32g0xx_hal_conf.h b/platform/stm32g0xx/stm32g0xx_hal_conf.h similarity index 100% rename from Core/Inc/stm32g0xx_hal_conf.h rename to platform/stm32g0xx/stm32g0xx_hal_conf.h diff --git a/Core/Src/stm32g0xx_hal_msp.c b/platform/stm32g0xx/stm32g0xx_hal_msp.c similarity index 100% rename from Core/Src/stm32g0xx_hal_msp.c rename to platform/stm32g0xx/stm32g0xx_hal_msp.c diff --git a/Core/Src/stm32g0xx_it.c b/platform/stm32g0xx/stm32g0xx_it.c similarity index 100% rename from Core/Src/stm32g0xx_it.c rename to platform/stm32g0xx/stm32g0xx_it.c diff --git a/Core/Inc/stm32g0xx_it.h b/platform/stm32g0xx/stm32g0xx_it.h similarity index 100% rename from Core/Inc/stm32g0xx_it.h rename to platform/stm32g0xx/stm32g0xx_it.h diff --git a/Core/Src/syscalls.c b/platform/stm32g0xx/syscalls.c similarity index 100% rename from Core/Src/syscalls.c rename to platform/stm32g0xx/syscalls.c diff --git a/Core/Src/sysmem.c b/platform/stm32g0xx/sysmem.c similarity index 100% rename from Core/Src/sysmem.c rename to platform/stm32g0xx/sysmem.c diff --git a/Core/Src/system_stm32g0xx.c b/platform/stm32g0xx/system_stm32g0xx.c similarity index 100% rename from Core/Src/system_stm32g0xx.c rename to platform/stm32g0xx/system_stm32g0xx.c