title: Turn led on when both switches are pressed
body: <p>I'm trying to turn the led on in my tiva launchpad(tm4c123).</p>
  
  <p>Current code : </p>
  
  <pre><code>while (1)       
      {
          switch(GPIO_PORTF_DATA_R &amp; 0x11) // 0x11 = 10001
          {
              case 0x00: //both switches are pressed
              {
                  GPIO_PORTF_DATA_R = 0x02; // turn on the red led
                  break;
              }
              case 0x01: //SW1 is pressed, SW2 is not pressed
              {
                  GPIO_PORTF_DATA_R = 0x04; // turn on the blue led
                  break;
              }
              case 0x10: //SW2 is pressed, SW1 is not pressed
              {
                  GPIO_PORTF_DATA_R = 0x08; // turn on the green led
                  break;
              }
              default:
                  GPIO_PORTF_DATA_R = 0;
                  break;
          }
      }
  </code></pre>
  
  <p>Without this two lines of code, this is what happens : </p>
  
  <ul>
  <li>The board start with the green led on. </li>
  <li>When I press both or only SW2 nothing happens. </li>
  <li>When I press SW1 the red led turn on.</li>
  </ul>
  
  <p>Could someone explain to me why?</p>
  
  <pre><code>GPIO_PORTF_LOCK_R = 0x4C4F434B;
  GPIO_PORTF_CR_R = 0x1F;
  </code></pre>