Comment update

This commit is contained in:
Sanyog Nevase Nevase 2024-10-29 01:35:42 +05:30
parent 2fee158217
commit def2bd27b7
1 changed files with 11 additions and 16 deletions

27
main.c
View File

@ -54,36 +54,31 @@ void UART1_RXTX_to_DISPLAY(char RX_DATA)
{ {
if (RX_DATA == 0x52) if (RX_DATA == 0x52)
{ {
GPIO_PORTF_DATA_R |= 0x02; // IF RECEIVED CHARACTER IS R TURN ON RED LED GPIO_PORTF_DATA_R |= 0x02; // IF RECEIVED CHARACTER IS R TURN ON RED LED
} }
else if (RX_DATA == 0x42) else if (RX_DATA == 0x42)
{ {
GPIO_PORTF_DATA_R |= 0x04; // IF RECEIVED CHARACTER IS B TURN ON BLUE LED GPIO_PORTF_DATA_R |= 0x04; // IF RECEIVED CHARACTER IS B TURN ON BLUE LED
} }
else if (RX_DATA == 0x47) else if (RX_DATA == 0x47)
{ {
GPIO_PORTF_DATA_R |= 0x08; // IF RECEIVED CHARACTER IS G TURN ON GREEN LED GPIO_PORTF_DATA_R |= 0x08; // IF RECEIVED CHARACTER IS G TURN ON GREEN LED
}
}
else else
{ {
GPIO_PORTF_DATA_R &= 0x00; // RED LED FOR JUNK DATA GPIO_PORTF_DATA_R &= 0x00; // RED LED FOR JUNK DATA
} }
UART1_WRITE(RX_DATA); // SEND RECEIVED DATA TO DISPLAY UART1_WRITE(RX_DATA); // SEND RECEIVED DATA TO DISPLAY
} }
int main(void) // MAIN FUNCTION int main(void) // MAIN FUNCTION
{ {
GPIO_PORT_F_init(); // GPIO PORT F INITIALISATION FUNCTION GPIO_PORT_F_init(); // GPIO PORT F INITIALISATION FUNCTION
GPIO_PORT_B_init(); // GPIO PORT B INITIALISATION FUNCTION GPIO_PORT_B_init(); // GPIO PORT B INITIALISATION FUNCTION
while (1) while (1)
{ {
UART1_RXTX_to_DISPLAY(UART1_READ()); // RECEIVE DATA, SEND RECEIVED DATA TO DISPLAY OR GLOW LED UART1_RXTX_to_DISPLAY(UART1_READ()); // RECEIVE DATA, SEND RECEIVED DATA TO DISPLAY OR GLOW LED
} }
} }