View previous topic :: View next topic |
Author |
Message |
guest Guest
|
getchar() |
Posted: Wed Mar 01, 2006 2:12 pm |
|
|
Device = F628A with UART enabled
Can I write my own RDA interrupt and not affecting getchar() operation? Or can I cascade my ISR routine back to the CCS one?
Basically I want to stop any delay_xx() function when an incoming character like 0xff is in and reset the whole device to start from beginning and then start processing incoming UART streams (of course, the first chararcter will be discarded or lost). |
|
 |
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
Re: getchar() |
Posted: Wed Mar 01, 2006 3:45 pm |
|
|
guest wrote: | Can I write my own RDA interrupt and not affecting getchar() operation? |
Yes. If I'm not mistaken, and if I understood your question correctly, the following should work.
Code: |
#INT_RDA
void isr_rda()
{
// Anything goes here except getchar() and such
// However, keep the ISR execution time as short as practical
}
void main()
{
// initialize variables
// initialize hardware
// enable interrupts
while (1)
{
getchar();
}
}
|
Hope it helped. |
|
 |
Guest
|
|
Posted: Wed Mar 01, 2006 4:10 pm |
|
|
thanx! |
|
 |
|