This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

COMP stop task

Right now I'm stuck with the COMP driver. What I am trying to do is. Initialise COMP, start COMP with interrupt and STOP shortcut. Once I handled the interrupt I just want to start the COMP again with an interrupt and a shortcut. However, when trying to start the COMP I am getting an exeption because in the nrf_drv_comp.c this fails:

ASSERT(m_state == NRF_DRV_STATE_INITIALIZED);

when I call

nrf_drv_comp_start(NRF_DRV_COMP_EVT_EN_DOWN_MASK, NRF_DRV_COMP_SHORT_STOP_AFTER_DOWN_EVT);

My questions:

What is happening exactly when the stop task of the COMP is triggered due to interrupts?

In which state is the peripheral?

How can I use driver functions where m_state is checked when using interrupt shortcuts?

Parents
  • Thank you for your reply, meanwhile I'm familar with the COMP driver. My main question right now is, when I start the COMP after Init with:

    nrf_drv_comp_start(NRF_DRV_COMP_EVT_EN_DOWN_MASK, NRF_DRV_COMP_SHORT_STOP_AFTER_DOWN_EVT);

    And the DOWN Event gets triggered the nRF is doing some magic and stopping the COMP. Is the driver module (m_state) aware that the COMP has been stopped? Meaning ist the STOP Task essentially the same as calling:

    nrf_drv_comp_stop()

Reply
  • Thank you for your reply, meanwhile I'm familar with the COMP driver. My main question right now is, when I start the COMP after Init with:

    nrf_drv_comp_start(NRF_DRV_COMP_EVT_EN_DOWN_MASK, NRF_DRV_COMP_SHORT_STOP_AFTER_DOWN_EVT);

    And the DOWN Event gets triggered the nRF is doing some magic and stopping the COMP. Is the driver module (m_state) aware that the COMP has been stopped? Meaning ist the STOP Task essentially the same as calling:

    nrf_drv_comp_stop()

Children
No Data
Related