OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable_0_2_0_rc2/] [or1ksim/] [peripheral/] [16450.c] - Diff between revs 1505 and 1517

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 1505 Rev 1517
Line 529... Line 529...
 
 
/* Checks if there is a character waiting to be received */
/* Checks if there is a character waiting to be received */
void uart_check_char(void *dat)
void uart_check_char(void *dat)
{
{
  struct dev_16450 *uart = dat;
  struct dev_16450 *uart = dat;
  char buffer[1];
  uint8_t buffer;
  int retval;
  int retval;
 
 
  /* Check if there is something waiting, and put it into rxser */
  /* Check if there is something waiting, and put it into rxser */
  retval = channel_read(uart->channel, buffer, 1);
  retval = channel_read(uart->channel, &buffer, 1);
  if(retval > 0) {
  if(retval > 0) {
    uart->iregs.rxser = (unsigned char)buffer[0];
    TRACE("Shifting 0x%02"PRIx8" (`%c') into shift reg\n", buffer, buffer);
 
    uart->iregs.rxser = buffer;
    uart->istat.receiveing = 1;
    uart->istat.receiveing = 1;
    SCHED_ADD(uart_recv_char, uart, uart->char_clks * UART_CLOCK_DIVIDER);
    SCHED_ADD(uart_recv_char, uart, uart->char_clks * UART_CLOCK_DIVIDER);
    return;
    return;
  }
  }
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.