Question regarding ns16550

Daniel Gutson daniel.gutson at tallertechnologies.com
Tue Oct 21 17:32:13 UTC 2014


Hi,

   in the writing interrupt mode (ns16550_write_support_int), we have

  for (i = 0; i < out; ++i) {
    set( port, NS16550_TRANSMIT_BUFFER, buf [i]);
  }

Shouldn't we check, before writing to the register for the iterations
after the first one,
whether the character entered in the FIFO? (otherwise I think the
'for' loop could iterate
so fast that the device had no time to process the character)

In such a case, something like


  for (i = 0; i < out; ++i) {

   /* Wait for transmitter holding register to be empty */
    do {
      status = get( port, NS16550_LINE_STATUS);
    } while ((status & SP_LSR_THOLD) == 0);

    set( port, NS16550_TRANSMIT_BUFFER, buf [i]);
  }

would be better?

Thanks,

   Daniel.


-- 

Daniel F. Gutson
Chief Engineering Officer, SPD


San Lorenzo 47, 3rd Floor, Office 5

Córdoba, Argentina


Phone: +54 351 4217888 / +54 351 4218211

Skype: dgutson


More information about the devel mailing list