From 96dd783f37d44556c8d470a13b45b6bd4e28ac2c Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Fri, 6 May 2022 15:50:57 -0400 Subject: [PATCH] [cmsis] avoid conflict between cmsis5 and bsp cmsis --- bsp/stm32/libraries/STM32F0xx_HAL/SConscript | 6 ++++-- bsp/stm32/libraries/STM32F1xx_HAL/SConscript | 6 ++++-- bsp/stm32/libraries/STM32F2xx_HAL/SConscript | 6 ++++-- bsp/stm32/libraries/STM32F3xx_HAL/SConscript | 6 ++++-- bsp/stm32/libraries/STM32F4xx_HAL/SConscript | 6 ++++-- bsp/stm32/libraries/STM32F7xx_HAL/SConscript | 6 ++++-- bsp/stm32/libraries/STM32G0xx_HAL/SConscript | 6 ++++-- bsp/stm32/libraries/STM32G4xx_HAL/SConscript | 6 ++++-- bsp/stm32/libraries/STM32H7xx_HAL/SConscript | 6 ++++-- bsp/stm32/libraries/STM32L0xx_HAL/SConscript | 6 ++++-- bsp/stm32/libraries/STM32L1xx_HAL/SConscript | 8 ++++---- bsp/stm32/libraries/STM32L4xx_HAL/SConscript | 8 ++++---- bsp/stm32/libraries/STM32L5xx_HAL/SConscript | 8 ++++---- bsp/stm32/libraries/STM32MPxx_HAL/SConscript | 7 ++++--- bsp/stm32/libraries/STM32U5xx_HAL/SConscript | 8 ++++---- bsp/stm32/libraries/STM32WBxx_HAL/SConscript | 9 ++++----- bsp/stm32/libraries/STM32WLxx_HAL/SConscript | 6 ++++-- 17 files changed, 68 insertions(+), 46 deletions(-) diff --git a/bsp/stm32/libraries/STM32F0xx_HAL/SConscript b/bsp/stm32/libraries/STM32F0xx_HAL/SConscript index b6445d228a..7cf2b90ac7 100644 --- a/bsp/stm32/libraries/STM32F0xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32F0xx_HAL/SConscript @@ -77,8 +77,10 @@ if GetDepend(['BSP_USING_ON_CHIP_FLASH']): src += ['STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c'] path = [cwd + '/CMSIS/Device/ST/STM32F0xx/Include', - cwd + '/STM32F0xx_HAL_Driver/Inc', - cwd + '/CMSIS/Include'] + cwd + '/STM32F0xx_HAL_Driver/Inc'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32F1xx_HAL/SConscript b/bsp/stm32/libraries/STM32F1xx_HAL/SConscript index 135bb2e98c..41c4a1ce00 100644 --- a/bsp/stm32/libraries/STM32F1xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32F1xx_HAL/SConscript @@ -83,8 +83,10 @@ if GetDepend(['BSP_USING_ON_CHIP_FLASH']): src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c'] path = [cwd + '/CMSIS/Device/ST/STM32F1xx/Include', - cwd + '/STM32F1xx_HAL_Driver/Inc', - cwd + '/CMSIS/Include'] + cwd + '/STM32F1xx_HAL_Driver/Inc'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32F2xx_HAL/SConscript b/bsp/stm32/libraries/STM32F2xx_HAL/SConscript index bf11a01ddc..5689a879ad 100644 --- a/bsp/stm32/libraries/STM32F2xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32F2xx_HAL/SConscript @@ -78,8 +78,10 @@ if GetDepend(['BSP_USING_ON_CHIP_FLASH']): src += ['STM32F2xx_HAL_Driver/Src/stm32f2xx_hal_flash_ex.c'] path = [cwd + '/CMSIS/Device/ST/STM32F2xx/Include', - cwd + '/STM32F2xx_HAL_Driver/Inc', - cwd + '/CMSIS/Include'] + cwd + '/STM32F2xx_HAL_Driver/Inc'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32F3xx_HAL/SConscript b/bsp/stm32/libraries/STM32F3xx_HAL/SConscript index 4f48470a5c..6607603325 100644 --- a/bsp/stm32/libraries/STM32F3xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32F3xx_HAL/SConscript @@ -81,8 +81,10 @@ if GetDepend(['BSP_USING_ON_CHIP_FLASH']): src += ['STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c'] path = [cwd + '/STM32F3xx_HAL_Driver/Inc', - cwd + '/CMSIS/Device/ST/STM32F3xx/Include', - cwd + '/CMSIS/Include'] + cwd + '/CMSIS/Device/ST/STM32F3xx/Include'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32F4xx_HAL/SConscript b/bsp/stm32/libraries/STM32F4xx_HAL/SConscript index 754566e54c..8744c47b66 100644 --- a/bsp/stm32/libraries/STM32F4xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32F4xx_HAL/SConscript @@ -109,8 +109,10 @@ if GetDepend(['BSP_USING_LTDC']): src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dsi.c'] path = [cwd + '/STM32F4xx_HAL_Driver/Inc', - cwd + '/CMSIS/Device/ST/STM32F4xx/Include', - cwd + '/CMSIS/Include'] + cwd + '/CMSIS/Device/ST/STM32F4xx/Include'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32F7xx_HAL/SConscript b/bsp/stm32/libraries/STM32F7xx_HAL/SConscript index 4be713b82e..4b74f178fb 100644 --- a/bsp/stm32/libraries/STM32F7xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32F7xx_HAL/SConscript @@ -102,8 +102,10 @@ if GetDepend(['BSP_USING_LTDC']): src += ['STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dsi.c'] path = [cwd + '/STM32F7xx_HAL_Driver/Inc', - cwd + '/CMSIS/Device/ST/STM32F7xx/Include', - cwd + '/CMSIS/Include'] + cwd + '/CMSIS/Device/ST/STM32F7xx/Include'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32G0xx_HAL/SConscript b/bsp/stm32/libraries/STM32G0xx_HAL/SConscript index c2ffc079f7..9212a49ac8 100644 --- a/bsp/stm32/libraries/STM32G0xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32G0xx_HAL/SConscript @@ -56,8 +56,10 @@ if GetDepend(['RT_USING_RTC']): src += ['STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rtc.c'] path = [cwd + '/STM32G0xx_HAL_Driver/Inc', - cwd + '/CMSIS/Device/ST/STM32G0xx/Include', - cwd + '/CMSIS/Include'] + cwd + '/CMSIS/Device/ST/STM32G0xx/Include'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32G4xx_HAL/SConscript b/bsp/stm32/libraries/STM32G4xx_HAL/SConscript index 52d68e9609..9f5b3eacdf 100644 --- a/bsp/stm32/libraries/STM32G4xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32G4xx_HAL/SConscript @@ -106,8 +106,10 @@ if GetDepend(['BSP_USING_LTDC']): src += ['STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_dsi.c'] path = [cwd + '/STM32G4xx_HAL_Driver/Inc', - cwd + '/CMSIS/Device/ST/STM32G4xx/Include', - cwd + '/CMSIS/Include'] + cwd + '/CMSIS/Device/ST/STM32G4xx/Include'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32H7xx_HAL/SConscript b/bsp/stm32/libraries/STM32H7xx_HAL/SConscript index fd0359b3e9..d8f35eec07 100644 --- a/bsp/stm32/libraries/STM32H7xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32H7xx_HAL/SConscript @@ -108,8 +108,10 @@ if GetDepend(['BSP_USING_DCMI']): src += ['STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dcmi.c'] path = [cwd + '/STM32H7xx_HAL_Driver/Inc', - cwd + '/CMSIS/Device/ST/STM32H7xx/Include', - cwd + '/CMSIS/Include'] + cwd + '/CMSIS/Device/ST/STM32H7xx/Include'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32L0xx_HAL/SConscript b/bsp/stm32/libraries/STM32L0xx_HAL/SConscript index 804020e782..104fa80dc3 100644 --- a/bsp/stm32/libraries/STM32L0xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32L0xx_HAL/SConscript @@ -84,8 +84,10 @@ if GetDepend(['BSP_USING_ON_CHIP_FLASH']): src += ['STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_flash_ramfunc.c'] path = [cwd + '/STM32L0xx_HAL_Driver/Inc', - cwd + '/CMSIS/Device/ST/STM32L0xx/Include', - cwd + '/CMSIS/Include'] + cwd + '/CMSIS/Device/ST/STM32L0xx/Include'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32L1xx_HAL/SConscript b/bsp/stm32/libraries/STM32L1xx_HAL/SConscript index 9c3cd96838..c829a0a592 100644 --- a/bsp/stm32/libraries/STM32L1xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32L1xx_HAL/SConscript @@ -66,15 +66,15 @@ if GetDepend(['RT_USING_SDIO']): if GetDepend(['RT_USING_AUDIO']): src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_i2s.c'] - - if GetDepend(['BSP_USING_ON_CHIP_FLASH']): src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_flash.c'] src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_flash_ex.c'] path = [cwd + '/CMSIS/Device/ST/STM32L1xx/Include', - cwd + '/STM32L1xx_HAL_Driver/Inc', - cwd + '/CMSIS/Include'] + cwd + '/STM32L1xx_HAL_Driver/Inc'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32L4xx_HAL/SConscript b/bsp/stm32/libraries/STM32L4xx_HAL/SConscript index 134b47cf52..261e4e5ac3 100644 --- a/bsp/stm32/libraries/STM32L4xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32L4xx_HAL/SConscript @@ -109,12 +109,12 @@ if GetDepend(['BSP_USING_DSI']): if GetDepend(['BSP_USING_SRAM']): src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sram.c'] - - path = [cwd + '/STM32L4xx_HAL_Driver/Inc', - cwd + '/CMSIS/Device/ST/STM32L4xx/Include', - cwd + '/CMSIS/Include'] + cwd + '/CMSIS/Device/ST/STM32L4xx/Include'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32L5xx_HAL/SConscript b/bsp/stm32/libraries/STM32L5xx_HAL/SConscript index 5b295a278d..7c5eebbbcf 100644 --- a/bsp/stm32/libraries/STM32L5xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32L5xx_HAL/SConscript @@ -109,12 +109,12 @@ if GetDepend(['BSP_USING_DSI']): if GetDepend(['BSP_USING_SRAM']): src += ['STM32L5xx_HAL_Driver/Src/stm32l5xx_hal_sram.c'] - - path = [cwd + '/STM32L5xx_HAL_Driver/Inc', - cwd + '/CMSIS/Device/ST/STM32L5xx/Include', - cwd + '/CMSIS/Include'] + cwd + '/CMSIS/Device/ST/STM32L5xx/Include'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32MPxx_HAL/SConscript b/bsp/stm32/libraries/STM32MPxx_HAL/SConscript index 746d835326..b6128ac2ff 100644 --- a/bsp/stm32/libraries/STM32MPxx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32MPxx_HAL/SConscript @@ -124,9 +124,10 @@ if GetDepend(['BSP_USING_RTC']): src += ['STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_rtc_ex.c'] path = [cwd + '/STM32MP1xx_HAL_Driver/Inc', - cwd + '/CMSIS/Device/ST/STM32MP1xx/Include', - cwd + '/CMSIS/Core/Include', - cwd + '/CMSIS/Include'] + cwd + '/CMSIS/Device/ST/STM32MP1xx/Include'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32U5xx_HAL/SConscript b/bsp/stm32/libraries/STM32U5xx_HAL/SConscript index 48c3031026..dc0a80a7f4 100644 --- a/bsp/stm32/libraries/STM32U5xx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32U5xx_HAL/SConscript @@ -111,11 +111,11 @@ if GetDepend(['BSP_USING_DSI']): if GetDepend(['BSP_USING_SRAM']): src += ['STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_sram.c'] - - path = [cwd + '/STM32U5xx_HAL_Driver/Inc', - cwd + '/CMSIS/Device/ST/STM32U5xx/Include', - cwd + '/CMSIS/Include'] + cwd + '/CMSIS/Device/ST/STM32U5xx/Include'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32WBxx_HAL/SConscript b/bsp/stm32/libraries/STM32WBxx_HAL/SConscript index 9245975aee..b989bfd63b 100644 --- a/bsp/stm32/libraries/STM32WBxx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32WBxx_HAL/SConscript @@ -76,13 +76,12 @@ if GetDepend(['BSP_USING_ON_CHIP_FLASH']): src += ['STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash.c'] src += ['STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash_ex.c'] # src += ['STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_flash_ramfunc.c'] - - - path = [cwd + '/STM32WBxx_HAL_Driver/Inc', - cwd + '/CMSIS/Device/ST/STM32WBxx/Include', - cwd + '/CMSIS/Include'] + cwd + '/CMSIS/Device/ST/STM32WBxx/Include'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) diff --git a/bsp/stm32/libraries/STM32WLxx_HAL/SConscript b/bsp/stm32/libraries/STM32WLxx_HAL/SConscript index 1df3fa86a9..fe1549907b 100644 --- a/bsp/stm32/libraries/STM32WLxx_HAL/SConscript +++ b/bsp/stm32/libraries/STM32WLxx_HAL/SConscript @@ -69,8 +69,10 @@ if GetDepend(['BSP_USING_SUBGHZ']): src += ['STM32WLxx_HAL_Driver/Src/stm32wlxx_hal_subghz.c'] path = [cwd + '/STM32WLxx_HAL_Driver/Inc', - cwd + '/CMSIS/Device/ST/STM32WLxx/Include', - cwd + '/CMSIS/Include'] + cwd + '/CMSIS/Device/ST/STM32WLxx/Include'] + +if not GetDepend('PKG_CMSIS_CORE'): + path += [cwd + '/CMSIS/Include'] CPPDEFINES = ['USE_HAL_DRIVER'] group = DefineGroup('STM32_HAL', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) -- GitLab