From e199fec0c08cf019cd5bc1bd4ca5b44516c50223 Mon Sep 17 00:00:00 2001 From: Vikram Rajput Date: Mon, 16 Sep 2024 10:51:33 +0530 Subject: [PATCH] removed the switch cases --- lab5.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lab5.c b/lab5.c index a719d34..3bd285d 100644 --- a/lab5.c +++ b/lab5.c @@ -10,19 +10,8 @@ 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_IEV_R = 0x00; /*detects the falling edge of the switch*/ + GPIO_PORTF_IM_R = 0x11 /*Masking the ports*/ + GPIO_PORTF_IEV_R = 0x00; /*detects the falling edge of the switch*/ -switch(z) - { - case 0: GPIO_PORTF_DATA_R = 0x02; - break; - - case 1:GPIO_PORTF_DATA_R = 0x00; - break; - - default:GPIO_PORTF_DATA_R = 0x04 - break; - - } }