How to generate software interrupts and what about CMSIS?

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

How to generate software interrupts and what about CMSIS?

跳至解决方案
1,389 次查看
zeal
Contributor II

Hi, I need to generate software interrupts and I'm using the K60 twr board.

I have previously done like this:

 

#include "MK60N512MD100.h"
#include "core_cm4.h"

 

NVIC_EnableIRQ((IRQn_Type) 94); //Enable Software interrupts

 

NVIC->STIR = 94; //Genarate the interrupt. 

 

 

How do I do this when using MQX?, the problem is that the include files conflicts with the MQX libraries.

 

0 项奖励
1 解答
631 次查看
c0170
Senior Contributor III

Hi zeal,

 

#include <mqx.h>
#include <bsp.h>

 

those 2 headers you have to include for MQX  (check examples) then board header (MK60DZ10.h) is included too.

Use bsp_int_init instead of your function NVIC_Enable_IRQ.

 

Regards,

MartinK

在原帖中查看解决方案

0 项奖励
2 回复数
632 次查看
c0170
Senior Contributor III

Hi zeal,

 

#include <mqx.h>
#include <bsp.h>

 

those 2 headers you have to include for MQX  (check examples) then board header (MK60DZ10.h) is included too.

Use bsp_int_init instead of your function NVIC_Enable_IRQ.

 

Regards,

MartinK

0 项奖励
631 次查看
zeal
Contributor II

Thank you Kojto, I got it to work.

 

#include "mqx.h"

#include "bsp.h"


_int_install_isr(110, latency_isr, ptr);
_bsp_int_init(110, 64, 0, TRUE);

 

Then NVICSTIR = 94; generates the interrupt.

 

Thanks again.

0 项奖励