;File: urt42bsy.a51
;Author: Eckart Hartmann Date:17/10/2003
;Development progress: Urt834.df
;
;urtbsy==========Configure UART and baudrate.
;C Function prototype: char UrtBsy(void);
;Description of Function: Checks UART busy status.
;User interface: One byte must be allocated in DATA segment for cUrtVar.
;		Call UrtBsy.
;		Returns 0 if ready.
;		Returns with bit 0 set if a byte received. 
;		Returns with bit 1 set if a byte can be sent. 
;		Returns with bit 7 set if an error occured. 
;Robustness:	.
;Side effects: Overwrites a, cy, p and r1.
;
NAME URTBSY
$NOMOD51
 $IC(..kei842.inc) ; Parameter passing registers for Keil .
 $IC(..kei842.dat) ; SFR definition for Keil .
;
extrn DATA (cUrtVar)
public UrtBsy

?PR?UrtBsy?URTBSY	SEGMENT CODE
	RSEG	?PR?UrtBsy?URTBSY

UrtBsy:
	mov	a,cUrtVar
	anl	a,#080h		;Get error flag
	mov	c,RI		; add RI flag.
	mov	ACC.0,c
	mov	c,TI		; add TI flag.
	mov	ACC.1,c
	mov	cP1l,a		; and return.
	ret
;
;Function End==========================================================Function End
end
;
