此帖出自GD32 MCU论坛
最新回复
/* enable the key clock */
rcu_periph_clock_enable(RCU_GPIOB);
rcu_periph_clock_enable(RCU_CFGCMP);
/* configure button pin as input */
gpio_mode_set(GPIOB, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO_PIN_9);
/* enable and set key EXTI interrupt to the lowest priority */
nvic_irq_enable(EXTI4_15_IRQn, 2U, 0U);
/* connect key EXTI line to key GPIO pin */
syscfg_exti_line_config(EXTI_SOURCE_GPIOB, EXTI_SOURCE_PIN9);
/* configure key EXTI line */
exti_init(EXTI_9, EXTI_INTERRUPT, EXTI_TRIG_FALLING);复制代码
B9亲测可用
楼主的代码似乎少了rcu_periph_clock_enable(RCU_CFGCMP);这货
详情
回复
发表于 2018-10-1 22:36
| ||
|
||
| |
|
|
| |
|
|
此帖出自GD32 MCU论坛
| ||
个人签名
So TM what......?
|
||
此帖出自GD32 MCU论坛
| ||
|
||
此帖出自GD32 MCU论坛
| ||
个人签名
So TM what......?
|
||
此帖出自GD32 MCU论坛
| ||
|
||
| |
|
|
此帖出自GD32 MCU论坛
| ||
个人签名
So TM what......?
|
||
此帖出自GD32 MCU论坛
| ||
|
||
EEWorld Datasheet 技术支持