嵌入式开发者社区
标题:
watchdog配置
[打印本页]
作者:
aacmeme
时间:
2017-10-25 19:17
标题:
watchdog配置
请问谁静态配置过omapl138的看门狗?
3 b( r' c" y. c
//*************** Add watchdog **********************//
" ~6 P0 w: ?/ m/ R& l$ Z+ c
var Clock = xdc.useModule("ti.sysbios.knl.Clock");
) U* U5 V2 {3 A ^ Z
var Timer = xdc.useModule("ti.sysbios.timers.timer64.Timer");
7 X4 W' Y7 a' V$ c
; D9 s8 C8 m( n# O' M
//Puts timer1 in watchdog mode
& {' Z1 \: g) t/ Z: q
Timer.timerSettings[1].mode = Timer.Mode_WATCHDOG;
+ a% j( K2 [% [4 [! t6 M
Timer.timerSettings[1].master = true;
) b; U8 d r s4 M
1 S/ k4 k& G) O: y0 F. W
//Instance config parameters for Timer
; `4 C' S; ^2 y) E& ]/ Q" y
var timerParams = new Timer.Params(); //Create a new Timer params struct
2 ?- x, a* z; P. G, _
timerParams.period = 1000; // set to your period value here
/ H8 P. @6 L/ [* b) o# {( M7 B
timerParams.periodType = Timer.PeriodType_MICROSECS;
6 }$ g6 q! y6 [ J) |
timerParams.runMode = Timer.RunMode_ONESHOT; // specify if one shot or continuous mode
, c: i/ C V, o
5 p4 b) L# U4 m2 X" R( E! m
Program.global.Mywatchdog = Timer.create(1, "&WatchdogOvertime", timerParams);
! H, j H, L1 {$ J. s8 t
0 c. ~6 G r+ O* _& K* O
/ M& q7 e: E( e
这样配置后,编译出错,Unsupported mode: 2 is specified for Timer: 1
9 S# O, ~9 { K8 f
竟然只支持chain和unchain的。。 请大神指点怎么配置????
6 G( A$ I: l. t0 o
欢迎光临 嵌入式开发者社区 (https://www.51ele.net/)
Powered by Discuz! X3.4