fix a problem where enabling the spurious interrupt handler screwed up
interrupt controller registers
This commit is contained in:
@@ -137,9 +137,9 @@ bool isr_register_handler(int vector, int level, int priority, bool (*handler)(v
|
||||
int index;
|
||||
int int_source;
|
||||
|
||||
if ((vector == 0) || (handler == NULL))
|
||||
if ((vector <= 0) || (handler == NULL))
|
||||
{
|
||||
dbg("illegal vector or handler!\r\n");
|
||||
dbg("illegal vector or handler (vector=%x, handler=%p)!\r\n", vector, handler);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -163,6 +163,8 @@ bool isr_register_handler(int vector, int level, int priority, bool (*handler)(v
|
||||
|
||||
int_source = vector - 64;
|
||||
|
||||
if (int_source >= 0)
|
||||
{
|
||||
if (!isr_enable_int_source(int_source))
|
||||
{
|
||||
dbg("failed to enable internal interrupt souce %d in IMRL/IMRH\r\n", int_source);
|
||||
@@ -174,7 +176,7 @@ bool isr_register_handler(int vector, int level, int priority, bool (*handler)(v
|
||||
dbg("failed to set priority and level for interrupt source %d\r\n", int_source);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -243,6 +245,8 @@ bool pic_interrupt_handler(void *arg1, void *arg2)
|
||||
{
|
||||
uint8_t rcv_byte;
|
||||
|
||||
dbg("PIC interrupt\r\n");
|
||||
|
||||
rcv_byte = MCF_PSC3_PSCRB_8BIT;
|
||||
if (rcv_byte == 2) /* PIC requests RTC data */
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user