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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [peripheral/] [16450.c] - Diff between revs 102 and 123

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

Rev 102 Rev 123
Line 187... Line 187...
 
 
        printf("Resetting %u UART(s).\n", NR_UARTS);
        printf("Resetting %u UART(s).\n", NR_UARTS);
        memset(uarts, 0, sizeof(uarts));
        memset(uarts, 0, sizeof(uarts));
 
 
        for(i = 0; i < NR_UARTS; i++)
        for(i = 0; i < NR_UARTS; i++)
                if (config.uarts[i].txfile) {
    if (config.uarts[i].txfile) { /* MM: Try to create stream.  */
                        uarts[i].rxfs = fopen(config.uarts[i].rxfile, "r");
      if (!(uarts[i].rxfs = fopen(config.uarts[i].rxfile, "r"))
 
          && !(uarts[i].rxfs = fopen(config.uarts[i].rxfile, "r+"))) {
 
        printf("UART%d has problems with RX file stream.\n", i);
 
        continue;
 
      }
                        uarts[i].txfs = fopen(config.uarts[i].txfile, "a");
                        uarts[i].txfs = fopen(config.uarts[i].txfile, "a");
                        uarts[i].baseaddr = config.uarts[i].baseaddr;
                        uarts[i].baseaddr = config.uarts[i].baseaddr;
                        if (uarts[i].txfs) {
      if (uarts[i].txfs && uarts[i].txfs) {
                                printf("UART%d at 0x%.8x uses ", i, uarts[i].baseaddr);
                                printf("UART%d at 0x%.8x uses ", i, uarts[i].baseaddr);
                                printf("%s for RX and %s for TX.\n", config.uarts[i].rxfile, config.uarts[i].txfile);
                                printf("%s for RX and %s for TX.\n", config.uarts[i].rxfile, config.uarts[i].txfile);
                        } else
                        } else
                                printf("UART%d has problems with TX file stream.\n", i);
                                printf("UART%d has problems with TX file stream.\n", i);
                        register_memoryarea(uarts[i].baseaddr, UART_ADDR_SPACE, uart_read, uart_write);
                        register_memoryarea(uarts[i].baseaddr, UART_ADDR_SPACE, uart_read, uart_write);

powered by: WebSVN 2.1.0

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