嵌入式开发者社区

标题: timer模块的中断优先级设置 [打印本页]

作者: vtinf    时间: 2016-11-15 19:37
标题: timer模块的中断优先级设置
请问,omapl138 中 sysbios 的timer 组件如何设置中断的优先级?程序如下,该怎么配置呢?& l0 L: H! E4 A
void ad7606_start(ad7606 *ad, unsigned int rate) {
+ i) R( v( S" r' M% ?, e9 O: a2 C& H
         // 创建定时器# W& y# e* d4 F% P
            Timer_Params timerParams;
3 ]3 `! l7 f( I$ O2 Z            Error_Block eb;
: I- k! Y3 [+ Q. q3 k) C0 _
9 F3 U4 a: y0 l% Q% H7 Q            // 初始化错误块2 F3 ?) ]( x9 |4 m4 k
            Error_init(&eb);
. v4 F' a+ k' ~9 v! {            // 初始化参数
# [$ }1 g5 S) I. t            Timer_Params_init(&timerParams);& l; L3 {) l/ k7 W6 Z. G& S; L

: R2 b  K. k- V0 t, {3 P) G            // 配置周期
+ [7 h; L8 N, V& g+ V8 P            timerParams.period = 599 ;, f5 F9 v0 S. X7 ~1 ]
            timerParams.periodType = Timer_PeriodType_COUNTS ;
# n5 U* x: d% g1 d/ a/ Z# m# F( _, R' d9 r0 |
            // 实例化定时器& |6 f! H0 B# d; J) E
            Timer2 = Timer_create(2, ad7606_on_ticked, &timerParams, &eb);
. X$ G0 B2 H4 I$ c& x; x            if(Timer2 == NULL)
- H6 w) `) T5 G, F& V            {
$ e- {/ e4 L5 g+ A  w) F                    LOG_INFO("Timer2  not start。。。。");
2 i; T: R6 U( g! A/ F- T! U0 ~6 a7 R6 b" f            }
9 j5 i% |. ?3 w/ W5 L# B/ e# }8 B/ W1 b& s3 b
            Timer_start(Timer2);5 L3 W( }4 K1 J% e7 \/ C

- ?( ?# w+ C: P3 n& @% l            LOG_INFO("Timer2 start。。。。");4 R! c; I8 |2 k5 b

; o8 E; Q' A. n4 g9 P: |$ ~; T5 c4 D! G+ B) }! B
}
& f8 J, R; y8 N1 ]  ]  c/ x9 X! |. |% i
) F, k3 J: l/ w! D/ |) ~8 }4 O

作者: human    时间: 2016-11-16 11:01
// 中断号$ Z" j7 g  b' O- g  \/ X" m& W6 w8 B
    TimerParams.intNum = 5;5 ?! O" }1 I# Y$ V' b# R
可屏蔽中断4-15,优先级高-低




欢迎光临 嵌入式开发者社区 (https://www.51ele.net/) Powered by Discuz! X3.4