File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,10 @@ config KCONFIG_MAX_10_3_2
115115
116116DT_COMPAT_VND_GPIO := vnd,gpio
117117
118+ config KCONFIG_VND_GPIO_ENABLED_Y
119+ bool
120+ default $(dt_compat_enabled,$(DT_COMPAT_VND_GPIO))
121+
118122config KCONFIG_VND_GPIO_ENABLED_NUM_4
119123 int
120124 default $(dt_compat_enabled_num,$(DT_COMPAT_VND_GPIO))
@@ -125,8 +129,16 @@ config KCONFIG_VND_CAN_CONTROLLER_ENABLED_NUM_2
125129 int
126130 default $(dt_compat_enabled_num,$(DT_COMPAT_VND_CAN_CONTROLLER))
127131
132+ config KCONFIG_VND_CAN_CONTROLLER_ENABLED_Y
133+ bool
134+ default $(dt_compat_enabled,$(DT_COMPAT_VND_CAN_CONTROLLER))
135+
128136DT_COMPAT_VND_PWM := vnd,pwm
129137
138+ config KCONFIG_VND_PWM_ENABLED_N
139+ bool
140+ default $(dt_compat_enabled,$(DT_COMPAT_VND_PWM))
141+
130142config KCONFIG_VND_PWM_ENABLED_NUM_0
131143 int
132144 default $(dt_compat_enabled_num,$(DT_COMPAT_VND_PWM))
Original file line number Diff line number Diff line change @@ -45,6 +45,13 @@ ZTEST(test_kconfig_functions, test_min_max)
4545 zassert_equal (CONFIG_KCONFIG_MAX_10_3_2 , MAX (MAX (10 , 3 ), 2 ));
4646}
4747
48+ ZTEST (test_kconfig_functions , test_dt_compat_enabled )
49+ {
50+ zassert_true (IS_ENABLED (CONFIG_KCONFIG_VND_GPIO_ENABLED_Y ));
51+ zassert_true (IS_ENABLED (CONFIG_KCONFIG_VND_CAN_CONTROLLER_ENABLED_Y ));
52+ zassert_false (IS_ENABLED (CONFIG_KCONFIG_VND_PWM_ENABLED_N ));
53+ }
54+
4855ZTEST (test_kconfig_functions , test_dt_num_compat_enabled )
4956{
5057 zassert_equal (CONFIG_KCONFIG_VND_GPIO_ENABLED_NUM_4 , 4 );
You can’t perform that action at this time.
0 commit comments