Mail Archives: djgpp/2000/03/02/15:16:26
wsimpson AT my-deja DOT com wrote:
: char data;
: ...
: data=_bios_serialcomm(_COM_INIT,0,0); /*read from com1*/
: then data will contain the word (8 bits) I read from com1. If
: unsuccessful, bit 9, 10, 11, or 15 is set. I don't know how to check
: this. Please show me how (code fragment).
I don't know anything about _bios_serialcomm but the bit thing can be
accomplished like this (untested):
short data;
...
data=_bios_serialcomm( something here );
if( data & ( (1<<9) | (1<<10) | (1<<11) | (1<<15) ) )
{
printf("At least one of the bits were set.\n");
}
Right,
MartinS
- Raw text -