MT_TickWDT

■Description

Resets the count value of the watchdog timer.

■Synopsis

MT_TickWDT(fd, pwdt)

■Argument

int fd
 Please specify handle acquired by MT_Open function.

PWDTVAL pwdt
 Specify Pointer to the structure storing WDT setting information.
 For the pwdt structure, see MT_SetWDT.

■RETURN VALUE

[C/C++] int
[Python] ctypes.c_int
If the function succeeds, NO_ERROR is returned.
If the function fails, DRIVER_FAIL is returned.
The other errors : Error code details

■Note

After starting the watchdog timer with the MT_StartWDT function,
the system is reset unless this function is called before the specified timeout value elapses.
By calling this function, the count value up to the system reset is reset and the countdown starts again from the set value.
Also, if the dwTickCount member is set to a value other than 0,
if the MT_TickWDT function is called for the number of times by a timer etc., the count value will not be reset even if it is called.

■Sample Program Code

[C/C++]
  int fd;
  int ret;
  WDTVAL wdt;

  wdt.ucTimeOut = 0;
  wdt.lTickCount = 10;

  if ( (fd = MT_Open(NULL) ) < 0) {
    printf("Faild to open i2c port\n");
    return 1;
  }

  ret = MT_TickWDT(fd, &wdt);
  if (ret != 0) {
      printf("MT_SetWDT error");
  }

  MT_Close(fd);
  
[Python]
  import mtdll_arm

  wdt = WDTVAL();

  wdt.ucTimeOut = 0;
  wdt.lTickCount = 10;

  fd = mtdll_arm.MT_Open(None);

  ret = mtdll_arm.MT_TickWDT(fd, wdt);
  if ret != 0:
      print("MT_TickWDT error");

  mtdll_arm.MT_Close(fd);
  



Function List