> I have not found the "Syntax highlighter" button...
You found something that let you format your code well. How did you do it?
To get to "Syntax Highlighter":
1 - Click on "Use advanced editor" at the top-right of the edit window,
2 - The Toolbar (B I = = " Ix Chain Camera ***) - click on the "***",
3 - There are now two rows in the Toolbad. Click on "More".
4 - Click on "Syntax highlighter".
> And the m_byInterruptLevel and m_byInterruptPriority are for every EPORT the same but for Port to Port different.
They MUST be different for every separate interrupt source, and that includes every EPORT. All seven of them have to unique Priority:Level. So if you want all EPORTs at the the same level, then they have to have priorities 1, 2, 3, 4, 5, 6, 7.
13.2.1.6 Interrupt Control Register (ICRnx, (x = 1, 2,..., 63))
Note: It is the responsibility of the software to program the ICRnx
registers with unique and non-overlapping level and priority definitions.
Failure to program the ICRnx registers in this manner can result in
undefined behavior. If a specific interrupt request is completely unused,
the ICRnx value can remain in its reset (and disabled) state.
Figure 13-9. Interrupt Control Register (ICRnx)
Everyone thinks on reading that that you can only have 64 different interrupts active in a system. But you shouldn't be using Level 7, so there are only 8 priorities and 7 levels, so that means only 56 interrupts. It is very easy to run out, as there are 60 interrupts on INTC0, and 51 on INTC1.
Except (and it doesn't say this anywhere) the interrupts only have to be unique within one controller. So you can use (say) Level 4 and Priority 4 for an interrupt on INTC0 and use the same Level and Priority for a different interrupt on INTC1.
I suggest you search this Forum for "It is the responsibility of the software to program the ICRnx" and look at previous interrupt controller problems and answers.
The above probably isn't causing this problem.
You're not writing to "EPFn" anywhere that I can see. You should do that before enabling interrupts (to clear any previous ones). That wouldn't cause your problem either.
MCF_INTC0_IMRL &= ~MCF_INTC0_IMRL_MASKALL;
MCF_INTC0_IMRL &= ~MCF_INTC0_IMRL_INT_MASK(m_byPortNr);
I thought the above might be a problem, but it is OK. You're clearing the MASKALL bit, and then that allows the other ones to be cleared. Check that second macro is doing what you expect. Also note that the fact that EPORTs 1-7 use INTC0 Interrupts 1-7 is a fluke. That doesn't work anywhere else. So the "type" of "m_byPortNr" isn't the same as the argument to that macro, but it works. It would be slightly cleaner (for other code) to make this mapping more explicit somewhere.
Back to your original problem. Assuming you can duplicate it (enable one port interrupt, enable a second, disable the first and the second one now doesn't work) I'd suggest you:
1 - Write some code to dump all the EPORT and relevant INTC0 registers.
2 - Dump the registers.
3 - Enable two EPORTs.
4 - Dump the registers.
5 - Disable one EPORT (causing the other one to stop).
6 - Dump the registers.
7 - Compare the last two dumps for all differences. Look for anything that explains the port that doesn't work.
Tom