Some error corrections
This commit is contained in:
		
							parent
							
								
									1970542dc8
								
							
						
					
					
						commit
						5570e37d76
					
				
							
								
								
									
										20
									
								
								Lab6_Task1.c
								
								
								
								
							
							
						
						
									
										20
									
								
								Lab6_Task1.c
								
								
								
								
							| 
						 | 
				
			
			@ -14,7 +14,7 @@ void main(void)
 | 
			
		|||
    SYSCTL_RCGCPWM_R = 0x3; //
 | 
			
		||||
 | 
			
		||||
    GPIOF_config();
 | 
			
		||||
    GPIOF_Interrupt_config();
 | 
			
		||||
    GPIOF_Int_Config();
 | 
			
		||||
    GPIO_PORTF_AFSEL_R |= 0x02;
 | 
			
		||||
    GPIO_PORTF_PCTL_R |= 0x50;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -44,20 +44,20 @@ void GPIOF_config()
 | 
			
		|||
 | 
			
		||||
void GPIOF_Int_Config()
 | 
			
		||||
    {
 | 
			
		||||
    GPIO_PORTF_IM_R &= ~MASK_BITS;
 | 
			
		||||
    GPIO_PORTF_IS_R &= ~MASK_BITS;
 | 
			
		||||
    GPIO_PORTF_IEV_R &= ~MASK_BITS;
 | 
			
		||||
    GPIO_PORTF_IBE_R &= ~MASK_BITS;
 | 
			
		||||
    GPIO_PORTF_IM_R &= ~mask_bits;
 | 
			
		||||
    GPIO_PORTF_IS_R &= ~mask_bits;
 | 
			
		||||
    GPIO_PORTF_IEV_R &= ~mask_bits;
 | 
			
		||||
    GPIO_PORTF_IBE_R &= ~mask_bits;
 | 
			
		||||
    NVIC_PRI7_R = (NVIC_PRI7_R & 0xFF1FFFFF) | (2 << 21);
 | 
			
		||||
    NVIC_EN0_R |= (1 << 30);
 | 
			
		||||
    GPIO_PORTF_ICR_R = MASK_BITS;
 | 
			
		||||
    GPIO_PORTF_IM_R |= MASK_BITS;
 | 
			
		||||
    GPIO_PORTF_ICR_R = mask_bits;
 | 
			
		||||
    GPIO_PORTF_IM_R |= mask_bits;
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
void GPIOF_INT_Handler(void)
 | 
			
		||||
    {
 | 
			
		||||
        GPIO_PORTF_IM_R &= ~MASK_BITS;
 | 
			
		||||
        GPIO_PORTF_IM_R &= ~mask_bits;
 | 
			
		||||
        int i;
 | 
			
		||||
        if(GPIO_PORTF_RIS_R & 0x01)
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			@ -83,8 +83,8 @@ void GPIOF_INT_Handler(void)
 | 
			
		|||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        GPIO_PORTF_ICR_R = MASK_BITS;
 | 
			
		||||
        GPIO_PORTF_IM_R |= MASK_BITS;
 | 
			
		||||
        GPIO_PORTF_ICR_R = mask_bits;
 | 
			
		||||
        GPIO_PORTF_IM_R |= mask_bits;
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue