NCS CAF leds modules can not receive power down event?

Hi,

    I use CAF leds modules in NCS. After click the button and led lights for 3.6 seconds, I submit power down event when double click button. As show in the following figure, led modules can receive power down event and set leds state to off.

case CLICK_SHORT:
    send_led_event(LED_ID_BLUE, &m_led_effect[LED_EFFECT_ID_DEVICE_ON]);
    break;

case CLICK_DOUBLE: {
    struct power_down_event *event = new_power_down_event();

    event->error = false;
    EVENT_SUBMIT(event);
}
break;

    Another situation, I submit led event and power dowen event after long press the button, I find led modules can't receive power down event.

case CLICK_LONG: {
    send_led_event(LED_ID_RED, &m_led_effect[LED_EFFECT_ID_DEVICE_ON]);

    struct power_down_event *event = new_power_down_event();
    event->error = false;
    EVENT_SUBMIT(event);
}
break;

Parents Reply
  • Hi,

    This is my click_dector_def.h file.

    /*
     * Copyright (c) 2019 Nordic Semiconductor ASA
     *
     * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
     */
    
    #include <caf/click_detector.h>
    
    /* This configuration file is included only once from click_detector module
     * and holds information about click detector configuration.
     */
    
    /* This structure enforces the header file is included only once in the build.
     * Violating this requirement triggers a multiple definition error at link time.
     */
    const struct {} click_detector_def_include_once;
    
    static const struct click_detector_config click_detector_config[] = {
    	{
    		.key_id = 0,
    		.consume_button_event = false,
    	},
    };
    

Children
Related