pulled put out of lib

still need set __putc as a fuction pointer to the uart_putc
This commit is contained in:
Mariano Alvira 2010-03-03 08:09:19 -05:00
parent 4b22b25e38
commit 00224dd7eb
7 changed files with 66 additions and 19 deletions

View file

@ -1,6 +1,8 @@
#ifndef UART1_H
#define UART1_H
#include <types.h>
#define UART1_CON ((volatile uint32_t *) 0x80005000)
#define UART1_STAT ((volatile uint32_t *) 0x80005004)
#define UART1_DATA ((volatile uint32_t *) 0x80005008)
@ -9,7 +11,7 @@
#define UART1_CTS ((volatile uint32_t *) 0x80005014)
#define UART1_BR ((volatile uint32_t *) 0x80005018)
int uart1_putchar(int c);
void uart1_putc(char c);
#define uart1_can_get() (*UR1CON > 0)

View file

@ -37,7 +37,7 @@
#include <mc1322x.h>
#include <types.h>
#define __putc(x) putchr(x)
#define __putc(x) uart1_putc(x)
/**
* Structure to hold data to be passed to print function with format.

6
lib/uart1.c Normal file
View file

@ -0,0 +1,6 @@
#include <uart1.h>
void uart1_putc(char c) {
while(*UT1CON == 31); /* wait for there to be room in the buffer */
*UART1_DATA = c;
}