- refactored libsys

- added critical section
- added interrupt global enable/disable
- added console::getInstanveByName



git-svn-id: http://moon:8086/svn/mips@76 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
2017-01-12 16:25:20 +00:00
parent 0f4b7e015f
commit 5c9c50ebeb
21 changed files with 129 additions and 307 deletions
+4 -7
View File
@@ -8,10 +8,6 @@
#include "board.h"
#include "../../irq.h"
#include "../../uart.h"
#include "../../console.h"
extern uart_if_t uart_if[];
#define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
@@ -21,7 +17,8 @@ const con_if_entry_t con_if_entry[] =
{0, "stdin", &uart_if[0], NULL, NULL, UART_readchar, NULL},
{1, "stdout", &uart_if[0], NULL, NULL, NULL, UART_writechar},
{2, "stderr", &uart_if[0], NULL, NULL, NULL, UART_writechar},
{3, "UART1", &uart_if[1], NULL, NULL, UART_readchar, UART_writechar}
{3, "UART-0", &uart_if[0], NULL, NULL, UART_readchar, UART_writechar},
{4, "UART-1", &uart_if[1], NULL, NULL, UART_readchar, UART_writechar}
};
con_if_t con_if =
@@ -50,10 +47,10 @@ void board_init(void)
void dbg_putchar(char c)
{
writechar(3, c);
writechar(4, c);
}
char dbg_getchar()
{
return (char)readchar(3);
return (char)readchar(4);
}