- refactored

git-svn-id: http://moon:8086/svn/mips@149 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
2021-04-06 13:41:03 +00:00
parent dd10b4b5db
commit 7634bf8d41
17 changed files with 256 additions and 86 deletions
+49
View File
@@ -0,0 +1,49 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
#include <stddef.h>
#include "board.h"
#include "../../irq.h"
#include "../../uart.h"
#include "../../console.h"
#include "../../asm/regdef.h"
extern uart_if_t uart_if[];
#define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
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, "UART-0", &uart_if[0], NULL, NULL, UART_readchar, UART_writechar},
{4, "UART-1", &uart_if[1], NULL, NULL, UART_readchar, UART_writechar}
};
const con_if_t con_if =
{
con_if_entry, ARRAYSIZE(con_if_entry)
};
void board_init(void)
{
uint32_t volatile *pITIM_ctrl = (uint32_t*)SYS_ITIM_CTRL;
// Disable timers
*pITIM_ctrl = 0;
// Setup syscall support
syscalls_init();
// Setup interrupt support
interrupt_init();
interrupt_global_enable();
// Do some initializations here
}