Changeset d7c13c8 in rtems


Ignore:
Timestamp:
Oct 16, 2018, 12:34:38 PM (6 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
143c8d0
Parents:
186a0b1
git-author:
Sebastian Huber <sebastian.huber@…> (10/16/18 12:34:38)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/17/18 07:58:14)
Message:

bsp/imx7: Add getchark() support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bsps/arm/imx/console/console-config.c

    r186a0b1 rd7c13c8  
    6565}
    6666
     67static int imx_uart_read_polled(rtems_termios_device_context *base)
     68{
     69  volatile imx_uart *regs;
     70
     71  regs = imx_uart_get_regs(base);
     72
     73  if ((regs->usr2 & IMX_UART_USR2_RDR) != 0) {
     74    return IMX_UART_URXD_RX_DATA_GET(regs->urxd);
     75  } else {
     76    return -1;
     77  }
     78}
     79
    6780void imx_uart_console_drain(void)
    6881{
     
    8194{
    8295  imx_uart_write_polled(&imx_uart_console->base, c);
     96}
     97
     98static int imx_poll_char(void)
     99{
     100  return imx_uart_read_polled(&imx_uart_console->base);
    83101}
    84102
     
    148166
    149167  BSP_output_char = imx_output_char;
     168  BSP_poll_char = imx_poll_char;
    150169}
    151170
     
    316335}
    317336
    318 #ifndef CONSOLE_USE_INTERRUPTS
    319 static int imx_uart_read(rtems_termios_device_context *base)
    320 {
    321   volatile imx_uart *regs;
    322 
    323   regs = imx_uart_get_regs(base);
    324 
    325   if ((regs->usr2 & IMX_UART_USR2_RDR) != 0) {
    326     return IMX_UART_URXD_RX_DATA_GET(regs->urxd);
    327   } else {
    328     return -1;
    329   }
    330 }
    331 #endif
    332 
    333337static const rtems_termios_device_handler imx_uart_handler = {
    334338  .first_open = imx_uart_first_open,
     
    339343  .mode = TERMIOS_IRQ_DRIVEN
    340344#else
    341   .poll_read = imx_uart_read,
     345  .poll_read = imx_uart_read_polled,
    342346  .mode = TERMIOS_POLLED
    343347#endif
Note: See TracChangeset for help on using the changeset viewer.