This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ZC_light_cc26x2lp 单播 ZED_switch_cc26x2lp工程, 协调器收到switch按键信号后怎样与自身应用层定义的events关联起来?



在static void zclSampleLight_process_loop(void):  

          if(events & SAMPLEAPP_KEY_EVT)
            {
                // Process Key Presses
                zclSampleLight_processKey(keys);
                keys = 0;
                events &= ~SAMPLEAPP_KEY_EVT;
            }

是通过初始化阶段通过 Board_Key_initialize(zclSampleLight_changeKeyCallback);调用:

    /* Setup keycallback for keys */
    Timer_construct(&keyChangeClock, board_key_changeHandler,
                    (KEY_DEBOUNCE_TIMEOUT),
                    0, false, 0);

    /* Set the application callback */
    appKeyChangeHandler = appKeyCB;

来实现的吗???

static void zclSampleLight_changeKeyCallback(uint8_t keysPressed)
{
    keys = keysPressed;

    events |= SAMPLEAPP_KEY_EVT;

    // Wake up the application thread when it waits for clock event
    Semaphore_post(sem);
}

函数    Timer_construct(&keyChangeClock, board_key_changeHandler,
                    (KEY_DEBOUNCE_TIMEOUT),
                    0, false, 0); 是什么用途???