Usage Examples
D-14
D.6.5
Statically Configuring a Level 2 Interrupt
This example plugs and enables Level 2 interrupt number 7. All other
level 1 and level 2 interrupts are disabled by the DSP/BIOS dispatcher
during the execution of "myIsr".
/*
* ======== l2_example4.c ========
* DSP/BIOS Level 2 interrupt example
*/
#include <std.h>
#include <hwi.h>
#include <log.h>
#include <c55.h>
extern LOG_Obj trace;
void myIsr (Arg id)
{
LOG_printf(&trace, "My L2 ISR %d", ArgToInt(id));
}
Void main ()
{
// Enable Level 2 interrupt number 7
C55_enableInt
(C55_L2_INT7);
}
-----------------------------------------------
TCONF script
-----------------------------------------------
/* ========= l2_example4.tcf ======== */
bios.HWI_L2_INT7.useDispatcher = 1;
// use HWI dispatcher
bios.HWI_L2_INT7.fxn = prog.extern("myIsr");
// attach to "myIsr" C function
bios.HWI_L2_INT7.arg = 7;
// pass interrupt ID as argument
bios.HWI_L2_INT7.iMirMask = "all";
// mask all other L2 ints
bios.HWI_L2_INT7.interruptMask0 = "all";
// mask L1 ints 0-15
bios.HWI_L2_INT7.interruptMask1 = "all";
// mask L1 ints 16-31