mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-08-09 17:25:00 +00:00
Ensure that the UART port is available before writing
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user