This should be easy to answer to anyone familiar with C. I want to display the previous values of a variable (receive register of a UART (RS-232) on a microcontroller) on an LCD. This is my current implementation and it works ok. But I'd like to know if there is a way to spend less time in my interrupt routine. Currently, the peripheral is configured to jump to the interrupt routine as soon as it receives one new character in the UART feed. Suggestions anyone?
//Initialization
char U1RX_data = '\0';
char p0_U1RX_data = '\0';
char p1_U1RX_data = '\0';
char p2_U1RX_data = '\0';
char p3_U1RX_data = '\0';
char p4_U1RX_data = '\0';
char p5_U1RX_data = '\0';
char p6_U1RX_data = '\0';
char p7_U1RX_data = '\0';
char U1buf[] = {p7_U1RX_data, p6_U1RX_data, p5_U1RX_data,
p4_U1RX_data, p3_U1RX_data, p2_U1RX_data,
p1_U1RX_data, p0_U1RX_data, U1RX_data, '\0'};
disp_string(-61, 17, 1, U1buf); //X, Y, mode, string
void _U1RXInterrupt(void){
p7_U1RX_data = p6_U1RX_data;
p6_U1RX_data = p5_U1RX_data;
p5_U1RX_data = p4_U1RX_data;
p4_U1RX_data = p3_U1RX_data;
p3_U1RX_data = p2_U1RX_data;
p2_U1RX_data = p1_U1RX_data;
p1_U1RX_data = p0_U1RX_data;
p0_U1RX_data = U1RX_data;
U1RX_data = U1RXREG;
IFS0bits.U1RXIF = 0;
}