嵌入式开发者社区
标题:
watchdog配置
[打印本页]
作者:
aacmeme
时间:
2017-10-25 19:17
标题:
watchdog配置
请问谁静态配置过omapl138的看门狗?
2 p e# e0 V/ @
//*************** Add watchdog **********************//
9 x. }* j% X+ ^
var Clock = xdc.useModule("ti.sysbios.knl.Clock");
) U, u" w" J8 Q7 m4 q7 f4 b
var Timer = xdc.useModule("ti.sysbios.timers.timer64.Timer");
4 _, u2 t' x! h( M4 Y7 Q) p6 v
7 n: A7 q+ q# f9 Z1 M# ^* Q5 g
//Puts timer1 in watchdog mode
, u0 D/ v) z* z, X
Timer.timerSettings[1].mode = Timer.Mode_WATCHDOG;
/ w1 g3 l4 s4 e: r2 h1 s
Timer.timerSettings[1].master = true;
# i# l9 T) ~. d
# S, d0 g4 k( k: k
//Instance config parameters for Timer
% j! K8 w4 D( T
var timerParams = new Timer.Params(); //Create a new Timer params struct
& P2 M; o) R9 E0 C
timerParams.period = 1000; // set to your period value here
5 P2 e! q" {" |& x8 ?
timerParams.periodType = Timer.PeriodType_MICROSECS;
. |% y+ U8 E1 ?! y
timerParams.runMode = Timer.RunMode_ONESHOT; // specify if one shot or continuous mode
# @3 n! I8 X/ o6 F
9 T+ q; V/ c% I5 O
Program.global.Mywatchdog = Timer.create(1, "&WatchdogOvertime", timerParams);
3 Y: C3 S; L2 N4 y2 M
, a0 R+ S# H1 L
/ l b8 K1 \- r L1 D5 a6 F, p. k
这样配置后,编译出错,Unsupported mode: 2 is specified for Timer: 1
) G5 b, b# \8 X Z
竟然只支持chain和unchain的。。 请大神指点怎么配置????
# K/ y3 |( q1 M1 I% I. [! @7 L, I
欢迎光临 嵌入式开发者社区 (https://www.51ele.net/)
Powered by Discuz! X3.4