Can the below code be modified per these requirements? Call your state machine every 500000 us. Continuously blink SOS in Morse code on the green and red LEDs. If a button is pushed, toggle the message between SOS and OK. Pushing the button in the middle of a message should NOT change the message until it is complete. For example, if you push the button while the O in SOS is being blinked out, the message will not change to OK until after the SOS message is completed. The following guidance will help provide a base for the functionality you are creating: Dot = red LED on for 500ms Dash = green LED on for 1500ms 3*500ms between characters (both LEDs off) 7*500ms between words (both LEDs off), for example SOS 3500ms SOS * ======== gpiointerrupt.c ======== */ #include #include /* Driver Header files */ #include #include /* Driver configuration */ #include "ti_drivers_config.h" /* Morse Code for SOS */ #define SOS "***---***" /* Morse Code for OK */ #define OK "-.-.-" int SOS_state = 0; int OK_state = 0; int is_SOS = 1; /* LED Blink Timer Callback */ void timerCallback(Timer_Handle myHandle, int_fast16_t status) { if(is_SOS){ // Blink SOS switch(SOS_state){ case 0: GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_ON); GPIO_write(CONFIG_GPIO_LED_1, CONFIG_GPIO_LED_OFF); break; case 1: GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_OFF); GPIO_write(CONFIG_GPIO_LED_1, CONFIG_GPIO_LED_ON); break; case 2: GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_ON); GPIO_write(CONFIG_GPIO_LED_1, CONFIG_GPIO_LED_OFF); break; default: break; } SOS_state++; if(SOS_state >= strlen(SOS)){ SOS_state = 0; } }else{ // Blink OK switch(OK_state){ case 0: GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_ON); GPIO_write(CONFIG_GPIO_LED_1, CONFIG_GPIO_LED_OFF); break; case 1: GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_OFF); GPIO_write(CONFIG_GPIO_LED_1, CONFIG_GPIO_LED_ON); break; case 2: GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_OFF); GPIO_write(CONFIG_GPIO_LED_1, CONFIG_GPIO_LED_ON); break; case 3: GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_ON); GPIO_write(CONFIG_GPIO_LED_1, CONFIG_GPIO_LED_OFF); break; default: break; } OK_state++; if(OK_state >= strlen(OK)){ OK_state = 0; } } } /* * ======== gpioButtonFxn0 ======== * Callback function for the GPIO interrupt on CONFIG_GPIO_BUTTON_0. * * Note: GPIO interrupts are cleared prior to invoking callbacks. */ void gpioButtonFxn0(uint_least8_t index) { /* Toggle message between SOS and OK */ is_SOS = !is_SOS; } /* * ======== mainThread ======== */ void *mainThread(void *arg0) { /* Call driver init functions */ GPIO_init(); /* Configure the LED and button pins */ GPIO_setConfig(CONFIG_GPIO_LED_0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW); GPIO_setConfig(CONFIG_GPIO_LED_1, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW); GPIO_setConfig(CONFIG_GPIO_BUTTON_0, GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING); /* Turn on user LED */ GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_ON); /* Install Button callback */ GPIO_setCallback(CONFIG_GPIO_BUTTON_0, gpioB.