Ignore:
Timestamp:
Nov 18, 2015, 5:45:32 PM (4 years ago)
Author:
Premysl Houdek <kom541000@…>
Branches:
master
Children:
9394aa5e
Parents:
74172b7d
git-author:
Premysl Houdek <kom541000@…> (11/18/15 17:45:32)
git-committer:
Gedare Bloom <gedare@…> (11/18/15 18:12:44)
Message:

bsp/tms570: unite code duplication in pinmux and clean SCI close per review remarks.

Signed-off-by: Premysl Houdek <kom541000@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/tms570/console/tms570-sci.c

    r74172b7d r3e1196d  
    526526  tms570_sci_context *ctx = (tms570_sci_context *) base;
    527527  rtems_interrupt_lock_context lock_context;
     528  rtems_interval tw;
     529  int32_t baudrate;
    528530
    529531  /* Turn off RX interrupts */
     
    532534  rtems_termios_device_lock_release(base, &lock_context);
    533535
    534   if ( 0 /* for flush on close */ ) {
    535     /* Flush device */
    536     while ( ( ctx->regs->FLR & TMS570_SCI_FLR_TX_EMPTY ) == 0 ) {
    537       ;/* Wait until all data has been sent */
    538     }
     536  tw = rtems_clock_get_ticks_per_second();
     537  baudrate = rtems_termios_baud_to_number(cfgetospeed(&tty->termios));
     538  tw = tw * 10 / baudrate + 1;
     539  while ( ( ctx->regs->FLR & TMS570_SCI_FLR_TX_EMPTY ) == 0 ) {
     540     rtems_task_wake_after(tw);
    539541  }
    540542
Note: See TracChangeset for help on using the changeset viewer.