The use of the Hardware Interrupt block in Target Support Package TC2
1 回表示 (過去 30 日間)
古いコメントを表示
In the hardware Interrupt block, there is a parameter named preemption flag. In the help document,i got that "Preemption overrides prioritization, such that a preemptable task of higher priority can be preempted by a non-preemptable task of lower priority."
I set my interrupt1' priority is 30 and the preemptition flag is 0(non-preemptable);the interrupt2's priority is 25 and the preemptition flag is 1(preemptable).
So i think when the interrupt1 happened and the program runs in the interrupt1 service routine,if interrupt2 is triggered, my program will run to the interrupt2 service routine immediately.And when the interrupt2 service routine ran over,the program returned to interrupt1 service routine.Is this right? But i didn’t get this result in my oscillograph after loading the generted code to my DSP board. Could somebody explain the use of the preemptition flag?
What is the relationship between the sample time and the base rate?
Best regards.
0 件のコメント
回答 (1 件)
Kaustubha Govind
2011 年 11 月 23 日
I think the expected behavior would be as follows:
when the interrupt1 happened and the program runs in the interrupt1 service routine,if interrupt2 is triggered -> interrupt1 will continue to run because it is non-preemptable.
You probably want to switch your pre-emption flags around if you need interrupt2 to pre-empt interrupt1.
2 件のコメント
Kaustubha Govind
2011 年 12 月 21 日
w: Could you report this to MathWorks Tech Support with a simple model for reproduction? Perhaps it is a bug?
参考
カテゴリ
Help Center および File Exchange で Spectral Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!