diff --git a/L2_Core/CMakeLists.txt b/L2_Core/CMakeLists.txt index 3858495..dacc48a 100644 --- a/L2_Core/CMakeLists.txt +++ b/L2_Core/CMakeLists.txt @@ -16,7 +16,7 @@ target_include_directories(l2_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/hal/inc ${CMAKE_CURRENT_SOURCE_DIR}/port/inc ${CMAKE_CURRENT_SOURCE_DIR}/third_party/letter_shell/inc - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/lwprintf/include + ${CMAKE_CURRENT_SOURCE_DIR}/third_party/lwprintf/inc ${CMAKE_CURRENT_SOURCE_DIR}/third_party/tlsf ) diff --git a/L2_Core/hal/inc/ek_hal_adc.h b/L2_Core/hal/inc/ek_hal_adc.h index ab1b6c5..2f6861a 100644 --- a/L2_Core/hal/inc/ek_hal_adc.h +++ b/L2_Core/hal/inc/ek_hal_adc.h @@ -1,8 +1,8 @@ #ifndef EK_HAL_ADC_H #define EK_HAL_ADC_H -#include "../../utils/inc/ek_def.h" -#include "../../utils/inc/ek_list.h" +#include "ek_def.h" +#include "ek_list.h" #ifdef __cplusplus extern "C" diff --git a/L2_Core/hal/inc/ek_hal_dac.h b/L2_Core/hal/inc/ek_hal_dac.h index c6103a2..45ef7b6 100644 --- a/L2_Core/hal/inc/ek_hal_dac.h +++ b/L2_Core/hal/inc/ek_hal_dac.h @@ -1,8 +1,8 @@ #ifndef EK_HAL_DAC_H #define EK_HAL_DAC_H -#include "../../utils/inc/ek_def.h" -#include "../../utils/inc/ek_list.h" +#include "ek_def.h" +#include "ek_list.h" #ifdef __cplusplus extern "C" diff --git a/L2_Core/hal/inc/ek_hal_dma.h b/L2_Core/hal/inc/ek_hal_dma.h index 72f4eb0..cdc15a5 100644 --- a/L2_Core/hal/inc/ek_hal_dma.h +++ b/L2_Core/hal/inc/ek_hal_dma.h @@ -1,8 +1,8 @@ #ifndef EK_HAL_DMA_H #define EK_HAL_DMA_H -#include "../../utils/inc/ek_def.h" -#include "../../utils/inc/ek_list.h" +#include "ek_def.h" +#include "ek_list.h" #ifdef __cplusplus extern "C" diff --git a/L2_Core/hal/inc/ek_hal_dma2d.h b/L2_Core/hal/inc/ek_hal_dma2d.h index e028743..4063ca4 100644 --- a/L2_Core/hal/inc/ek_hal_dma2d.h +++ b/L2_Core/hal/inc/ek_hal_dma2d.h @@ -1,8 +1,8 @@ #ifndef EK_HAL_DMA2D_H #define EK_HAL_DMA2D_H -#include "../../utils/inc/ek_def.h" -#include "../../utils/inc/ek_list.h" +#include "ek_def.h" +#include "ek_list.h" #ifdef __cplusplus extern "C" diff --git a/L2_Core/hal/inc/ek_hal_gpio.h b/L2_Core/hal/inc/ek_hal_gpio.h index 7fb8c9b..7ab255f 100644 --- a/L2_Core/hal/inc/ek_hal_gpio.h +++ b/L2_Core/hal/inc/ek_hal_gpio.h @@ -1,8 +1,8 @@ #ifndef EK_HAL_GPIO_H #define EK_HAL_GPIO_H -#include "../../utils/inc/ek_def.h" -#include "../../utils/inc/ek_list.h" +#include "ek_def.h" +#include "ek_list.h" #ifdef __cplusplus extern "C" diff --git a/L2_Core/hal/inc/ek_hal_i2c.h b/L2_Core/hal/inc/ek_hal_i2c.h index bce98c8..8a14c23 100644 --- a/L2_Core/hal/inc/ek_hal_i2c.h +++ b/L2_Core/hal/inc/ek_hal_i2c.h @@ -1,8 +1,8 @@ #ifndef EK_HAL_I2C_H #define EK_HAL_I2C_H -#include "../../utils/inc/ek_def.h" -#include "../../utils/inc/ek_list.h" +#include "ek_def.h" +#include "ek_list.h" #ifdef __cplusplus extern "C" diff --git a/L2_Core/hal/inc/ek_hal_ltdc.h b/L2_Core/hal/inc/ek_hal_ltdc.h index daf250f..1fc5675 100644 --- a/L2_Core/hal/inc/ek_hal_ltdc.h +++ b/L2_Core/hal/inc/ek_hal_ltdc.h @@ -1,8 +1,8 @@ #ifndef EK_HAL_LTDC_H #define EK_HAL_LTDC_H -#include "../../utils/inc/ek_def.h" -#include "../../utils/inc/ek_list.h" +#include "ek_def.h" +#include "ek_list.h" #ifdef __cplusplus extern "C" diff --git a/L2_Core/hal/inc/ek_hal_pwm.h b/L2_Core/hal/inc/ek_hal_pwm.h index 5543705..142dee6 100644 --- a/L2_Core/hal/inc/ek_hal_pwm.h +++ b/L2_Core/hal/inc/ek_hal_pwm.h @@ -1,8 +1,8 @@ #ifndef EK_HAL_PWM_H #define EK_HAL_PWM_H -#include "../../utils/inc/ek_def.h" -#include "../../utils/inc/ek_list.h" +#include "ek_def.h" +#include "ek_list.h" #ifdef __cplusplus extern "C" diff --git a/L2_Core/hal/inc/ek_hal_spi.h b/L2_Core/hal/inc/ek_hal_spi.h index 4cf1860..6dccfe6 100644 --- a/L2_Core/hal/inc/ek_hal_spi.h +++ b/L2_Core/hal/inc/ek_hal_spi.h @@ -1,8 +1,8 @@ #ifndef EK_HAL_SPI_H #define EK_HAL_SPI_H -#include "../../utils/inc/ek_def.h" -#include "../../utils/inc/ek_list.h" +#include "ek_def.h" +#include "ek_list.h" #ifdef __cplusplus extern "C" diff --git a/L2_Core/hal/inc/ek_hal_tick.h b/L2_Core/hal/inc/ek_hal_tick.h index a30b9e2..ddbfd90 100644 --- a/L2_Core/hal/inc/ek_hal_tick.h +++ b/L2_Core/hal/inc/ek_hal_tick.h @@ -1,8 +1,8 @@ #ifndef EK_HAL_TICK_H #define EK_HAL_TICK_H -#include "../../utils/inc/ek_def.h" -#include "../../utils/inc/ek_list.h" +#include "ek_def.h" +#include "ek_list.h" #ifdef __cplusplus extern "C" diff --git a/L2_Core/hal/inc/ek_hal_tim.h b/L2_Core/hal/inc/ek_hal_tim.h index 4babc20..2864bc2 100644 --- a/L2_Core/hal/inc/ek_hal_tim.h +++ b/L2_Core/hal/inc/ek_hal_tim.h @@ -1,8 +1,8 @@ #ifndef EK_HAL_TIMER_H #define EK_HAL_TIMER_H -#include "../../utils/inc/ek_def.h" -#include "../../utils/inc/ek_list.h" +#include "ek_def.h" +#include "ek_list.h" #ifdef __cplusplus extern "C" diff --git a/L2_Core/hal/inc/ek_hal_uart.h b/L2_Core/hal/inc/ek_hal_uart.h index ff807fe..a75279f 100644 --- a/L2_Core/hal/inc/ek_hal_uart.h +++ b/L2_Core/hal/inc/ek_hal_uart.h @@ -1,8 +1,8 @@ #ifndef EK_HAL_UART_H #define EK_HAL_UART_H -#include "../../utils/inc/ek_def.h" -#include "../../utils/inc/ek_list.h" +#include "ek_def.h" +#include "ek_list.h" #ifdef __cplusplus extern "C" diff --git a/L2_Core/hal/src/ek_hal_adc.c b/L2_Core/hal/src/ek_hal_adc.c index 620bfdb..7be6540 100644 --- a/L2_Core/hal/src/ek_hal_adc.c +++ b/L2_Core/hal/src/ek_hal_adc.c @@ -1,5 +1,5 @@ -#include "../inc/ek_hal_adc.h" -#include "../../utils/inc/ek_assert.h" +#include "ek_hal_adc.h" +#include "ek_assert.h" ek_list_node_t ek_hal_adc_head; static bool _ek_init_flag = false; diff --git a/L2_Core/hal/src/ek_hal_dac.c b/L2_Core/hal/src/ek_hal_dac.c index c4012ed..1b49e39 100644 --- a/L2_Core/hal/src/ek_hal_dac.c +++ b/L2_Core/hal/src/ek_hal_dac.c @@ -1,5 +1,5 @@ -#include "../inc/ek_hal_dac.h" -#include "../../utils/inc/ek_assert.h" +#include "ek_hal_dac.h" +#include "ek_assert.h" ek_list_node_t ek_hal_dac_head; static bool _ek_init_flag = false; diff --git a/L2_Core/hal/src/ek_hal_dma.c b/L2_Core/hal/src/ek_hal_dma.c index 3bd862a..9a2a31f 100644 --- a/L2_Core/hal/src/ek_hal_dma.c +++ b/L2_Core/hal/src/ek_hal_dma.c @@ -1,5 +1,5 @@ -#include "../inc/ek_hal_dma.h" -#include "../../utils/inc/ek_assert.h" +#include "ek_hal_dma.h" +#include "ek_assert.h" ek_list_node_t ek_hal_dma_head; static bool _ek_init_flag = false; diff --git a/L2_Core/hal/src/ek_hal_dma2d.c b/L2_Core/hal/src/ek_hal_dma2d.c index 658c68f..8b7a829 100644 --- a/L2_Core/hal/src/ek_hal_dma2d.c +++ b/L2_Core/hal/src/ek_hal_dma2d.c @@ -1,5 +1,5 @@ -#include "../inc/ek_hal_dma2d.h" -#include "../../utils/inc/ek_assert.h" +#include "ek_hal_dma2d.h" +#include "ek_assert.h" ek_list_node_t ek_hal_dma2d_head; static bool _ek_init_flag = false; diff --git a/L2_Core/hal/src/ek_hal_gpio.c b/L2_Core/hal/src/ek_hal_gpio.c index 7f5d4f8..75daf15 100644 --- a/L2_Core/hal/src/ek_hal_gpio.c +++ b/L2_Core/hal/src/ek_hal_gpio.c @@ -1,5 +1,5 @@ -#include "../inc/ek_hal_gpio.h" -#include "../../utils/inc/ek_assert.h" +#include "ek_hal_gpio.h" +#include "ek_assert.h" ek_list_node_t ek_hal_gpio_head; static bool _ek_init_flag = false; diff --git a/L2_Core/hal/src/ek_hal_i2c.c b/L2_Core/hal/src/ek_hal_i2c.c index 40f3d3a..24a5ba6 100644 --- a/L2_Core/hal/src/ek_hal_i2c.c +++ b/L2_Core/hal/src/ek_hal_i2c.c @@ -1,5 +1,5 @@ -#include "../inc/ek_hal_i2c.h" -#include "../../utils/inc/ek_assert.h" +#include "ek_hal_i2c.h" +#include "ek_assert.h" ek_list_node_t ek_hal_i2c_head; static bool _ek_init_flag = false; diff --git a/L2_Core/hal/src/ek_hal_ltdc.c b/L2_Core/hal/src/ek_hal_ltdc.c index 0db2d2d..6583957 100644 --- a/L2_Core/hal/src/ek_hal_ltdc.c +++ b/L2_Core/hal/src/ek_hal_ltdc.c @@ -1,5 +1,5 @@ -#include "../inc/ek_hal_ltdc.h" -#include "../../utils/inc/ek_assert.h" +#include "ek_hal_ltdc.h" +#include "ek_assert.h" ek_list_node_t ek_hal_ltdc_head; static bool _ek_init_flag = false; diff --git a/L2_Core/hal/src/ek_hal_pwm.c b/L2_Core/hal/src/ek_hal_pwm.c index 0f22c3f..47fbeec 100644 --- a/L2_Core/hal/src/ek_hal_pwm.c +++ b/L2_Core/hal/src/ek_hal_pwm.c @@ -1,5 +1,5 @@ -#include "../inc/ek_hal_pwm.h" -#include "../../utils/inc/ek_assert.h" +#include "ek_hal_pwm.h" +#include "ek_assert.h" ek_list_node_t ek_hal_pwm_head; static bool _ek_init_flag = false; diff --git a/L2_Core/hal/src/ek_hal_spi.c b/L2_Core/hal/src/ek_hal_spi.c index 402224d..6186a24 100644 --- a/L2_Core/hal/src/ek_hal_spi.c +++ b/L2_Core/hal/src/ek_hal_spi.c @@ -1,5 +1,5 @@ -#include "../inc/ek_hal_spi.h" -#include "../../utils/inc/ek_assert.h" +#include "ek_hal_spi.h" +#include "ek_assert.h" ek_list_node_t ek_hal_spi_head; static bool _ek_init_flag = false; diff --git a/L2_Core/hal/src/ek_hal_tick.c b/L2_Core/hal/src/ek_hal_tick.c index d665a86..ddc995b 100644 --- a/L2_Core/hal/src/ek_hal_tick.c +++ b/L2_Core/hal/src/ek_hal_tick.c @@ -1,5 +1,5 @@ -#include "../inc/ek_hal_tick.h" -#include "../../utils/inc/ek_assert.h" +#include "ek_hal_tick.h" +#include "ek_assert.h" ek_list_node_t ek_hal_tick_head; static bool _ek_init_flag = false; diff --git a/L2_Core/hal/src/ek_hal_tim.c b/L2_Core/hal/src/ek_hal_tim.c index 105f657..45fb9e2 100644 --- a/L2_Core/hal/src/ek_hal_tim.c +++ b/L2_Core/hal/src/ek_hal_tim.c @@ -1,5 +1,5 @@ -#include "../inc/ek_hal_tim.h" -#include "../../utils/inc/ek_assert.h" +#include "ek_hal_tim.h" +#include "ek_assert.h" ek_list_node_t ek_hal_tim_head; static bool _ek_init_flag = false; diff --git a/L2_Core/hal/src/ek_hal_uart.c b/L2_Core/hal/src/ek_hal_uart.c index 025052f..93818d6 100644 --- a/L2_Core/hal/src/ek_hal_uart.c +++ b/L2_Core/hal/src/ek_hal_uart.c @@ -1,5 +1,5 @@ -#include "../inc/ek_hal_uart.h" -#include "../../utils/inc/ek_assert.h" +#include "ek_hal_uart.h" +#include "ek_assert.h" ek_list_node_t ek_hal_uart_head; static bool _ek_init_flag = false; diff --git a/L2_Core/port/gd32f470zgt6/gd_adc_port.c b/L2_Core/port/gd32f470zgt6/gd_adc_port.c index d810218..3bab0de 100644 --- a/L2_Core/port/gd32f470zgt6/gd_adc_port.c +++ b/L2_Core/port/gd32f470zgt6/gd_adc_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_adc.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_adc.h" +#include "ek_assert.h" +#include "ek_export.h" #include "hal_adc.h" #include "gd32f4xx_adc.h" diff --git a/L2_Core/port/gd32f470zgt6/gd_dac_port.c b/L2_Core/port/gd32f470zgt6/gd_dac_port.c index d2925ed..96ad655 100644 --- a/L2_Core/port/gd32f470zgt6/gd_dac_port.c +++ b/L2_Core/port/gd32f470zgt6/gd_dac_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_dac.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_dac.h" +#include "ek_assert.h" +#include "ek_export.h" #include "gd32f4xx_dac.h" #include "hal_dac.h" diff --git a/L2_Core/port/gd32f470zgt6/gd_dma_port.c b/L2_Core/port/gd32f470zgt6/gd_dma_port.c index 86b64de..d98112a 100644 --- a/L2_Core/port/gd32f470zgt6/gd_dma_port.c +++ b/L2_Core/port/gd32f470zgt6/gd_dma_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_dma.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_dma.h" +#include "ek_assert.h" +#include "ek_export.h" #include "hal_dma.h" #include "gd32f4xx_dma.h" diff --git a/L2_Core/port/gd32f470zgt6/gd_gpio_port.c b/L2_Core/port/gd32f470zgt6/gd_gpio_port.c index e61fa35..835dc73 100644 --- a/L2_Core/port/gd32f470zgt6/gd_gpio_port.c +++ b/L2_Core/port/gd32f470zgt6/gd_gpio_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_gpio.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_gpio.h" +#include "ek_assert.h" +#include "ek_export.h" #include "gd32f4xx_gpio.h" // 具体设备的硬件信息 diff --git a/L2_Core/port/gd32f470zgt6/gd_i2c_port.c b/L2_Core/port/gd32f470zgt6/gd_i2c_port.c index 2a26f20..26de91d 100644 --- a/L2_Core/port/gd32f470zgt6/gd_i2c_port.c +++ b/L2_Core/port/gd32f470zgt6/gd_i2c_port.c @@ -1,8 +1,8 @@ -#include "../../hal/inc/ek_hal_i2c.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_i2c.h" +#include "ek_assert.h" +#include "ek_export.h" #include "gd32f4xx_i2c.h" -#include "../../../L1_MCU/GD32F470ZGT6/Hal/Inc/hal_iic.h" +#include "hal_iic.h" #define EK_HAL_LOCK_ON(x) ((x)->lock = true) #define EK_HAL_LOCK_OFF(x) ((x)->lock = false) diff --git a/L2_Core/port/gd32f470zgt6/gd_ipa_port.c b/L2_Core/port/gd32f470zgt6/gd_ipa_port.c index de0c5ad..1a4960a 100644 --- a/L2_Core/port/gd32f470zgt6/gd_ipa_port.c +++ b/L2_Core/port/gd32f470zgt6/gd_ipa_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_dma2d.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_dma2d.h" +#include "ek_assert.h" +#include "ek_export.h" #include "hal_ipa.h" // 硬件信息结构体 diff --git a/L2_Core/port/gd32f470zgt6/gd_pwm_port.c b/L2_Core/port/gd32f470zgt6/gd_pwm_port.c index 51332d4..6f63eb5 100644 --- a/L2_Core/port/gd32f470zgt6/gd_pwm_port.c +++ b/L2_Core/port/gd32f470zgt6/gd_pwm_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_pwm.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_pwm.h" +#include "ek_assert.h" +#include "ek_export.h" #include "hal_pwm.h" #include "gd32f4xx_timer.h" diff --git a/L2_Core/port/gd32f470zgt6/gd_spi_port.c b/L2_Core/port/gd32f470zgt6/gd_spi_port.c index 82f115c..b722947 100644 --- a/L2_Core/port/gd32f470zgt6/gd_spi_port.c +++ b/L2_Core/port/gd32f470zgt6/gd_spi_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_spi.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_spi.h" +#include "ek_assert.h" +#include "ek_export.h" #include "gd32f4xx_spi.h" #define EK_HAL_LOCK_ON(x) ((x)->lock = true) diff --git a/L2_Core/port/gd32f470zgt6/gd_tick_port.c b/L2_Core/port/gd32f470zgt6/gd_tick_port.c index e31ccef..5ef7e58 100644 --- a/L2_Core/port/gd32f470zgt6/gd_tick_port.c +++ b/L2_Core/port/gd32f470zgt6/gd_tick_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_tick.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_tick.h" +#include "ek_assert.h" +#include "ek_export.h" #include "bsp_timer.h" // 外部 SysTick 变量(需要在 BSP 层定义) diff --git a/L2_Core/port/gd32f470zgt6/gd_tim_port.c b/L2_Core/port/gd32f470zgt6/gd_tim_port.c index 6d2e703..b3818a0 100644 --- a/L2_Core/port/gd32f470zgt6/gd_tim_port.c +++ b/L2_Core/port/gd32f470zgt6/gd_tim_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_tim.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_tim.h" +#include "ek_assert.h" +#include "ek_export.h" #include "hal_tim.h" #include "gd32f4xx_timer.h" diff --git a/L2_Core/port/gd32f470zgt6/gd_uart_port.c b/L2_Core/port/gd32f470zgt6/gd_uart_port.c index 93ccf5e..3ae08db 100644 --- a/L2_Core/port/gd32f470zgt6/gd_uart_port.c +++ b/L2_Core/port/gd32f470zgt6/gd_uart_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_uart.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_uart.h" +#include "ek_assert.h" +#include "ek_export.h" #include "hal_usart.h" #define EK_HAL_LOCK_ON(x) ((x)->lock = true) diff --git a/L2_Core/port/stm32f429zi/st_dma2d_port.c b/L2_Core/port/stm32f429zi/st_dma2d_port.c index ddae9d0..4816ef4 100644 --- a/L2_Core/port/stm32f429zi/st_dma2d_port.c +++ b/L2_Core/port/stm32f429zi/st_dma2d_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_dma2d.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_dma2d.h" +#include "ek_assert.h" +#include "ek_export.h" #include "dma2d.h" /* CubeMX 生成的 DMA2D 句柄 */ @@ -68,7 +68,7 @@ static ek_hal_dma2d_t drv_dma2d1; __WEAK void ek_dma2d_transfer_cplt_callback(DMA2D_HandleTypeDef *hdma2d) { - __UNUSED(hdma2d); + __EK_UNUSED(hdma2d); } // 注册到 HAL diff --git a/L2_Core/port/stm32f429zi/st_gpio_port.c b/L2_Core/port/stm32f429zi/st_gpio_port.c index 53be942..107d540 100644 --- a/L2_Core/port/stm32f429zi/st_gpio_port.c +++ b/L2_Core/port/stm32f429zi/st_gpio_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_gpio.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_gpio.h" +#include "ek_assert.h" +#include "ek_export.h" #include "gpio.h" // 具体设备的硬件信息 diff --git a/L2_Core/port/stm32f429zi/st_i2c_port.c b/L2_Core/port/stm32f429zi/st_i2c_port.c index 0e4ffce..59c0629 100644 --- a/L2_Core/port/stm32f429zi/st_i2c_port.c +++ b/L2_Core/port/stm32f429zi/st_i2c_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_i2c.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_i2c.h" +#include "ek_assert.h" +#include "ek_export.h" #include "i2c.h" #define EK_HAL_LOCK_ON(x) ((x)->lock = true) diff --git a/L2_Core/port/stm32f429zi/st_ltdc_port.c b/L2_Core/port/stm32f429zi/st_ltdc_port.c index c8da677..dddc461 100644 --- a/L2_Core/port/stm32f429zi/st_ltdc_port.c +++ b/L2_Core/port/stm32f429zi/st_ltdc_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_ltdc.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_ltdc.h" +#include "ek_assert.h" +#include "ek_export.h" #include "ltdc.h" // ops 实现 diff --git a/L2_Core/port/stm32f429zi/st_spi_port.c b/L2_Core/port/stm32f429zi/st_spi_port.c index 16949a4..f889a61 100644 --- a/L2_Core/port/stm32f429zi/st_spi_port.c +++ b/L2_Core/port/stm32f429zi/st_spi_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_spi.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_spi.h" +#include "ek_assert.h" +#include "ek_export.h" #include "spi.h" #define EK_HAL_LOCK_ON(x) ((x)->lock = true) diff --git a/L2_Core/port/stm32f429zi/st_tick_port.c b/L2_Core/port/stm32f429zi/st_tick_port.c index 8881bee..0638fbb 100644 --- a/L2_Core/port/stm32f429zi/st_tick_port.c +++ b/L2_Core/port/stm32f429zi/st_tick_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_tick.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_tick.h" +#include "ek_assert.h" +#include "ek_export.h" #include "main.h" // ops 实现 diff --git a/L2_Core/port/stm32f429zi/st_tim_port.c b/L2_Core/port/stm32f429zi/st_tim_port.c index b83e428..736458f 100644 --- a/L2_Core/port/stm32f429zi/st_tim_port.c +++ b/L2_Core/port/stm32f429zi/st_tim_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_tim.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_tim.h" +#include "ek_assert.h" +#include "ek_export.h" #include "tim.h" // 硬件信息结构体 diff --git a/L2_Core/port/stm32f429zi/st_uart_port.c b/L2_Core/port/stm32f429zi/st_uart_port.c index ce42b1f..225d27c 100644 --- a/L2_Core/port/stm32f429zi/st_uart_port.c +++ b/L2_Core/port/stm32f429zi/st_uart_port.c @@ -1,6 +1,6 @@ -#include "../../hal/inc/ek_hal_uart.h" -#include "../../utils/inc/ek_assert.h" -#include "../../utils/inc/ek_export.h" +#include "ek_hal_uart.h" +#include "ek_assert.h" +#include "ek_export.h" #include "usart.h" #define EK_HAL_LOCK_ON(x) ((x)->lock = true) diff --git a/L2_Core/third_party/letter_shell/shell.c b/L2_Core/third_party/letter_shell/shell.c index 51609e9..23f89c3 100644 --- a/L2_Core/third_party/letter_shell/shell.c +++ b/L2_Core/third_party/letter_shell/shell.c @@ -9,8 +9,8 @@ * */ -#include "inc/shell.h" -#include "../lwprintf/inc/lwprintf.h" +#include "shell.h" +#include "lwprintf.h" #include #include diff --git a/L2_Core/third_party/letter_shell/shell_ext.c b/L2_Core/third_party/letter_shell/shell_ext.c index cf2904f..a011c47 100644 --- a/L2_Core/third_party/letter_shell/shell_ext.c +++ b/L2_Core/third_party/letter_shell/shell_ext.c @@ -9,9 +9,9 @@ * */ -#include "inc/shell_cfg.h" -#include "inc/shell.h" -#include "inc/shell_ext.h" +#include "shell_cfg.h" +#include "shell.h" +#include "shell_ext.h" /** * @brief 判断数字进制 diff --git a/L2_Core/third_party/lwprintf/lwprintf.c b/L2_Core/third_party/lwprintf/lwprintf.c index 862199b..e83f733 100644 --- a/L2_Core/third_party/lwprintf/lwprintf.c +++ b/L2_Core/third_party/lwprintf/lwprintf.c @@ -31,7 +31,7 @@ * Author: Tilen MAJERLE * Version: v1.1.0 */ -#include "inc/lwprintf.h" +#include "lwprintf.h" #include #include #include diff --git a/L2_Core/third_party/lwprintf/lwprintf_sys_cmsis_os.c b/L2_Core/third_party/lwprintf/lwprintf_sys_cmsis_os.c index f020d04..1f4b68c 100644 --- a/L2_Core/third_party/lwprintf/lwprintf_sys_cmsis_os.c +++ b/L2_Core/third_party/lwprintf/lwprintf_sys_cmsis_os.c @@ -31,7 +31,7 @@ * Author: Tilen MAJERLE * Version: v1.1.0 */ -#include "inc/lwprintf_sys.h" +#include "lwprintf_sys.h" #if LWPRINTF_CFG_OS && !__DOXYGEN__ diff --git a/L2_Core/third_party/lwprintf/lwprintf_sys_threadx.c b/L2_Core/third_party/lwprintf/lwprintf_sys_threadx.c index ad828ef..5f986b0 100644 --- a/L2_Core/third_party/lwprintf/lwprintf_sys_threadx.c +++ b/L2_Core/third_party/lwprintf/lwprintf_sys_threadx.c @@ -31,7 +31,7 @@ * Author: Tilen MAJERLE * Version: v1.1.0 */ -#include "inc/lwprintf_sys.h" +#include "lwprintf_sys.h" #if LWPRINTF_CFG_OS && !__DOXYGEN__ diff --git a/L2_Core/third_party/lwprintf/lwprintf_sys_win32.c b/L2_Core/third_party/lwprintf/lwprintf_sys_win32.c index 0412d82..4cf7231 100644 --- a/L2_Core/third_party/lwprintf/lwprintf_sys_win32.c +++ b/L2_Core/third_party/lwprintf/lwprintf_sys_win32.c @@ -31,7 +31,7 @@ * Author: Tilen MAJERLE * Version: v1.1.0 */ -#include "inc/lwprintf_sys.h" +#include "lwprintf_sys.h" #if LWPRINTF_CFG_OS && !__DOXYGEN__ diff --git a/L2_Core/utils/inc/ek_assert.h b/L2_Core/utils/inc/ek_assert.h index 0459e0f..eb4e857 100644 --- a/L2_Core/utils/inc/ek_assert.h +++ b/L2_Core/utils/inc/ek_assert.h @@ -14,7 +14,7 @@ #ifndef EK_ASSERT_H #define EK_ASSERT_H -#include "../../../ek_conf.h" +#include "ek_conf.h" #include "ek_def.h" /** diff --git a/L2_Core/utils/inc/ek_def.h b/L2_Core/utils/inc/ek_def.h index c8d0463..ef687a3 100644 --- a/L2_Core/utils/inc/ek_def.h +++ b/L2_Core/utils/inc/ek_def.h @@ -16,7 +16,6 @@ #define EK_DEF_H #include -#include #include #include #include @@ -35,69 +34,63 @@ /* ========== GCC 编译器宏定义 ========== */ #if defined(__GNUC__) && !defined(__ARMCC_VERSION) -# define __WEAK __attribute__((weak)) -# define __PACKED __attribute__((packed)) -# define __PACKED_STRUCT struct __attribute__((packed)) -# define __ALIGNED(x) __attribute__((aligned(x))) -# define __USED __attribute__((used)) -# define __SECTION(x) __attribute__((section(x))) -# define __NO_RETURN __attribute__((noreturn)) -# define __UNUSED(x) ((void)(x)) -# define __INLINE inline -# define __STATIC_INLINE static inline -# define __ALWAYS_INLINE __attribute__((always_inline)) static inline -# define __ASM __asm +# define __EK_WEAK __attribute__((weak)) +# define __EK_PACKED __attribute__((packed)) +# define __EK_PACKED_STRUCT struct __attribute__((packed)) +# define __EK_ALIGNED(x) __attribute__((aligned(x))) +# define __EK_USED __attribute__((used)) +# define __EK_SECTION(x) __attribute__((section(x))) +# define __EK_NO_RETURN __attribute__((noreturn)) +# define __EK_UNUSED(x) ((void)(x)) +# define __EK_INLINE inline +# define __EK_STATIC_INLINE static inline +# define __EK_ALWAYS_INLINE __attribute__((always_inline)) static inline +# define __EK_ASM __asm /* ========== ARM Compiler 6 宏定义 ========== */ #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -# define __WEAK __attribute__((weak)) -# define __PACKED __attribute__((packed)) -# define __PACKED_STRUCT struct __attribute__((packed)) -# define __ALIGNED(x) __attribute__((aligned(x))) -# define __USED __attribute__((used)) -# define __SECTION(x) __attribute__((section(x))) -# define __NO_RETURN __attribute__((noreturn)) -# define __UNUSED(x) ((void)(x)) -# define __INLINE inline -# define __STATIC_INLINE static inline -# define __ALWAYS_INLINE __attribute__((always_inline)) static inline -# define __ASM __asm +# define __EK_WEAK __attribute__((weak)) +# define __EK_PACKED __attribute__((packed)) +# define __EK_PACKED_STRUCT struct __attribute__((packed)) +# define __EK_ALIGNED(x) __attribute__((aligned(x))) +# define __EK_USED __attribute__((used)) +# define __EK_SECTION(x) __attribute__((section(x))) +# define __EK_NO_RETURN __attribute__((noreturn)) +# define __EK_UNUSED(x) ((void)(x)) +# define __EK_INLINE inline +# define __EK_STATIC_INLINE static inline +# define __EK_ALWAYS_INLINE __attribute__((always_inline)) static inline +# define __EK_ASM __asm /* ========== ARM Compiler 5 宏定义 ========== */ #elif defined(__CC_ARM) -# define __WEAK __weak -# define __PACKED __packed -# define __PACKED_STRUCT __packed struct -# define __ALIGNED(x) __align((x)) -# define __USED __attribute__((used)) -# define __SECTION(x) __attribute__((section(x))) -# define __NO_RETURN __declspec(noreturn) -# define __UNUSED(x) ((void)(x)) -# define __INLINE __inline -# define __STATIC_INLINE static __inline -# define __ALWAYS_INLINE __forceinline -# define __ASM __asm -/* ========== 不支持的编译器(需手动适配,默认编译报错) ========== */ +# define __EK_WEAK __weak +# define __EK_PACKED __packed +# define __EK_PACKED_STRUCT __packed struct +# define __EK_ALIGNED(x) __align(x) +# define __EK_USED __attribute__((used)) +# define __EK_SECTION(x) __attribute__((section(x))) +# define __EK_NO_RETURN __declspec(noreturn) +# define __EK_UNUSED(x) ((void)(x)) +# define __EK_INLINE __inline +# define __EK_STATIC_INLINE static __inline +# define __EK_ALWAYS_INLINE __forceinline +# define __EK_ASM __asm +/* ========== 不支持的编译器(空定义) ========== */ #else - -# if 1 -# error \ - "Unsupported compiler detected. Please review and update the macro definitions in ek_def.h for this toolchain." -# endif - -# define __WEAK -# define __PACKED -# define __PACKED_STRUCT struct -# define __ALIGNED(x) -# define __USED -# define __SECTION(x) -# define __NO_RETURN -# define __UNUSED(x) ((void)(x)) -# define __INLINE inline -# define __STATIC_INLINE static inline -# define __ALWAYS_INLINE static inline -# define __ASM asm +# define __EK_WEAK +# define __EK_PACKED +# define __EK_PACKED_STRUCT struct +# define __EK_ALIGNED(x) +# define __EK_USED +# define __EK_SECTION(x) +# define __EK_NO_RETURN +# define __EK_UNUSED(x) ((void)(x)) +# define __EK_INLINE inline +# define __EK_STATIC_INLINE static inline +# define __EK_ALWAYS_INLINE static inline +# define __EK_ASM asm #endif /* ========== 功能宏 ========== */ diff --git a/L2_Core/utils/inc/ek_export.h b/L2_Core/utils/inc/ek_export.h index fb37170..43cadee 100644 --- a/L2_Core/utils/inc/ek_export.h +++ b/L2_Core/utils/inc/ek_export.h @@ -21,7 +21,7 @@ #ifndef EK_EXPORT_H #define EK_EXPORT_H -#include "../../../ek_conf.h" +#include "ek_conf.h" #if (EK_EXPORT_ENABLE == 1) diff --git a/L2_Core/utils/inc/ek_io.h b/L2_Core/utils/inc/ek_io.h index e28d5db..6d37a65 100644 --- a/L2_Core/utils/inc/ek_io.h +++ b/L2_Core/utils/inc/ek_io.h @@ -11,7 +11,7 @@ #ifndef EK_IO_H #define EK_IO_H -#include "../../../ek_conf.h" +#include "ek_conf.h" #ifdef __cplusplus extern "C" diff --git a/L2_Core/utils/inc/ek_list.h b/L2_Core/utils/inc/ek_list.h index da98417..1738326 100644 --- a/L2_Core/utils/inc/ek_list.h +++ b/L2_Core/utils/inc/ek_list.h @@ -9,7 +9,7 @@ #ifndef EK_LIST_H #define EK_LIST_H -#include "../../../ek_conf.h" +#include "ek_conf.h" #if EK_LIST_ENABLE == 1 @@ -73,7 +73,7 @@ struct ek_list_node_t * * @note 使用前必须初始化,使头节点的 prev 和 next 都指向自己 */ -__STATIC_INLINE void ek_list_init(ek_list_node_t *head) +__EK_STATIC_INLINE void ek_list_init(ek_list_node_t *head) { head->next = head; head->prev = head; @@ -85,7 +85,7 @@ __STATIC_INLINE void ek_list_init(ek_list_node_t *head) * @param prev 前一个节点(插入位置之前) * @param next 后一个节点(插入位置之后) */ -__STATIC_INLINE void __ek_list_add(ek_list_node_t *new_node, ek_list_node_t *prev, ek_list_node_t *next) +__EK_STATIC_INLINE void __ek_list_add(ek_list_node_t *new_node, ek_list_node_t *prev, ek_list_node_t *next) { prev->next = new_node; new_node->next = next; @@ -98,7 +98,7 @@ __STATIC_INLINE void __ek_list_add(ek_list_node_t *new_node, ek_list_node_t *pre * @param head 链表头节点指针 * @param new_node 要添加的新节点 */ -__STATIC_INLINE void ek_list_add_head(ek_list_node_t *head, ek_list_node_t *new_node) +__EK_STATIC_INLINE void ek_list_add_head(ek_list_node_t *head, ek_list_node_t *new_node) { __ek_list_add(new_node, head, head->next); } @@ -108,7 +108,7 @@ __STATIC_INLINE void ek_list_add_head(ek_list_node_t *head, ek_list_node_t *new_ * @param head 链表头节点指针 * @param new_node 要添加的新节点 */ -__STATIC_INLINE void ek_list_add_tail(ek_list_node_t *head, ek_list_node_t *new_node) +__EK_STATIC_INLINE void ek_list_add_tail(ek_list_node_t *head, ek_list_node_t *new_node) { __ek_list_add(new_node, head->prev, head); } @@ -118,7 +118,7 @@ __STATIC_INLINE void ek_list_add_tail(ek_list_node_t *head, ek_list_node_t *new_ * @param prev 前一个节点 * @param next 后一个节点 */ -__STATIC_INLINE void __ek_list_remove(ek_list_node_t *prev, ek_list_node_t *next) +__EK_STATIC_INLINE void __ek_list_remove(ek_list_node_t *prev, ek_list_node_t *next) { next->prev = prev; prev->next = next; @@ -130,7 +130,7 @@ __STATIC_INLINE void __ek_list_remove(ek_list_node_t *prev, ek_list_node_t *next * * @note 移除后节点的 prev 和 next 被置为 NULL,可用于检测节点是否在链表中 */ -__STATIC_INLINE void ek_list_remove(ek_list_node_t *remove) +__EK_STATIC_INLINE void ek_list_remove(ek_list_node_t *remove) { __ek_list_remove(remove->prev, remove->next); remove->prev = NULL; @@ -143,7 +143,7 @@ __STATIC_INLINE void ek_list_remove(ek_list_node_t *remove) * @return true 链表为空 * @return false 链表非空 */ -__STATIC_INLINE bool ek_list_empty(ek_list_node_t *head) +__EK_STATIC_INLINE bool ek_list_empty(ek_list_node_t *head) { return head->next == head; } @@ -155,7 +155,7 @@ __STATIC_INLINE bool ek_list_empty(ek_list_node_t *head) * @return true 是最后一个节点 * @return false 不是最后一个节点 */ -__STATIC_INLINE bool ek_list_is_last(ek_list_node_t *list, ek_list_node_t *head) +__EK_STATIC_INLINE bool ek_list_is_last(ek_list_node_t *list, ek_list_node_t *head) { return list->next == head; } @@ -165,7 +165,7 @@ __STATIC_INLINE bool ek_list_is_last(ek_list_node_t *list, ek_list_node_t *head) * @param head 链表头节点指针 * @return 第一个节点指针,如果链表为空则返回 head */ -__STATIC_INLINE ek_list_node_t *ek_list_get_first(ek_list_node_t *head) +__EK_STATIC_INLINE ek_list_node_t *ek_list_get_first(ek_list_node_t *head) { return head->next; } @@ -175,7 +175,7 @@ __STATIC_INLINE ek_list_node_t *ek_list_get_first(ek_list_node_t *head) * @param head 链表头节点指针 * @return 最后一个节点指针,如果链表为空则返回 head */ -__STATIC_INLINE ek_list_node_t *ek_list_get_last(ek_list_node_t *head) +__EK_STATIC_INLINE ek_list_node_t *ek_list_get_last(ek_list_node_t *head) { return head->prev; } diff --git a/L2_Core/utils/inc/ek_log.h b/L2_Core/utils/inc/ek_log.h index a754919..c632bfe 100644 --- a/L2_Core/utils/inc/ek_log.h +++ b/L2_Core/utils/inc/ek_log.h @@ -15,7 +15,7 @@ #ifndef EK_LOG_H #define EK_LOG_H -#include "../../../ek_conf.h" +#include "ek_conf.h" #if EK_LOG_ENABLE == 1 diff --git a/L2_Core/utils/inc/ek_mem.h b/L2_Core/utils/inc/ek_mem.h index efaff0e..840b72d 100644 --- a/L2_Core/utils/inc/ek_mem.h +++ b/L2_Core/utils/inc/ek_mem.h @@ -10,7 +10,7 @@ #define EK_MEM_H #include "ek_def.h" -#include "../../../ek_conf.h" +#include "ek_conf.h" #ifndef EK_HEAP_NO_TLSF # define EK_HEAP_NO_TLSF 0 /* 默认使用 TLSF 内存分配器 */ diff --git a/L2_Core/utils/inc/ek_ringbuf.h b/L2_Core/utils/inc/ek_ringbuf.h index 860d1e8..ee9160e 100644 --- a/L2_Core/utils/inc/ek_ringbuf.h +++ b/L2_Core/utils/inc/ek_ringbuf.h @@ -9,7 +9,7 @@ #ifndef EK_RINGBUF_H #define EK_RINGBUF_H -#include "../../../ek_conf.h" +#include "ek_conf.h" #if EK_RINGBUF_ENABLE == 1 diff --git a/L2_Core/utils/inc/ek_shell.h b/L2_Core/utils/inc/ek_shell.h index 9437656..7ab21a7 100644 --- a/L2_Core/utils/inc/ek_shell.h +++ b/L2_Core/utils/inc/ek_shell.h @@ -20,7 +20,7 @@ #if EK_SHELL_ENABLE == 1 -#include "../../third_party/letter_shell/inc/shell.h" +#include "shell.h" /** * @brief 导出整型变量到 Shell diff --git a/L2_Core/utils/inc/ek_stack.h b/L2_Core/utils/inc/ek_stack.h index 9555728..0b9632f 100644 --- a/L2_Core/utils/inc/ek_stack.h +++ b/L2_Core/utils/inc/ek_stack.h @@ -16,7 +16,7 @@ #ifndef EK_STACK_H #define EK_STACK_H -#include "../../../ek_conf.h" +#include "ek_conf.h" #if EK_STACK_ENABLE == 1 diff --git a/L2_Core/utils/inc/ek_str.h b/L2_Core/utils/inc/ek_str.h index b14877b..2c71ede 100644 --- a/L2_Core/utils/inc/ek_str.h +++ b/L2_Core/utils/inc/ek_str.h @@ -15,7 +15,7 @@ #ifndef EK_STR_H #define EK_STR_H -#include "../../../ek_conf.h" +#include "ek_conf.h" #if EK_STR_ENABLE == 1 diff --git a/L2_Core/utils/inc/ek_vec.h b/L2_Core/utils/inc/ek_vec.h index 119bc99..a0da06e 100644 --- a/L2_Core/utils/inc/ek_vec.h +++ b/L2_Core/utils/inc/ek_vec.h @@ -13,7 +13,7 @@ #ifndef EK_VEC_H #define EK_VEC_H -#include "../../../ek_conf.h" +#include "ek_conf.h" #if EK_VEC_ENABLE == 1 diff --git a/L2_Core/utils/src/ek_assert.c b/L2_Core/utils/src/ek_assert.c index fef0a5e..e63c420 100644 --- a/L2_Core/utils/src/ek_assert.c +++ b/L2_Core/utils/src/ek_assert.c @@ -4,8 +4,8 @@ * @author N1netyNine99 */ -#include "../inc/ek_assert.h" -#include "../inc/ek_log.h" +#include "ek_assert.h" +#include "ek_log.h" void ek_assert_fault(const char *file, uint32_t line, const char *expr) { @@ -13,9 +13,9 @@ void ek_assert_fault(const char *file, uint32_t line, const char *expr) EK_LOG_FILE_TAG("ek_assert.c"); EK_LOG_ERROR("file:%s,line:%" PRIu32 ",expr: %s", EK_GET_FILE_NAME(file), line, expr); #else - __UNUSED(file); - __UNUSED(line); - __UNUSED(expr); + __EK_UNUSED(file); + __EK_UNUSED(line); + __EK_UNUSED(expr); #endif /* EK_ASSERT_WITH_LOG */ while (1) diff --git a/L2_Core/utils/src/ek_export.c b/L2_Core/utils/src/ek_export.c index 72f3225..46f870b 100644 --- a/L2_Core/utils/src/ek_export.c +++ b/L2_Core/utils/src/ek_export.c @@ -4,7 +4,7 @@ * @author N1netyNine99 */ -#include "../inc/ek_export.h" +#include "ek_export.h" #if (EK_EXPORT_ENABLE == 1) diff --git a/L2_Core/utils/src/ek_io.c b/L2_Core/utils/src/ek_io.c index 1fce611..a9aea34 100644 --- a/L2_Core/utils/src/ek_io.c +++ b/L2_Core/utils/src/ek_io.c @@ -4,20 +4,20 @@ * @author N1netyNine99 */ -#include "../inc/ek_io.h" +#include "ek_io.h" #if EK_IO_NO_LWPRTF == 0 # include "../inc/ek_def.h" -__WEAK void _ek_io_fputc(int ch) +__EK_WEAK void _ek_io_fputc(int ch) { - __UNUSED(ch); + __EK_UNUSED(ch); } static int _ek_io_printf(int ch, lwprintf_t *lwp) { - __UNUSED(lwp); + __EK_UNUSED(lwp); if (ch != '\0') { _ek_io_fputc(ch); diff --git a/L2_Core/utils/src/ek_log.c b/L2_Core/utils/src/ek_log.c index 5b9a5e8..063a7f2 100644 --- a/L2_Core/utils/src/ek_log.c +++ b/L2_Core/utils/src/ek_log.c @@ -4,7 +4,7 @@ * @author N1netyNine99 */ -#include "../inc/ek_log.h" +#include "ek_log.h" #if EK_LOG_ENABLE == 1 @@ -34,7 +34,7 @@ static const char *ek_log_type_table[EK_LOG_TYPE_MAX] = { static char ek_log_buffer[EK_LOG_BUFFER_SIZE]; -__WEAK uint32_t _ek_log_get_tick(void) +__EK_WEAK uint32_t _ek_log_get_tick(void) { return 0; } diff --git a/L2_Core/utils/src/ek_mem.c b/L2_Core/utils/src/ek_mem.c index 26f0e6c..06f9291 100644 --- a/L2_Core/utils/src/ek_mem.c +++ b/L2_Core/utils/src/ek_mem.c @@ -4,7 +4,7 @@ * @author N1netyNine99 */ -#include "../inc/ek_mem.h" +#include "ek_mem.h" #if EK_HEAP_NO_TLSF == 0 @@ -66,17 +66,17 @@ tlsf_t ek_default_tlsf; static size_t ek_unused_bytes = 0; static size_t ek_used_bytes = 0; -__WEAK void *_ek_malloc(size_t size) +__EK_WEAK void *_ek_malloc(size_t size) { return tlsf_malloc(ek_default_tlsf, size); } -__WEAK void *_ek_realloc(void *ptr, size_t size) +__EK_WEAK void *_ek_realloc(void *ptr, size_t size) { return tlsf_realloc(ek_default_tlsf, ptr, size); } -__WEAK void _ek_free(void *ptr) +__EK_WEAK void _ek_free(void *ptr) { tlsf_free(ek_default_tlsf, ptr); } @@ -84,8 +84,8 @@ __WEAK void _ek_free(void *ptr) // walker 函数:统计空闲内存 static void ek_mem_walker(void *ptr, size_t size, int used, void *user) { - __UNUSED(ptr); - __UNUSED(user); + __EK_UNUSED(ptr); + __EK_UNUSED(user); if (!used) { diff --git a/L2_Core/utils/src/ek_ringbuf.c b/L2_Core/utils/src/ek_ringbuf.c index a5e379b..eb3dbdc 100644 --- a/L2_Core/utils/src/ek_ringbuf.c +++ b/L2_Core/utils/src/ek_ringbuf.c @@ -4,7 +4,7 @@ * @author N1netyNine99 */ -#include "../inc/ek_ringbuf.h" +#include "ek_ringbuf.h" #if EK_RINGBUF_ENABLE == 1 diff --git a/L2_Core/utils/src/ek_stack.c b/L2_Core/utils/src/ek_stack.c index fa6ce1a..ee0c32a 100644 --- a/L2_Core/utils/src/ek_stack.c +++ b/L2_Core/utils/src/ek_stack.c @@ -4,7 +4,7 @@ * @author N1netyNine99 */ -#include "../inc/ek_stack.h" +#include "ek_stack.h" #if EK_STACK_ENABLE == 1 diff --git a/L2_Core/utils/src/ek_str.c b/L2_Core/utils/src/ek_str.c index 3e4eebb..b54e42d 100644 --- a/L2_Core/utils/src/ek_str.c +++ b/L2_Core/utils/src/ek_str.c @@ -4,7 +4,7 @@ * @author N1netyNine99 */ -#include "../inc/ek_str.h" +#include "ek_str.h" #if EK_STR_ENABLE == 1 diff --git a/Test/CMakeLists.txt b/Test/CMakeLists.txt index 73077ad..6155db7 100644 --- a/Test/CMakeLists.txt +++ b/Test/CMakeLists.txt @@ -26,12 +26,13 @@ list(APPEND TestSrc "${CMAKE_CURRENT_SOURCE_DIR}/shell_symbols.c") add_executable(${CMAKE_PROJECT_NAME} ${TestSrc} ${L2_TestSrc} ${L2_TestSrc_3rd}) -include_directories( ${CMAKE_PROJECT_NAME} PRIVATE - ${CMAKE_PROJECT_NAME}/../L2_Core/utils/inc - ${CMAKE_PROJECT_NAME}/../L2_Core/third_party/tlsf - ${CMAKE_PROJECT_NAME}/../L2_Core/third_party/lwprintf/inc - ${CMAKE_PROJECT_NAME}/../L2_Core/third_party/letter_shell/inc - ${CMAKE_PROJECT_NAME} +target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_SOURCE_DIR}/../L2_Core/utils/inc + ${CMAKE_CURRENT_SOURCE_DIR}/../L2_Core/third_party/tlsf + ${CMAKE_CURRENT_SOURCE_DIR}/../L2_Core/third_party/lwprintf/inc + ${CMAKE_CURRENT_SOURCE_DIR}/../L2_Core/third_party/letter_shell/inc + ${CMAKE_CURRENT_SOURCE_DIR} ) target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE @@ -44,4 +45,3 @@ target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE $<$:-O0 -g3> $<$:-O3> ) - diff --git a/Test/shell_symbols.c b/Test/shell_symbols.c index 08776bb..90eeae5 100644 --- a/Test/shell_symbols.c +++ b/Test/shell_symbols.c @@ -9,7 +9,7 @@ */ #include -#include "../L2_Core/third_party/letter_shell/inc/shell.h" +#include "shell.h" /* 为测试环境提供shell命令段符号(空段) */ #if defined(__GNUC__) && !defined(__ARMCC_VERSION) diff --git a/Test/test.h b/Test/test.h index 39d4c40..7ab092f 100644 --- a/Test/test.h +++ b/Test/test.h @@ -3,15 +3,15 @@ #include -#include "../L2_Core/utils/inc/ek_io.h" -#include "../L2_Core/utils/inc/ek_mem.h" -#include "../L2_Core/utils/inc/ek_def.h" -#include "../L2_Core/utils/inc/ek_stack.h" -#include "../L2_Core/utils/inc/ek_log.h" -#include "../L2_Core/utils/inc/ek_ringbuf.h" -#include "../L2_Core/utils/inc/ek_vec.h" -#include "../L2_Core/utils/inc/ek_assert.h" -#include "../L2_Core/utils/inc/ek_str.h" +#include "ek_io.h" +#include "ek_mem.h" +#include "ek_def.h" +#include "ek_stack.h" +#include "ek_log.h" +#include "ek_ringbuf.h" +#include "ek_vec.h" +#include "ek_assert.h" +#include "ek_str.h" #define PI (3.141592f)