From 9c440fe641c6edd615060930e5be19340fc0128b Mon Sep 17 00:00:00 2001 From: Aravind Date: Sat, 21 Sep 2024 21:25:50 +0530 Subject: [PATCH] added systic handler 1 --- main.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 1e97729..a8db78f 100644 --- a/main.c +++ b/main.c @@ -2,6 +2,9 @@ #include #include "tm4c123gh6pm.h" +void Systick_Handler(void); +void systickInit(void); + int main(void) { SYSCTL_RCGC2_R |= 0x00000020; /* enable clock to GPIOF */ @@ -26,4 +29,22 @@ int main(void) } -void Syst +void systickInit() +{ + NVIC_ST_CURRENT_R = 0; + NVIC_ST_CTRL_R = 0x07; + NVIC_ST_RELOAD_R = 8000000; +} + +void Systick_Handler() +{ + systickInit(); + if (GPIO_PORTF_DATA_R & 0x04) { + GPIO_PORTF_DATA_R &= ~0x04; + + } + else { + GPIO_PORTF_DATA_R |= 0x04; + } + systickInit(); + }