diff --git a/components/drivers/watchdog/Kconfig b/components/drivers/watchdog/Kconfig index b70d465dfd..29c2a4a9e3 100644 --- a/components/drivers/watchdog/Kconfig +++ b/components/drivers/watchdog/Kconfig @@ -1,3 +1,7 @@ -config RT_USING_WDT +menuconfig RT_USING_WDT bool "Using Watch Dog device drivers" default n + +if RT_USING_DM && RT_USING_WDT + osource "$(SOC_DM_WDT_DIR)/Kconfig" +endif diff --git a/components/drivers/watchdog/SConscript b/components/drivers/watchdog/SConscript index 38934d3c41..f7a257a772 100644 --- a/components/drivers/watchdog/SConscript +++ b/components/drivers/watchdog/SConscript @@ -1,8 +1,16 @@ from building import * -cwd = GetCurrentDir() -src = Glob('*.c') +group = [] + +if not GetDepend(['RT_USING_WDT']): + Return('group') + +cwd = GetCurrentDir() +list = os.listdir(cwd) CPPPATH = [cwd + '/../include'] -group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_WDT'], CPPPATH = CPPPATH) + +src = ['dev_watchdog.c'] + +group = DefineGroup('DeviceDrivers', src, depend = [''], CPPPATH = CPPPATH) Return('group')