I am writing a uart driver and this uart is used as<br>the console of my board.<br> Is it necessary to do some protection in function like that<br><br>int uart_write(const char *buf, int len)<br>{<br>int i;<br>
for (i = 0; i < len; i++)<br> TX_Regsiter = buf[i];<br>}<br><br>I worried about that if one thread called printf("abc") and another<br>called printf("def") then I would got "adbecf".<br>
<br>I noticed that the uart driver of some arm board do nothing to it.<br>Does the protection is made by the new-lib?<br><br>If so, I should only use standard library to access the console,<br>never directly access the uart_write, right?<br>
<br>