Ttelmah
Joined: 11 Mar 2010 Posts: 19516
|
|
Posted: Thu Sep 20, 2018 1:36 am |
|
|
I think you are seriously misunderstanding interrupts.
Yes you can have multiple interrupts, if you get rid of the int_global handler.
Have a handler for #INT_EXT, and a handler for #INT_RDA. Each will be called when the corresponding interrupt triggers (remember that INT_RDA must read the serial port of this interrupt will never clear).
However if you have a #INT_GLOBAL handler, this replaces _all other interrupts_. It is called when any interrupt triggers. It must then contain your own code to save all variables used, and if multiple interrupts are used, it must poll all of them.
Get rid of the int_global handler, and then your other interrupts can behave normally. The INT_GLOBAL handler is only used if you are writing the entire interrupt handling system yourself.
You still need to enable #INT_GLOBAL. This is not in itself an 'interrupt', it is a 'master flag' allowing all interrupts to be enabled/disabled at once. If you use it as an 'interrupt', you are saying that you want to take over complete control of the interrupt system.... |
|