Problem Statement
-使用GPIO_RegisterCallback()注册一个GPIO中断/ISR,并检测当系统正常运行时是否短按和长按按钮。
我尝试的是
void register_button_isr(void)
{
NVIC_DisableIRQ(GPIO1_IRQn);
// Push Button input
GPIO_EnableIRQ(GPIO_PORT_0, GPIO_PIN_6, GPIO1_IRQn, true, true, 0);
}- SW_2按下时点亮DA14583_ProDK的LED,再次按下时关闭LED。
Observation
下面(ble_examples.zip)是包含修改过的Blinky示例的文件和我在ble_all_in_one应用程序中添加的新文件
期待一个积极的响应。< / p > < p >提前感谢你< / p > < p >对< br / > Dhruv沙< / p > < / div > < / div > < / div > < div class =”字段field-name-field-forum-keywords field-type-taxonomy-term-reference field-label-above”> < div class = "字段标签" >关键词:,< / div > < div class = "字段条目" > < div class =”field-item甚至“> < a href = " / resource-keywords / gpio typeof =“skos:概念”属性= " rdfs: label skos: prefLabel”数据类型= " " > GPIO < / > < / div > < div class = " field-item古怪”> < a href = " / resource-keywords /深度睡眠”“=“skos:概念”属性=“rdfs: label skos: prefLabel”数据类型= " " >深度睡眠< / > < / div > < div class =”field-item甚至“> < a href = " / resource-keywords /中断”“=“skos:概念”属性=“rdfs: label skos: prefLabel” datatype="">Interrupt
in void set_pad_functions(void):
GPIO_ConfigurePin(I2C_INT1_PORT, I2C_INT1_PIN, INPUT_PULLUP, PID_GPIO, true);//G Sensor INT1
GPIO_RegisterCallback(GPIO0_IRQn, LIS3DH_Interrupt1_Handler);
GPIO_EnableIRQ(I2C_INT1_PORT, I2C_INT1_PIN, GPIO0_IRQn, false, true, 3);/ / 0 =比;然而,我发现我的回调函数将在每次唤醒时间被调用。
The reason may be that the GPIO_EnableIRQ(in set_pad_functions) is set again and the interrupt pin is high at that time.
As I know, the GPIO interruption of DA14585 is level triggered, right?
Do you guys have any idea to solve this problem?
Thanks.