1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

* line ending change

This commit is contained in:
Kaspar Schleiser 2010-09-24 14:42:50 +02:00
parent bb67f8d88a
commit 8c45f4751c

View File

@ -36,6 +36,10 @@ and the mailinglist (subscription via web site)
#include "lpc23xx.h" #include "lpc23xx.h"
#include "VIC.h" #include "VIC.h"
#include <msg.h>
#include <ringbuffer.h>
#include "uart0.h"
/** /**
* @file * @file
* @ingroup lpc2387 * @ingroup lpc2387
@ -62,7 +66,9 @@ static volatile unsigned int running = 0;
static volatile unsigned int fifo = 0; static volatile unsigned int fifo = 0;
static volatile toprint* actual = NULL; static volatile toprint* actual = NULL;
void (*uart0_callback)(int);
int uart0_handler_pid = 0;
extern ringbuffer uart0_ringbuffer;
static inline void enqueue(void) { static inline void enqueue(void) {
queue_items++; queue_items++;
@ -103,9 +109,12 @@ int uart_active(void){
return (running || fifo); return (running || fifo);
} }
static inline void receive(int c) static void notify_handler() {
{ if (uart0_handler_pid) {
if (uart0_callback != NULL) uart0_callback(c); msg m;
m.type = 0;
msg_send_int(&m, uart0_handler_pid);
}
} }
void stdio_flush(void) void stdio_flush(void)
@ -135,8 +144,10 @@ void UART0_IRQHandler(void)
case UIIR_RDA_INT: // Receive Data Available case UIIR_RDA_INT: // Receive Data Available
do { do {
int c = U0RBR; int c = U0RBR;
receive(c); rb_add_element(&uart0_ringbuffer, c);
} while (U0LSR & ULSR_RDR); } while (U0LSR & ULSR_RDR);
notify_handler();
break; break;
default: default: