diff --git a/bsp/stm32f10x/applications/SConscript b/bsp/stm32f10x/applications/SConscript index 01eb940dfb35f92c503a78b0b49a4354590f9f3a..4289435f37c7a062bfeb69f4bc809d2841642bea 100644 --- a/bsp/stm32f10x/applications/SConscript +++ b/bsp/stm32f10x/applications/SConscript @@ -2,8 +2,16 @@ Import('RTT_ROOT') Import('rtconfig') from building import * -cwd = os.path.join(str(Dir('#')), 'applications') -src = Glob('*.c') +cwd = os.path.join(str(Dir('#')), 'applications') + +src = Split(""" +application.c +startup.c +""") + +if GetDepend('RT_USING_CAN'): + src += ['canapp.c'] + CPPPATH = [cwd, str(Dir('#'))] group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) diff --git a/bsp/stm32f10x/drivers/SConscript b/bsp/stm32f10x/drivers/SConscript index 30a848fc40a99cc715935b83d4a78f5f807d8775..6be188e0f07105d3bacc84b7636efe23be51928e 100644 --- a/bsp/stm32f10x/drivers/SConscript +++ b/bsp/stm32f10x/drivers/SConscript @@ -12,6 +12,10 @@ led.c usart.c """) +# add canbus driver. +if GetDepend('RT_USING_CAN'): + src += ['bxcan.c'] + # add Ethernet drivers. if GetDepend('RT_USING_LWIP'): src += ['dm9000a.c'] diff --git a/bsp/stm32f10x/drivers/bxcan.c b/bsp/stm32f10x/drivers/bxcan.c index e19d971123ebc79f2194417eeaa6e5290cc01c77..071d05e8ccc600545dcccc123eb333743f2de175 100644 --- a/bsp/stm32f10x/drivers/bxcan.c +++ b/bsp/stm32f10x/drivers/bxcan.c @@ -1575,4 +1575,4 @@ int stm32_bxcan_init(void) } INIT_BOARD_EXPORT(stm32_bxcan_init); -#endif /*RT_USING_CAN2*/ +#endif /*RT_USING_CAN*/ diff --git a/bsp/stm32f10x/rtconfig.h b/bsp/stm32f10x/rtconfig.h index f4488460019f6de72a107bf352218fa4a31720ad..e2330065099290d67907777ef46372084396d713 100644 --- a/bsp/stm32f10x/rtconfig.h +++ b/bsp/stm32f10x/rtconfig.h @@ -82,7 +82,7 @@ #define RT_USING_PIN -#define RT_USING_CAN +//#define RT_USING_CAN #define RT_CAN_USING_BUS_HOOK