title: Macros to set and clear bits
body: <p>Im trying to write a few simple macros to simplify the task of setting and clearing bits which should be a simple task however I cant seem to get them to work correctly. </p>
  
  <pre><code>#define SET_BIT(p,n) ((p) |= (1 &lt;&lt; (n)))
  #define CLR_BIT(p,n) ((p) &amp;= (~(1) &lt;&lt; (n)))
  </code></pre>