diff --git a/main.c b/main.c index b20c266..3f156b4 100644 --- a/main.c +++ b/main.c @@ -75,7 +75,27 @@ void delay(int us) //DEFINING DELAY FUNCTION STCTRL &= 0x0; // Stop the timer } +void STATUS_LED(char received_data) +{ + if (received_data == 0xAA) + { + GPIO_PORTF_DATA_R |= 0x08; // Turn on Green LED (PF3) + GPIO_PORTF_DATA_R &= ~0x04; // Turn off Blue LED (PF2) + } + else if (received_data == 0xF0) + { + GPIO_PORTF_DATA_R |= 0x04; // Turn on Blue LED (PF2) + GPIO_PORTF_DATA_R &= ~0x08; // Turn off Green LED (PF3) + } + else + { + GPIO_PORTF_DATA_R |= 0x02; + } + //delay(500000); + //GPIO_PORTF_DATA_R &= 0x00; // Turn on Green LED (PF3) + +} void GPIOF_interruptHandler(void) // Interrupt handler for GPIO Port F @@ -110,6 +130,7 @@ int main(void) // MAIN FUNCTION systick_setting(); // SYSTICK SETUP while (1) { + STATUS_LED(UART1_READ()); } }