dbgserutils.c
来自「vxworks的BSP开发配置文件」· C语言 代码 · 共 86 行
C
86 行
/* dbgSerUtils.c - Primitive serial debugging routines for polled I/O *//* Copyright 1999 Intel Corp. *//*modification history--------------------01a,08jul99,jdg created*//*DESCRIPTIONThis file contains primitive debug routines for doing polled I/O onthe serial port. This may be used as an aid to debugging BSP issuesbefore the operating system is fully initialized.*/#ifdef INCLUDE_EARLY_SERIAL_DEBUG#include <sioLib.h>SIO_CHAN *dbgSerChan;/********************************************************************************* dbgSerInit - Initialize debug serial port support** This routine initializes the serial port.** RETURNS: N/A*/void dbgSerInit (void) { dbgSerChan = sysSerialChanGet(0); sioIoctl(dbgSerChan, SIO_BAUD_SET, (void *)WDB_TTY_BAUD); }/********************************************************************************* dbgSerOutstr - Send a string out the serial port using polled I/O** This routine sends the specified string out the serial port using* polled I/O. Note that for proper display on terminals, lines of* text should be terminated with a carriage return as well as a line feed.** RETURNS: N/A*/void dbgSerOutstr ( char *str /* String to be output */ ) { while (*str) { while (sioPollOutput(dbgSerChan, *str) == EAGAIN) continue; str++; } }/********************************************************************************* dbgSerLoopback - Copy the input of the serial port to the output** This routine enters an infinite loop reading a character from the* serial port (using polled I/O) and then writing it to the serial* port (using polled I/O).** RETURNS: N/A*/void dbgSerLoopback() { char x; while (1) { while (sioPollInput(dbgSerChan, &x) == EAGAIN); while (sioPollOutput(dbgSerChan, x) == EAGAIN); } }#endif /* INCLUDE_EARLY_SERIAL_DEBUG */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?