Hi ,
I enabled dg_configLATCH_WKUP_SOURCE because i need in my app multiple source events. I verified that if ths macro is enabled the wakeup from hibernation mode doesn't work. If I disable it instead it wakes the device....
我需要更多的终端请求……Is that a bug of SDK ?
thanks for your reply!
Marco
Device:
Hi,
I solved the issue. I guess it's a SDK bug. It misses the writing of a register WKUP_SELECT_Px_REG
below as i solved with my function.
could you confim this ? btw seems it works waking device from hibernation.
hw_wkup_init(NULL);
hw_wkup_configure_pin(HW_GPIO_PORT_3,HW_GPIO_PIN_1,true,HW_WKUP_PIN_STATE_LOW);
hw_wkup_enable_wakeup( HW_GPIO_PORT_3,HW_GPIO_PIN_1 ); <---- this is my fnc
hw_wkup_register_interrupt(wkup_handler, 1);
void hw_wkup_enable_wakeup(HW_GPIO_PORT port, HW_GPIO_PIN pin)
{
switch (port) {
case HW_GPIO_PORT_0:
WAKEUP->WKUP_SELECT_P0_REG |= (1 << pin);
break;
case HW_GPIO_PORT_1:
WAKEUP->WKUP_SELECT_P1_REG |= (1 << pin);
break;
case HW_GPIO_PORT_2:
WAKEUP->WKUP_SELECT_P2_REG |= (1 << pin);
break;
case HW_GPIO_PORT_3:
WAKEUP->WKUP_SELECT_P3_REG |= (1 << pin);
break;
case HW_GPIO_PORT_4:
WAKEUP->WKUP_SELECT_P4_REG |= (1 << pin);
break;
default:
ASSERT_WARNING(0);//Invalid argument
}
}
Thanks
Marco
嗨garzola,
Could you please let me know if this fixed your issue? You should write the WKUP_SELECT_Px_REG.
Thanks, PM_Dialog
yes it fixed my issue.
Marco