📄 stage2_consoleinit.c
字号:
/*
* File: src/common.c
*
* Purpose: Common platform run-time glue code
*
* Notes:
*
* Author: Eric DeVolder
* Date: Apr-24-2002
*
* Modifications:
*
*/
#include "example.h"
#ifndef CONSOLE
#define CONSOLE 0
#endif
#ifndef BAUDRATE
#define BAUDRATE 115200
#endif
/********************************************************************/
void
nandInit (void)
{
dcacheFlush();
icacheFlush();
tlbInit();
cpuIrqInit();
msdelay(10);
uartInit(CONSOLE, BAUDRATE);
msdelay(10);
/* Allow interrupts to occur (though all masked) */
cpuEnableIrqs(STATUS_IE);
}
/********************************************************************/
void
platformPutChar (int ch)
{
uartPutChar(CONSOLE, ch);
}
int
platformGetChar (void)
{
int ch;
uartGetChar(CONSOLE, &ch);
return ch;
}
int
platformCheckChar (void)
{
return uartCheckChar(CONSOLE);
}
/********************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -