예제 #1
0
void cmdPoll()
{
  #if defined CFG_PRINTF_UART
  while (uartRxBufferDataPending())
  {
    uint8_t c = uartRxBufferRead();
    cmdRx(c);
  }
  #endif

  #if defined CFG_PRINTF_USBCDC
    int  numBytesToRead, numBytesRead, numAvailByte;
  
    CDC_OutBufAvailChar (&numAvailByte);
    if (numAvailByte > 0) 
    {
      numBytesToRead = numAvailByte > 32 ? 32 : numAvailByte; 
      numBytesRead = CDC_RdOutBuf (&usbcdcBuf[0], &numBytesToRead);
      int i;
      for (i = 0; i < numBytesRead; i++) 
      {  
        cmdRx(usbcdcBuf[i]);   
      }
    }
  #endif
}
예제 #2
0
void cmdPoll()
{
  #if defined CFG_PRINTF_UART
  while (uartRxBufferDataPending())
  {
    uint8_t c = uartRxBufferRead();
    cmdRx(c);
  }
  #endif
}
예제 #3
0
void cliPoll()
{
  #if defined CFG_BSP_PRINTF_UART
  while (uartRxBufferDataPending())
  {
    uint8_t c = uartRxBufferRead();
    cliRx(c);
  }
  #endif

  #if defined(CFG_LIB_USB) && defined(CFG_LIB_PRINTF_USBCDC)
  if (usb_isConfigured())
  {
    uint8_t c;
    while(usb_cdc_getc(&c))
    {
      cliRx(c);
    }
  }
  #endif
}