Ensure that the UART port is available before writing
This commit is contained in:
parent
b59845d117
commit
7543d53603
1 changed files with 4 additions and 1 deletions
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)$Id: uart1.c,v 1.16 2009/11/18 15:45:32 nifi Exp $
|
* @(#)$Id: uart1.c,v 1.17 2010/03/03 23:18:58 nvt-se Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -89,6 +89,9 @@ uart1_writeb(unsigned char c)
|
||||||
the first byte into the UART. */
|
the first byte into the UART. */
|
||||||
if(transmitting == 0) {
|
if(transmitting == 0) {
|
||||||
transmitting = 1;
|
transmitting = 1;
|
||||||
|
|
||||||
|
/* Loop until the transmission buffer is available. */
|
||||||
|
while((IFG2 & UTXIFG1) == 0);
|
||||||
TXBUF1 = ringbuf_get(&txbuf);
|
TXBUF1 = ringbuf_get(&txbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue