开发板:CC2650
配置了两个外部中断BTN1,BTN2用来唤醒设备,系统进入shutdown模式后,使用按键唤醒,请问程序中如何知道是哪个外部中断唤醒设备的?
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.
开发板:CC2650
配置了两个外部中断BTN1,BTN2用来唤醒设备,系统进入shutdown模式后,使用按键唤醒,请问程序中如何知道是哪个外部中断唤醒设备的?
不是这个例程,单独写的,在程序中延时一段时间后,进入shutdown模式,另外程序设置了BTN1和BTN2都为唤醒按键,我想知道程序中如何判断是按下哪个按键设备唤醒的?
// Wake-up Button pin table
PIN_Config ButtonTableWakeUp[] = {
Board_BUTTON0 | PIN_INPUT_EN | PIN_PULLUP | PINCC26XX_WAKEUP_NEGEDGE | PIN_IRQ_NEGEDGE,
Board_BUTTON1 | PIN_INPUT_EN | PIN_PULLUP | PINCC26XX_WAKEUP_NEGEDGE | PIN_IRQ_NEGEDGE,
PIN_TERMINATE /* Terminate list */
};
是的,使用这个API是这样的
/** @brief Configure wakeup (from shutdown) on pins * * @param aPinCfg #PIN_Config list identifying pin ID and relevant pin * configuration as one of: * - #PINCC26XX_NO_WAKEUP (default) * - #PINCC26XX_WAKEUP_POSEDGE * - #PINCC26XX_WAKEUP_NEGEDGE * @return #PIN_SUCCESS if successful, else error code * * @par Usage * @code * PIN_setWakeup(NULL, PIN_ID(9)|PIN_WAKEUP_NEGEDGE); * Power_shutdown(0, 0); * @endcode * * @note A wake-up event to wake up from shutdown is not detected until * the device reaches shutdown. Wake-up events happening after a shutdown * is initiated but before actual shutdown are not captured and thus will * not cause the device to wake up. */ extern PIN_Status PINCC26XX_setWakeup(const PIN_Config aPinCfg[]);