Having trouble with interrupt priority level

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Having trouble with interrupt priority level

2,393 次查看
mbrown
Contributor I
I'm trying to enable and disable interrupts on my MCF5282.  I'm doing:
 
void
interrupt_enable()
{
 printf("interrupt enable\n");
 asm {
  move.l #0x00002000,d0
  move.w d0,SR
 }
}
void
interrupt_disable()
{
 printf("interrupt disable\n");
 asm {
  move.l #0x00002700,d0
  move.w d0,SR
 }
}
 
When I call these functions manually, everything is OK.  However, when I go into an interrupt (from the FEC) and attempt to disable further interrupts, I call the disable function but interrupts never stop.
Does anyone know what is happening here?
标签 (1)
0 项奖励
回复
3 回复数

1,007 次查看
rocco
Senior Contributor II
Hi, mbrown:

Are you sure they "never" stop? Could they be stopping for the duration of the ISR, but then being re-enabled when the ISR exits?

The SR is stacked by the interrupt, and will be restored by the interrupt-return. If you changed it within the ISR, it will still be restored to what it was prior to the interrupt, upon the completion of the ISR.

If you want to change the value that the SR will be when the interrupt exits, you can modify the value that was pushed onto the stack.
0 项奖励
回复

1,007 次查看
mbrown
Contributor I
rocco, I think you're right.  I was not realizing that the SR gets pushed to the stack and then restored after the interrupt.  So the effect is that interrupts are only being disabled for the time the coldfire is processing the interrupt. 
Thanks for the help.
0 项奖励
回复

1,007 次查看
PaoloRenzo
Contributor V
Maybe your Ethernet's interrupts are configured as interrupt level 7 (unmaskable). Only guessing
0 项奖励
回复