From 5e8871e1a28ec55b5435536fe6ba09f000b03e15 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Thu, 21 Apr 2022 14:03:04 -0400 Subject: [PATCH] [iar] add CLOCKS_PER_SEC https://www.iar.com/knowledge/learn/programming/using-c-standard-library-time-and-clock-functions/ --- components/libc/compilers/common/SConscript | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index 9c3229eb5d..cf57f2abc3 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -9,6 +9,8 @@ CPPDEFINES = [] if rtconfig.PLATFORM in ['armcc', 'armclang']: CPPDEFINES += ['__CLK_TCK=RT_TICK_PER_SECOND'] +elif rtconfig.PLATFORM == 'iar': + CPPDEFINES += ['CLOCKS_PER_SEC=RT_TICK_PER_SECOND'] # forcly revert to 1 by IAR src += Glob('*.c')