We want to use GPIO_12 as a wake up pin. (High -> open uart, Low -> close uart)
Also, we have a timer and timeout set to 500ms.
When we pull GPIO_12 to high, it seems not trigger an event to wakp up from idle_state_handle()/nrf_pwr_mgmt_run() immediately.
Always need to wait timer timeout to trigger an event and run uart_init();
Any additional settings need to configure for GPIO_12?
// Enter main loop.
for (;;)
{
if ((UartStatus == UART_ENABLE) && (nrf_gpio_pin_read(12) == 0))
{
nrf_gpio_cfg_sense_input(12, NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH);
UartStatus = UART_DISABLE;
app_uart_close();
}
idle_state_handle(); //Enter nrf_pwr_mgmt_run();
if ((UartStatus == UART_DISABLE) && (nrf_gpio_pin_read(12) == 1))
{
uart_init();
UartStatus = UART_ENABLE;
nrf_gpio_cfg_sense_input(12, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_LOW);
}
}
Thank you in advance.