Gabriel
Joined: 03 Aug 2009 Posts: 1077 Location: Panama
|
|
Posted: Tue Oct 21, 2014 3:47 pm |
|
|
What the hell is this?
| Code: | #INT_RDA
void SerialInt()
{
if(RC7==0)
{
Receive_String[counter_read]=getchar(); // Gets chars from uart
counter_read++; // Increment counter
if(counter_read==SIZE_BUFFER)counter_read=0; // Circle Buffer
}else{
getc()
}
} |
you only read and fill the buffer when you input is Zero?
and if its 1 then you also get the char? what the hell?
as Ttelmah said:
| Quote: | | When INT_RDA triggers it is saying 'there is a character that needs to be read now'. |
You dont have to poll the line once you are in the interrupt... the interrupt is triggered by the UART once it ALREADY has the character ready to be placed in a variable or buffer..
I dont think you fully understand what the ISR does, what triggers it, how you are supposed to handle it, and how code flows with interrupts...
G. _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|