title: Correct way of implementing a uart receive buffer in a small ARM microcontroller?
body: <p>I am looking for ideas for a receive buffer for a small application dealing with 15 byte packets at 921.6Kbaud over rs485. I am thinking of using a circular buffer as the interface between the UART ISR and main. As it is a microprocessor I was wanting to put </p>
  
  <pre><code>while (uartindex!=localindex) { do stuff } 
  </code></pre>
  
  <p>in the </p>
  
  <pre><code>while (;;) {do forever} 
  </code></pre>
  
  <p>part of main but I have been told this is not acceptable. </p>
  
  <p>How do people deal with their uarts under similar circumstances?</p>