//--------------------------------------------------------------------------- // Flush the rx and tx buffers // // 'portnum' - number 0 to MAX_PORTNUM-1. This number was provided to // OpenCOM to indicate the port number. // void FlushCOM(int portnum) { if(portnum==0) serial0_flush(); else serial1_flush(); }
//--------------------------------------------------------------------------- // Closes the connection to the port. // // 'portnum' - number 0 to MAX_PORTNUM-1. This number was provided to // OpenCOM to indicate the port number. // void CloseCOM(int portnum) { if(portnum==0) { ES0 = 0; //disable serial interrupt serial0_flush(); } else if(portnum==1) { ES1 = 0; //disable serial interrup serial1_flush(); } }
//--------------------------------------------------------------------------- // Flush the rx and tx buffers // // 'portnum' - number 0 to MAX_PORTNUM-1. This number was provided to // OpenCOM to indicate the port number. // void FlushCOM(int portnum) { switch (port_handle[portnum]) { case DS400_SERIAL0: serial0_flush(); break; case DS400_SERIAL1: serial1_flush(); break; case DS400_SERIAL2: serial2_flush(); break; } }
void serial0_shutdown(void) { ES0 = 0; //disable serial interrupt serial0_flush(); }