/* LPCOMP event handler is called when LPCOMP detects voltage drop. 
This function is called from interrupt context so it is very important to return quickly. Don't put busy loops or any other CPU intensive actions here. It is also not allowed to call soft device functions from it (if LPCOMP IRQ priority is set to APP_IRQ_PRIORITY_HIGH).  */
static void lpcomp_event_handler(nrf_lpcomp_event_t event)
/* LPCOMP event handler is called when LPCOMP detects voltage drop. 
This function is called from interrupt context so it is very important to return quickly. Don't put busy loops or any other CPU intensive actions here. It is also not allowed to call soft device functions from it (if LPCOMP IRQ priority is set to APP_IRQ_PRIORITY_HIGH).  */
static void lpcomp_event_handler(nrf_lpcomp_event_t event)
{
    if (event == NRF_LPCOMP_EVENT_DOWN)
    {
        bsp_board_led_invert(BSP_BOARD_LED_0);
        voltage_falls_detected++;
        voltage_falls_total++;
    }
}