|
板凳

楼主 |
发表于 2014-8-30 15:08:03
|
只看该作者
昨天已经找到方法了,就是用HWI,忘记过来写答案了,谢谢啦
static void SetUpInt(void)
{
Hwi_Params hwiParams;
Error_Block eb;
Hwi_Params_init(&hwiParams);
Error_init(&eb);
// set the event id 37 of the peripheral assigned to this interrupt
hwiParams.eventId = SYS_INT_SPI0_INT;
// don't allow any interrupt to nest
hwiParams.maskSetting = Hwi_MaskingOption_ALL;
//
// Configure interrupt 4 to invoke "SPIIsr".
// Automatically enables interrupt 4 by default
// set params.enableInt = FALSE if you want to control
// when the interrupt is enabled using Hwi_enableInterrupt()
//
myHwi = Hwi_create(4, SPIIsr, &hwiParams, &eb);
if (Error_check(&eb)) {
// handle the error
System_abort ("SPI Interrupt initialization is failed\n");
}
}
我是这样写的,请问对么?
|
|