October 2006
Intermediate to advanced
336 pages
9h 13m
English
We looked at a serial driver in Chapter 7. The Monitor and Control program uses the same serial driver with some additional functionality.
One change to the serial driver is the addition of a “put string”
function, serialPutStr. This
function, which follows, allows strings to be sent out the serial port
through a single call rather than having to specify each character in
order. This is similar to the standard C printf function, which calls the serialPutChar function repeatedly until the
entire string has been transmitted out the serial port.
/**********************************************************************
*
* Function: serialPutStr
*
* Description: Outputs a string to the serial port.
*
* Notes:
*
* Returns: None.
*
**********************************************************************/
void serialPutStr(char const *pOutputStr)
{
char const *pChar;
/* Send each character of the string. */
for (pChar = pOutputStr; *pChar != '\\0'; pChar++)
serialPutChar(*pChar);
}