Skip to content

Commit 4cc0b4a

Browse files
committed
hal: gd32e10x: get HXTAL_VALUE from KCONFIG.
get HXTAL_VALUE from `CONFIG_GD32_HXTAL_VALUE` Signed-off-by: YuLong Yao <[email protected]>
1 parent c775cb7 commit 4cc0b4a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

gd32e10x/cmsis/gd/gd32e10x/include/gd32e10x.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,15 @@ OF SUCH DAMAGE.
5757
#define HXTAL_VALUE ((uint32_t)25000000) /*!< value of the external oscillator in Hz */
5858
#define HXTAL_VALUE_25M HXTAL_VALUE
5959
#else
60-
#error "Please select the target board type used in your application (in gd32e10x.h file)"
60+
/* get external oscillator from KCONFIG */
61+
#define HXTAL_VALUE CONFIG_GD32_HXTAL_VALUE
62+
#if HXTAL_VALUE == 8000000
63+
#define HXTAL_VALUE_8M HXTAL_VALUE
64+
#elif HXTAL_VALUE == 25000000
65+
#define HXTAL_VALUE_25M HXTAL_VALUE
66+
#else
67+
#error "GD32E10X lib only support 8M and 25M oscillator (HXTAL)"
68+
#endif
6169
#endif
6270
#endif /* high speed crystal oscillator value */
6371

0 commit comments

Comments
 (0)