嵌入式开发者社区

标题: watchdog配置 [打印本页]

作者: aacmeme    时间: 2017-10-25 19:17
标题: watchdog配置
请问谁静态配置过omapl138的看门狗?6 d# {1 O" ~$ N% `& l$ f% C
//*************** Add watchdog **********************//
' J) M2 k3 _* g! U* O- S. i2 f3 zvar Clock = xdc.useModule("ti.sysbios.knl.Clock");
' @. g3 a, ^$ p7 ~+ `var Timer = xdc.useModule("ti.sysbios.timers.timer64.Timer");, Q  A: W) k& @
+ x8 l4 c+ ~3 c; t2 ?6 b  L5 V
//Puts timer1 in watchdog mode
, _0 f$ n4 l( t0 T& lTimer.timerSettings[1].mode = Timer.Mode_WATCHDOG;& d2 l$ ?* J, [2 U: Z
Timer.timerSettings[1].master = true;! y7 ]# F2 q. [: f3 c3 l) L
+ ]2 X7 j2 z6 A8 A
//Instance config parameters for Timer
; O" E+ Y1 l; w8 K- A2 g3 ?var timerParams = new Timer.Params(); //Create a new Timer params struct0 s" x3 o# f. s
timerParams.period = 1000;  // set to your period value here
+ ?: F/ B! a' L  S" x8 AtimerParams.periodType = Timer.PeriodType_MICROSECS;! x, H0 X% {* x" [3 m8 y; R0 X
timerParams.runMode = Timer.RunMode_ONESHOT;  // specify if one shot or continuous mode1 ]0 R4 L) ?6 s7 J- E

$ T% B' O  J6 xProgram.global.Mywatchdog = Timer.create(1, "&WatchdogOvertime", timerParams);
3 A8 l4 g9 N) i
, N9 G+ k/ X' g
) ^: l- K0 [% z这样配置后,编译出错,Unsupported mode: 2 is specified for Timer: 1
% l: G" t# p% l& i6 F. k竟然只支持chain和unchain的。。 请大神指点怎么配置????
$ t: `$ n5 p- u. Q* U9 a




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