You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/11/03 22:09:49 UTC

[GitHub] [incubator-nuttx] acassis commented on a change in pull request #2212: arch/arm/src/imxrt: adds support for WDOG1

acassis commented on a change in pull request #2212:
URL: https://github.com/apache/incubator-nuttx/pull/2212#discussion_r516983350



##########
File path: arch/arm/src/imxrt/imxrt_wdog.c
##########
@@ -40,28 +40,346 @@
 #include <nuttx/config.h>
 
 #include <stdint.h>
-#include <fixedmath.h>
+#include <stdbool.h>
+
+#include <debug.h>
 #include <assert.h>
+#include <errno.h>
 
-#include "arm_arch.h"
+#include <nuttx/timers/watchdog.h>
 
+#include "arm_arch.h"
 #include "hardware/imxrt_wdog.h"
-#include "imxrt_config.h"
+#include "imxrt_wdog.h"
+
 #include <arch/board/board.h> /* Include last:  has dependencies */
 
+#if defined(CONFIG_WATCHDOG) && defined(CONFIG_IMXRT_WDOG)
+
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
-/* Configuration ************************************************************/
+
+/* Select the path to the registered watchdog timer device */
+
+#ifdef CONFIG_WATCHDOG_DEVPATH
+#define DEVPATH CONFIG_WATCHDOG_DEVPATH
+#else
+#define DEVPATH "/dev/watchdog0"
+#endif
+
+/* Time out range is from 0 to 128 seconds in 0.5s intervals */
+
+#define WDOG_MIN      (500)   // 0.5 seconds

Review comment:
       Please remove C++ comments

##########
File path: arch/arm/src/imxrt/imxrt_wdog.c
##########
@@ -40,28 +40,346 @@
 #include <nuttx/config.h>
 
 #include <stdint.h>
-#include <fixedmath.h>
+#include <stdbool.h>
+
+#include <debug.h>
 #include <assert.h>
+#include <errno.h>
 
-#include "arm_arch.h"
+#include <nuttx/timers/watchdog.h>
 
+#include "arm_arch.h"
 #include "hardware/imxrt_wdog.h"
-#include "imxrt_config.h"
+#include "imxrt_wdog.h"
+
 #include <arch/board/board.h> /* Include last:  has dependencies */
 
+#if defined(CONFIG_WATCHDOG) && defined(CONFIG_IMXRT_WDOG)
+
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
-/* Configuration ************************************************************/
+
+/* Select the path to the registered watchdog timer device */
+
+#ifdef CONFIG_WATCHDOG_DEVPATH
+#define DEVPATH CONFIG_WATCHDOG_DEVPATH
+#else
+#define DEVPATH "/dev/watchdog0"
+#endif
+
+/* Time out range is from 0 to 128 seconds in 0.5s intervals */
+
+#define WDOG_MIN      (500)   // 0.5 seconds
+#define WDOG_MAX      (128000)   // 128 seconds
+
+#define WDOG_KEEP_ALIVE_KEY1        (0x5555U)
+#define WDOG_KEEP_ALIVE_KEY2        (0xAAAAU)

Review comment:
       Hexa code needs to be in lower case




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org