1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 09:52:43 +01:00

* build fixes

This commit is contained in:
Kaspar Schleiser 2010-09-30 16:07:31 +02:00
parent a076a765b3
commit a5bfdd957b
5 changed files with 10 additions and 42 deletions

View File

@ -36,9 +36,7 @@ and the mailinglist (subscription via web site)
#include "lpc23xx.h" #include "lpc23xx.h"
#include "VIC.h" #include "VIC.h"
#include <msg.h> #include <board_uart0.h>
#include <ringbuffer.h>
#include "uart0.h"
/** /**
* @file * @file
@ -67,9 +65,6 @@ static volatile unsigned int fifo = 0;
static volatile toprint* actual = NULL; static volatile toprint* actual = NULL;
int uart0_handler_pid = 0;
extern ringbuffer uart0_ringbuffer;
static inline void enqueue(void) { static inline void enqueue(void) {
queue_items++; queue_items++;
queue_tail++; queue_tail++;
@ -109,12 +104,6 @@ int uart_active(void){
return (running || fifo); return (running || fifo);
} }
static void notify_handler() {
msg m;
m.type = 0;
msg_send_int(&m, uart0_handler_pid);
}
void stdio_flush(void) void stdio_flush(void)
{ {
U0IER &= ~BIT1; // disable THRE interrupt U0IER &= ~BIT1; // disable THRE interrupt
@ -140,15 +129,16 @@ void UART0_IRQHandler(void)
case UIIR_CTI_INT: // Character Timeout Indicator case UIIR_CTI_INT: // Character Timeout Indicator
case UIIR_RDA_INT: // Receive Data Available case UIIR_RDA_INT: // Receive Data Available
#ifdef MODULE_UART0
if (uart0_handler_pid) { if (uart0_handler_pid) {
do { do {
int c = U0RBR; int c = U0RBR;
rb_add_element(&uart0_ringbuffer, c); uart0_handle_incoming(c);
} while (U0LSR & ULSR_RDR); } while (U0LSR & ULSR_RDR);
uart0_notify_thread();
notify_handler();
break;
} }
#endif
break;
default: default:
U0LSR; U0LSR;
U0RBR; U0RBR;

View File

@ -1,25 +0,0 @@
#include <chardev_thread.h>
#include <ringbuffer.h>
#include <stdio.h>
#include <thread.h>
#include <board_uart0.h>
#define UART0_BUFSIZE 32
extern ringbuffer uart0_ringbuffer;
extern int uart0_handler_pid;
static char buffer[UART0_BUFSIZE];
static void uart0_loop() {
chardev_loop(&uart0_ringbuffer);
}
void board_uart0_init() {
ringbuffer_init(&uart0_ringbuffer, buffer, UART0_BUFSIZE);
int pid = thread_create(KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN-1, CREATE_STACKTEST, uart0_loop, "uart0");
uart0_handler_pid = pid;
puts("uart0_init() [OK]");
}

View File

@ -6,6 +6,6 @@
SubDir TOP projects test_shell ; SubDir TOP projects test_shell ;
Module test_shell : test_shell.c : shell posix_io shell_auto_init ps board_uart ; Module test_shell : test_shell.c : shell posix_io shell_auto_init ps uart0 ;
UseModule test_shell ; UseModule test_shell ;

View File

@ -33,6 +33,7 @@ Module posix_io : posix_io.c ;
Module auto_init : auto_init.c ; Module auto_init : auto_init.c ;
Module chardev_thread : chardev_thread.c : ringbuffer ; Module chardev_thread : chardev_thread.c : ringbuffer ;
Module uart0 : uart0.c : ringbuffer chardev_thread ;
SubInclude TOP sys net ; SubInclude TOP sys net ;
SubInclude TOP sys lib ; SubInclude TOP sys lib ;

View File

@ -4,5 +4,7 @@
extern int uart0_handler_pid; extern int uart0_handler_pid;
void board_uart0_init(); void board_uart0_init();
void uart0_handle_incoming(int c);
void uart0_notify_thread();
#endif /* __BOARD_UART0_H */ #endif /* __BOARD_UART0_H */