From c258ca794d6aeb84d35099781e066cf8b60ebb6a Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Wed, 10 Jan 2018 10:54:45 +0800 Subject: [PATCH 1/2] Fix-IAR-Version-Problem [dlib/sys/time.h] Fix iar version problem [bsp/stm32f429-apollo/applications/SConscript] Remove CPPDEFINES --- bsp/stm32f429-apollo/applications/SConscript | 8 +------- components/libc/compilers/dlib/sys/time.h | 4 ++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bsp/stm32f429-apollo/applications/SConscript b/bsp/stm32f429-apollo/applications/SConscript index c9f4e204a..52ec60a5c 100644 --- a/bsp/stm32f429-apollo/applications/SConscript +++ b/bsp/stm32f429-apollo/applications/SConscript @@ -8,16 +8,10 @@ application.c startup.c """) -# add for startup script -if rtconfig.CROSS_TOOL == 'iar': - CPPDEFINES = ['_TIMESPEC_DEFINED'] -else: - CPPDEFINES = [] - # add UI engine demo. if GetDepend('RT_USING_GUIENGINE'): src += ['rtgui_demo.c'] -group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES) +group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) Return('group') diff --git a/components/libc/compilers/dlib/sys/time.h b/components/libc/compilers/dlib/sys/time.h index 2d60b3731..ac5274506 100644 --- a/components/libc/compilers/dlib/sys/time.h +++ b/components/libc/compilers/dlib/sys/time.h @@ -20,6 +20,10 @@ struct timeval { }; #endif /* _TIMEVAL_DEFINED */ +#if defined ( __ICCARM__ ) && (__VER__ >= 8011002) +#define _TIMESPEC_DEFINED +#endif + #ifndef _TIMESPEC_DEFINED #define _TIMESPEC_DEFINED /* From 472491e7ca4ffa5b64b6dce735c5f736c8ebdcbe Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Wed, 10 Jan 2018 15:08:14 +0800 Subject: [PATCH 2/2] Fix IAR Version Problem [bsp/lpc54608-LPCXpresso/applications/SConscript] [bsp/imxrt1052-evk/applications/SConscript] --- bsp/imxrt1052-evk/applications/SConscript | 4 +--- bsp/lpc54608-LPCXpresso/applications/SConscript | 8 +------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/bsp/imxrt1052-evk/applications/SConscript b/bsp/imxrt1052-evk/applications/SConscript index 79416cbc8..7725e3b91 100644 --- a/bsp/imxrt1052-evk/applications/SConscript +++ b/bsp/imxrt1052-evk/applications/SConscript @@ -7,9 +7,7 @@ src = Glob('*.c') CPPPATH = [cwd, str(Dir('#'))] # add for startup script -if rtconfig.CROSS_TOOL == 'iar': - CPPDEFINES = ['_TIMESPEC_DEFINED'] -elif rtconfig.CROSS_TOOL == 'gcc': +if rtconfig.CROSS_TOOL == 'gcc': CPPDEFINES = ['__START=entry'] else: CPPDEFINES = [] diff --git a/bsp/lpc54608-LPCXpresso/applications/SConscript b/bsp/lpc54608-LPCXpresso/applications/SConscript index ce2232217..01eb940df 100644 --- a/bsp/lpc54608-LPCXpresso/applications/SConscript +++ b/bsp/lpc54608-LPCXpresso/applications/SConscript @@ -6,12 +6,6 @@ cwd = os.path.join(str(Dir('#')), 'applications') src = Glob('*.c') CPPPATH = [cwd, str(Dir('#'))] -# add for startup script -if rtconfig.CROSS_TOOL == 'iar': - CPPDEFINES = ['_TIMESPEC_DEFINED'] -else: - CPPDEFINES = [] - -group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES) +group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) Return('group')