From 3dbf080698aa6cb5568d52ca9edf508712fa585e Mon Sep 17 00:00:00 2001 From: Michael Hope Date: Mon, 21 Apr 2025 13:27:06 +0000 Subject: [PATCH] hal: wch: widen the checks to include the CH32V family Expand the current systick compatibility to include the CH32V00x series. Change the HAL compatibility to include all of the CH32V family. Signed-off-by: Michael Hope --- drivers/timer/Kconfig.wch_ch32v00x | 4 ++-- modules/hal_wch/CMakeLists.txt | 2 +- modules/hal_wch/ch32fun.h | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/timer/Kconfig.wch_ch32v00x b/drivers/timer/Kconfig.wch_ch32v00x index 6f5bc1e19ea..9387ca395e7 100644 --- a/drivers/timer/Kconfig.wch_ch32v00x +++ b/drivers/timer/Kconfig.wch_ch32v00x @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 config CH32V00X_SYSTICK - bool "CH32V00X systick timer" - depends on SOC_SERIES_QINGKE_V2A || SOC_SERIES_QINGKE_V4C + bool "CH32V QingKe core systick timer" + depends on SOC_SERIES_QINGKE_V2A || SOC_SERIES_QINGKE_V4C || SOC_SERIES_CH32V00X default y depends on DT_HAS_WCH_SYSTICK_ENABLED diff --git a/modules/hal_wch/CMakeLists.txt b/modules/hal_wch/CMakeLists.txt index c2ce8abc3b8..01797436ba8 100644 --- a/modules/hal_wch/CMakeLists.txt +++ b/modules/hal_wch/CMakeLists.txt @@ -1,3 +1,3 @@ -if(CONFIG_SOC_SERIES_QINGKE_V2A OR CONFIG_SOC_SERIES_QINGKE_V4C) +if(CONFIG_SOC_FAMILY_CH32V) zephyr_include_directories(${ZEPHYR_HAL_WCH_MODULE_DIR}/ch32v003fun .) endif() diff --git a/modules/hal_wch/ch32fun.h b/modules/hal_wch/ch32fun.h index 555bcd3e75b..cbe6126e2ab 100644 --- a/modules/hal_wch/ch32fun.h +++ b/modules/hal_wch/ch32fun.h @@ -12,6 +12,11 @@ #include #endif +#if defined(CONFIG_SOC_SERIES_CH32V00X) +#define CH32V003 1 +#include +#endif + #if defined(CONFIG_SOC_SERIES_QINGKE_V4C) #define CH32V20x 1 #include