This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Why does the program skip a line?

 // Port D:
 
#define SYSCTL_RCGC2_R          (*((volatile unsigned long *)0x400FE108))
#define GPIO_PORTD_DATA_R       (*((volatile unsigned long *)0x400073FC))
#define GPIO_PORTD_DIR_R        (*((volatile unsigned long *)0x40007400))
#define GPIO_PORTD_AFSEL_R      (*((volatile unsigned long *)0x40007420))
#define GPIO_PORTD_DEN_R        (*((volatile unsigned long *)0x4000751C))
#define GPIO_PORTD_AMSEL_R      (*((volatile unsigned long *)0x40007528))
#define GPIO_PORTD_PCTL_R       (*((volatile unsigned long *)0x4000752C))

// Port E

#define GPIO_PORTE_DATA_R       (*((volatile unsigned long *)0x400243FC))
#define GPIO_PORTE_DIR_R        (*((volatile unsigned long *)0x40024400))
#define GPIO_PORTE_AFSEL_R      (*((volatile unsigned long *)0x40024420))
#define GPIO_PORTE_DEN_R        (*((volatile unsigned long *)0x4002451C))
#define GPIO_PORTE_AMSEL_R      (*((volatile unsigned long *)0x40024528))
#define GPIO_PORTE_PCTL_R       (*((volatile unsigned long *)0x4002452C))
#define GPIO_PORTE_CR_R         (*((volatile unsigned long *)0x40024524))	
	
unsigned long in1, in2, in3;

char const output[] = {0x08, 0x02};
char const led[] = {0x02, 0x04, 0x10, 0x20};
int main(void){

	
	unsigned long volatile delay, delay1;
		
	SYSCTL_RCGC2_R |= 0x08;           // Port D clock
  delay = SYSCTL_RCGC2_R;           // wait 3-5 bus cycles
  GPIO_PORTD_DIR_R |= 0x0A;         // PD3, PD2 output
  GPIO_PORTD_DIR_R &= ~0x01;        // PD0 input 
  GPIO_PORTD_AFSEL_R &= ~0x0B;      // not alternative
  GPIO_PORTD_AMSEL_R &= ~0x0B;      // no analog
  GPIO_PORTD_PCTL_R &= ~0x0000F0FF; // bits for PD3, PD1, PD0
  GPIO_PORTD_DEN_R |= 0x0B;         // enable PD3, PD1, PD0
	
	SYSCTL_RCGC2_R |= 0x10;       // Port D clock
  delay1 = SYSCTL_RCGC2_R;           // wait 3-5 bus cycles
  GPIO_PORTE_DIR_R |= 0x36;         // PD3, PD2 output
  GPIO_PORTE_DIR_R &= ~0x09;        // PD0 input 
  GPIO_PORTE_AFSEL_R &= ~0x3F;      // not alternative
  GPIO_PORTE_AMSEL_R &= ~0x3F;      // no analog
  GPIO_PORTE_PCTL_R = 0x00000000; // bits for PD3, PD1, PD0
  GPIO_PORTE_DEN_R |= 0x3F;         // enable PD3, PD1, PD0
	
	while(1){

		
		// Parking spot 1:
		
		  
		  in1 = (GPIO_PORTD_DATA_R&0x01); // in 0 if not pressed, 1 if pressed

			if(in1 == 0x01){
		     GPIO_PORTD_DATA_R = output[0];
			}else if(in1 == 0x00){
				 GPIO_PORTD_DATA_R = output[1];
			}
			
			in2 = (GPIO_PORTE_DATA_R&0x01); // in 0 if not pressed, 1 if pressed

			if(in2 == 0x00){
		     GPIO_PORTE_DATA_R = led[0];
			}else if(in2 == 0x01){
				 GPIO_PORTE_DATA_R = led[1];
			}
			
			in3 = (GPIO_PORTE_DATA_R&0x08); // in 0 if not pressed, 1 if pressed

			if(in3 == 0x01){
				
		     GPIO_PORTE_DATA_R = led[2];
				
			}else if(in3 == 0x00){
				
				 GPIO_PORTE_DATA_R = led[3];
			}
		
	}//While loop
}//end of design

I am using Kiel Development kit., When in3 button is pressed it skips this line. 

GPIO_PORTE_DATA_R = led[2];