Skip to content

Commit 4167d62

Browse files
committed
hal: gd32e10x: set marco based on HXTAL_VALUE.
add HXTAL_VALUE_8M and HXTAL_VALUE_25M marco by HXTAL_VALUE. Signed-off-by: YuLong Yao <[email protected]>
1 parent 9ab0dac commit 4167d62

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ OF SUCH DAMAGE.
6060
#error "Please select the target board type used in your application (in gd32e10x.h file)"
6161
#endif
6262
#endif /* high speed crystal oscillator value */
63+
64+
#if HXTAL_VALUE == 8000000
65+
#define HXTAL_VALUE_8M HXTAL_VALUE
66+
#elif HXTAL_VALUE == 25000000
67+
#define HXTAL_VALUE_25M HXTAL_VALUE
68+
#else
69+
#error "GD32E10X lib only support 8M and 25M oscillator (HXTAL)"
70+
#endif
6371

6472
/* define startup timeout value of high speed crystal oscillator (HXTAL) */
6573
#if !defined (HXTAL_STARTUP_TIMEOUT)

0 commit comments

Comments
 (0)