
//等待数据发送成功
#define WAIT_SEND_OK(); //while( #.MEGA328.UCSR0A.5(bit) == 0 ) {} #.MEGA328.UCSR0A.5(bit) = 1;

//等待接收到数据
#define WAIT_RECEIVE(); //while( #.MEGA644.UCSR0A.7(bit) == 0 ) {}

//定义串口数据寄存器
link memory VHdata {} = #.USER0.VHdata;
VHdata uint8 UDR = #addr 0x0500 + 0;
VHdata int32 Baud = #addr 0x0500 + 1;

//定义串口中断源
#define INTERRUPT_UART interrupt [0x10]

//设置波特率
void set_baud( int32 t_baud )
{
	Baud = t_baud;
}




