| The CommPortClearErrors()
function looks at the overrun error and framing error
bits and clears the error if one or both have
occurred.
Add this function to the serial.c file and also
don't forget to add the function prototype in the
serial.h file.
We just need one more function in order to complete
the Hello World program.
|
/*
// function: CommPortClearErrors( void )
// description: This function clears the
//
overrun or framing
errors.
/*
void CommPortClearErrors( void )
{
if(
OERR )
{
TXEN=0;
TXEN=1;
CREN=0;
CREN=1;
}
if(
FERR )
{
dummy=RCREG;
TXEN=0;
TXEN=1;
}
} |