title: Using printf with two UARTs
body: <p>I have implemented <code>fputc</code> and <code>fgetc</code> in retarget.c to successfully use printf via UART0 on a Cortex-M3.</p>
  
  <p>However, I want a second uart channel for additional debug information. How can I integrate this as nicely as I can UART0 using printf?</p>
  
  <p>For example, using fprintf to a custom target and checking in <code>fputc</code> which target to send the character to..
  E.g. for normal output <code>fprintf(UART0,"..");</code> and for debug output <code>fprintf(UART1,"..");</code></p>
  
  <p>But I cannot see if fopen is called for stdout so I am struggling to see how to manually implement this. (If I just call <code>fprintf(RANDOM_VALUE,..)</code>, I don't know how this will behave.</p>
  
  <p>I guess that once I have it directed to a different 'FILE', then it is simply a matter of checking which is being pointed to within fputc but it is the initial setting of the FILE pointer that I am struggling with.</p>
  
  <p>Perhaps some way to differentiate between stdout and stderr, although then I still have the same problem for getting input from the two separate channels.</p>
  
  <p>Also is fprintf in the microlib? If not, is there a better way to implement this?</p>
  
  <p>Thanks!</p>