Skip to content

Commit

Permalink
[src/ktime] fix the bug when use keil AC6 and open RT_USING_HOOKLIST … (
Browse files Browse the repository at this point in the history
#9993)

* [src/ktime] fix the bug when use keil AC6 and open RT_USING_HOOKLIST and RT_USING_KTIME
  • Loading branch information
supperthomas authored Feb 16, 2025
1 parent c40b790 commit 5b33206
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bsp/stm32/stm32h750-artpi/rtconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
PLATFORM = 'gcc'
EXEC_PATH = r'/opt/gcc-arm-none-eabi/bin/'
elif CROSS_TOOL == 'keil':
PLATFORM = 'armcc'
PLATFORM = 'armclang' #KEIL AC6
EXEC_PATH = r'C:/Keil_v5'
elif CROSS_TOOL == 'iar':
PLATFORM = 'iccarm'
EXEC_PATH = r'C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.3'

if os.getenv('RTT_EXEC_PATH'):
if os.getenv('RTT_EXEC_PATH') and (CROSS_TOOL == 'gcc'):
EXEC_PATH = os.getenv('RTT_EXEC_PATH')

BUILD = 'debug'
Expand Down
7 changes: 6 additions & 1 deletion components/drivers/ktime/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ if rtconfig.ARCH in list:
else:
src += Glob("src/" + rtconfig.ARCH + "/*.c")
CPPPATH = [cwd, cwd + "/inc"]
LOCAL_CCFLAGS = ''
if rtconfig.PLATFORM in ['gcc', 'armclang']:
LOCAL_CCFLAGS += ' -std=gnu99'
elif rtconfig.PLATFORM in ['armcc']:
LOCAL_CCFLAGS += ' --c99 --gnu'

group = DefineGroup('ktime', src, depend=['RT_USING_KTIME'], CPPPATH=CPPPATH)
group = DefineGroup('ktime', src, depend=['RT_USING_KTIME'], CPPPATH=CPPPATH, LOCAL_CCFLAGS = LOCAL_CCFLAGS)

Return('group')
6 changes: 6 additions & 0 deletions src/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ if rtconfig.PLATFORM in ['gcc']: # only for GCC
if rtconfig.ARCH not in ['sim']:
LINKFLAGS += ' -Wl,--gc-sections,--print-memory-usage' # remove unused sections and print memory usage

if GetDepend('RT_USING_HOOKLIST') == True:
if rtconfig.PLATFORM in ['gcc', 'armclang']:
LOCAL_CFLAGS += ' -std=gnu99'
elif rtconfig.PLATFORM in ['armcc']:
LOCAL_CFLAGS += ' --c99 --gnu'

group = DefineGroup('Kernel', src, depend=[''], CPPPATH=inc,
LINKFLAGS=LINKFLAGS, LOCAL_CFLAGS=LOCAL_CFLAGS,
CPPDEFINES=['__RTTHREAD__'], LOCAL_CPPDEFINES=['__RT_KERNEL_SOURCE__'])
Expand Down

0 comments on commit 5b33206

Please sign in to comment.