📄 relocate_io.c
字号:
/*
* File: relocate_io.c
* Purpose: Common routines for relocatable input/output routines
*
* Notes:
*
*/
#include "src/include/dbug.h"
#include "proj/common/relocate_io.h"
/*
* Compiler specific code relocation section
*/
#ifdef __DCC__
#pragma section CODE ".code_relocation"
#pragma section CONST ".code_relocation"
#endif
/********************************************************************/
#ifdef __MWERKS__
__relocate_code__
#endif
char
relocate_getchar (void)
{
/* Wait until character has been received */
while (!(MCF5282_UART0_USR & MCF5282_UART_USR_RXRDY))
;
return MCF5282_UART0_URB;
}
/********************************************************************/
#ifdef __MWERKS__
__relocate_code__
#endif
void
relocate_putchar (char ch)
{
/* Wait until space is available in the FIFO */
while (!(MCF5282_UART0_USR & MCF5282_UART_USR_TXRDY))
;
/* Send the character */
MCF5282_UART0_UTB = (uint8)ch;
}
/********************************************************************/
#ifdef __MWERKS__
__relocate_code__
#endif
int
relocate_getchar_present (void)
{
return (MCF5282_UART0_USR & MCF5282_UART_USR_RXRDY);
}
/********************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -