嵌入式开发者社区
标题:
watchdog配置
[打印本页]
作者:
aacmeme
时间:
2017-10-25 19:17
标题:
watchdog配置
请问谁静态配置过omapl138的看门狗?
5 Q) V, m7 H t' o6 a- ^8 q
//*************** Add watchdog **********************//
: X: g; ~( A" w' ^% V* y7 T
var Clock = xdc.useModule("ti.sysbios.knl.Clock");
0 c/ T. N1 [2 L* \5 c3 t7 c( z4 |
var Timer = xdc.useModule("ti.sysbios.timers.timer64.Timer");
/ V, d: @/ t3 E" D8 `5 E1 z
. y+ T0 R( M% c% U
//Puts timer1 in watchdog mode
+ O7 n- o4 g9 q8 _/ U7 G5 d
Timer.timerSettings[1].mode = Timer.Mode_WATCHDOG;
' d0 F6 _8 p' ^! J
Timer.timerSettings[1].master = true;
( Z0 j/ n3 J) H3 p- B! g. i
( n- G7 B) S+ G1 n
//Instance config parameters for Timer
8 T8 B9 }% G& _0 f8 b1 z+ r3 h
var timerParams = new Timer.Params(); //Create a new Timer params struct
9 n3 K& v/ N8 t( i. M5 C
timerParams.period = 1000; // set to your period value here
- p' @1 r& q0 F3 n9 M# x7 d [4 ^' o/ R
timerParams.periodType = Timer.PeriodType_MICROSECS;
' N4 _! d" D& n
timerParams.runMode = Timer.RunMode_ONESHOT; // specify if one shot or continuous mode
7 l* }! o8 w3 P' n5 J9 w9 T! |
5 a# V1 ?4 }' n8 n0 j. g
Program.global.Mywatchdog = Timer.create(1, "&WatchdogOvertime", timerParams);
3 U' q: `7 W+ y' P) |0 g$ l7 A
5 a L. Z" W3 W; X9 Y
% Y4 Z4 O" F: k. E0 D
这样配置后,编译出错,Unsupported mode: 2 is specified for Timer: 1
3 S, ^/ t- x! Z% L+ S
竟然只支持chain和unchain的。。 请大神指点怎么配置????
7 o9 v; z; |: p) `& v) k+ m5 b
欢迎光临 嵌入式开发者社区 (https://www.51ele.net/)
Powered by Discuz! X3.4