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.

CC2540 待机唤醒疑问

Other Parts Discussed in Thread: CC2540

亲们,

我在看CC2540的串口中断服务(_hal_uart_isr.c)的时候,看到那文档里面的最后一个程序:

#if (defined POWER_SAVING && defined HAL_UART_GPIO_ISR)
/***************************************************************************************************
 * @fn      PortX Interrupt Handler
 *
 * @brief   This function is the PortX interrupt service routine.
 *
 * @param   None.
 *
 * @return  None.
 ***************************************************************************************************/
#if (HAL_UART_ISR == 1)
HAL_ISR_FUNCTION(port0Isr, P0INT_VECTOR)
#else
HAL_ISR_FUNCTION(port1Isr, P1INT_VECTOR)
#endif
{
  HAL_ENTER_ISR();

  HalUARTResume();
  if (dmaCfg.uartCB != NULL)
  {
    dmaCfg.uartCB(HAL_UART_DMA-1, HAL_UART_RX_WAKEUP);
  }
  PxIFG = 0;
  PxIF = 0;

  HAL_EXIT_ISR();
}
#endif

这个程序的意思是在POWER-SAVING允许的情况下,可以响应外部IO口中断从而来唤醒串口吗?

还有为什么下面的两行程序里是dmaCfg.uartCB 这个回调函数呢,为什么不是 isrCfg.uartCB 呢?这是uart_isr下啊,不是 uart_dma 啊,谢谢!

if (dmaCfg.uartCB != NULL)
  {
    dmaCfg.uartCB(HAL_UART_DMA-1, HAL_UART_RX_WAKEUP);
  }