⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stage2_consoleinit.c

📁 一个非常有用的nand_flash的boot程序代码
💻 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 + -