mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
* build fixes
This commit is contained in:
parent
fa207088b2
commit
74014d0408
@ -36,9 +36,7 @@ and the mailinglist (subscription via web site)
|
||||
#include "lpc23xx.h"
|
||||
#include "VIC.h"
|
||||
|
||||
#include <msg.h>
|
||||
#include <ringbuffer.h>
|
||||
#include "uart0.h"
|
||||
#include <board_uart0.h>
|
||||
|
||||
/**
|
||||
* @file
|
||||
@ -67,9 +65,6 @@ static volatile unsigned int fifo = 0;
|
||||
|
||||
static volatile toprint* actual = NULL;
|
||||
|
||||
int uart0_handler_pid = 0;
|
||||
extern ringbuffer uart0_ringbuffer;
|
||||
|
||||
static inline void enqueue(void) {
|
||||
queue_items++;
|
||||
queue_tail++;
|
||||
@ -109,12 +104,6 @@ int uart_active(void){
|
||||
return (running || fifo);
|
||||
}
|
||||
|
||||
static void notify_handler() {
|
||||
msg m;
|
||||
m.type = 0;
|
||||
msg_send_int(&m, uart0_handler_pid);
|
||||
}
|
||||
|
||||
void stdio_flush(void)
|
||||
{
|
||||
U0IER &= ~BIT1; // disable THRE interrupt
|
||||
@ -140,15 +129,16 @@ void UART0_IRQHandler(void)
|
||||
|
||||
case UIIR_CTI_INT: // Character Timeout Indicator
|
||||
case UIIR_RDA_INT: // Receive Data Available
|
||||
#ifdef MODULE_UART0
|
||||
if (uart0_handler_pid) {
|
||||
do {
|
||||
int c = U0RBR;
|
||||
rb_add_element(&uart0_ringbuffer, c);
|
||||
uart0_handle_incoming(c);
|
||||
} while (U0LSR & ULSR_RDR);
|
||||
|
||||
notify_handler();
|
||||
break;
|
||||
uart0_notify_thread();
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
U0LSR;
|
||||
U0RBR;
|
||||
|
@ -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]");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user