From 83a8b28d36e78563de3bfc525cd77fbd7cdbb59a Mon Sep 17 00:00:00 2001 From: Vikram Rajput Date: Tue, 17 Sep 2024 12:17:24 +0530 Subject: [PATCH] Initialized some more ports --- lab5.c | 16 +++++++++++++--- tm4c123gh6pm_startup_ccs.c | 3 ++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lab5.c b/lab5.c index 3bd285d..baa9472 100644 --- a/lab5.c +++ b/lab5.c @@ -2,6 +2,7 @@ #include #include "tm4c123gh6pm.h" +void GPIOIntHandler(void); int main(void) { SYSCTL_RCGC2_R |= 0x00000020; /* enable clock to GPIOF */ @@ -10,8 +11,17 @@ int main(void) GPIO_PORTF_DEN_R = 0x1F; /* set PORTF pins 5 pins*/ GPIO_PORTF_DIR_R = 0x0E; /* set PORTF0 PORTF4 pin as input user switch pin */ GPIO_PORTF_PUR_R = 0x11; /* PORTF4 PORT0 is pulled up */ - GPIO_PORTF_IM_R = 0x11 /*Masking the ports*/ + GPIO_PORTF_IM_R = 0x11; /*Masking the ports*/ + GPIO_PORTF_IS_R = 0x00; GPIO_PORTF_IEV_R = 0x00; /*detects the falling edge of the switch*/ - - + GPIO_PORTF_IBE_R = 0x00 } + +while(1) + { + + + + + + } diff --git a/tm4c123gh6pm_startup_ccs.c b/tm4c123gh6pm_startup_ccs.c index a8f43e7..a1ca3e6 100644 --- a/tm4c123gh6pm_startup_ccs.c +++ b/tm4c123gh6pm_startup_ccs.c @@ -33,6 +33,7 @@ void ResetISR(void); static void NmiSR(void); static void FaultISR(void); static void IntDefaultHandler(void); +void GPIOIntHandler(void); //***************************************************************************** // @@ -113,7 +114,7 @@ void (* const g_pfnVectors[])(void) = IntDefaultHandler, // Analog Comparator 2 IntDefaultHandler, // System Control (PLL, OSC, BO) IntDefaultHandler, // FLASH Control - IntDefaultHandler, // GPIO Port F + GPIOIntHandler, // GPIO Port F IntDefaultHandler, // GPIO Port G IntDefaultHandler, // GPIO Port H IntDefaultHandler, // UART2 Rx and Tx