Hi,
I use 'nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_uart' as my project base for PCA10040. The code has its default sleep mode which use 'sleep_mode_enter' function for idle evt in 'on_adv_evt'. And I add comps like the following content.
static void sensor_timeout_handler(void * p_context)
{
UNUSED_PARAMETER(p_context);
nrf_drv_comp_start(NRF_DRV_COMP_EVT_EN_UP_MASK, NRF_DRV_COMP_SHORT_STOP_AFTER_UP_EVT);
}
static void comp_event_handler(nrf_comp_event_t event)
{
uint32_t err_code;
if (event == NRF_COMP_EVENT_UP)
{
nrf_gpio_pin_toggle(BSP_LED_2); // just change state of first LED
}
//nrf_gpio_pin_toggle(BSP_LED_2); // just change state of first LED
sensor_count++;
err_code = app_timer_start(m_sensor_timer_id, sensor_time_intervel, NULL);
APP_ERROR_CHECK(err_code);
}
/**
* @brief Initialize COMP driver.
*/
static void comp_init(void)
{
uint32_t err_code;
nrf_drv_comp_config_t config = NRF_DRV_COMP_DEFAULT_CONFIG(3);
// initialize LPCOMP driver, from this point LPCOMP will be active and provided
// event handler will be executed when defined action is detected
err_code = nrf_drv_comp_init(&config, comp_event_handler);
APP_ERROR_CHECK(err_code);
nrf_drv_comp_start(NRF_DRV_COMP_EVT_EN_UP_MASK, NRF_DRV_COMP_SHORT_STOP_AFTER_UP_EVT);
}
And I call ' comp_init' in the main function. What should do to wakeup the LCOMP by giving a high voltage pulse to p0.05. But the device cannot wake up from it.
Does anybody caught this issue?
Do you have any advices for let only LCOMP/COMP wakeup system?