URL
https://opencores.org/ocsvn/minsoc/minsoc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 36 |
Rev 42 |
#include "../support/board.h"
|
#include "../support/board.h"
|
#include "../support/support.h"
|
#include "../support/support.h"
|
#include "../support/uart.h"
|
#include "../support/uart.h"
|
#include "uart.h"
|
#include "uart.h"
|
|
|
void uart_interrupt()
|
void uart_interrupt()
|
{
|
{
|
char lala;
|
char lala;
|
unsigned char interrupt_id;
|
unsigned char interrupt_id;
|
interrupt_id = REG8(UART_BASE + UART_IIR);
|
interrupt_id = REG8(UART_BASE + UART_IIR);
|
if ( interrupt_id & UART_IIR_RDI )
|
if ( interrupt_id & UART_IIR_RDI )
|
{
|
{
|
lala = uart_getc();
|
lala = uart_getc();
|
uart_putc(lala+1);
|
uart_putc(lala+1);
|
}
|
}
|
|
|
}
|
}
|
|
|
void uart_print_str(char *p)
|
void uart_print_str(char *p)
|
{
|
{
|
while(*p != 0) {
|
while(*p != 0) {
|
uart_putc(*p);
|
uart_putc(*p);
|
p++;
|
p++;
|
}
|
}
|
}
|
}
|
|
|
void uart_print_long(unsigned long ul)
|
void uart_print_long(unsigned long ul)
|
{
|
{
|
int i;
|
int i;
|
char c;
|
char c;
|
|
|
|
|
uart_print_str("0x");
|
uart_print_str("0x");
|
for(i=0; i<8; i++) {
|
for(i=0; i<8; i++) {
|
|
|
c = (char) (ul>>((7-i)*4)) & 0xf;
|
c = (char) (ul>>((7-i)*4)) & 0xf;
|
if(c >= 0x0 && c<=0x9)
|
if(c >= 0x0 && c<=0x9)
|
c += '0';
|
c += '0';
|
else
|
else
|
c += 'a' - 10;
|
c += 'a' - 10;
|
uart_putc(c);
|
uart_putc(c);
|
}
|
}
|
|
|
}
|
}
|
|
|
void uart_print_short(unsigned long ul)
|
void uart_print_short(unsigned long ul)
|
{
|
{
|
int i;
|
int i;
|
char c;
|
char c;
|
char flag=0;
|
char flag=0;
|
|
|
|
|
uart_print_str("0x");
|
uart_print_str("0x");
|
for(i=0; i<8; i++) {
|
for(i=0; i<8; i++) {
|
|
|
c = (char) (ul>>((7-i)*4)) & 0xf;
|
c = (char) (ul>>((7-i)*4)) & 0xf;
|
if(c >= 0x0 && c<=0x9)
|
if(c >= 0x0 && c<=0x9)
|
c += '0';
|
c += '0';
|
else
|
else
|
c += 'a' - 10;
|
c += 'a' - 10;
|
if ((c != '0') || (i==7))
|
if ((c != '0') || (i==7))
|
flag=1;
|
flag=1;
|
if(flag)
|
if(flag)
|
uart_putc(c);
|
uart_putc(c);
|
}
|
}
|
|
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.