- 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
+12
View File
@@ -20,6 +20,18 @@ uart_if_t uart_if[2] =
// ------------------------------------
// Low-level I/O
// ------------------------------------
#define CALC_BAUD(b) \
((uint32_t)((float)CPU_FREQ_HZ/(16*b) + 0.5f) - 1);
void UART_setbaud(void const *pInst, uint32_t baudrate)
{
assert(pInst);
uart_if_t *pReg = (uart_if_t*)pInst;
*pReg->pBAUD = CALC_BAUD(baudrate);
}
int UART_readchar(void const *pInst)
{
assert(pInst);