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 20:48:27 UTC

[GitHub] [incubator-nuttx] NicholasChin opened a new pull request #2212: arch/arm/src/imxrt: adds support for WDOG1

NicholasChin opened a new pull request #2212:
URL: https://github.com/apache/incubator-nuttx/pull/2212


   Based on work done by Jake Choy.
   
   ## Summary
   Adds lower-half driver implementation for Watchdog 1 for IMXRT family.
   
   ## Impact
   Does not affect existing watchdog code in imxrt_wdog.c
   
   ## Testing
   Builds clean and checkpatch.sh is also clean
   


----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
NicholasChin commented on pull request #2212:
URL: https://github.com/apache/incubator-nuttx/pull/2212#issuecomment-721762732


   @acassis I've addressed your comments. Thanks!


----------------------------------------------------------------
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



[GitHub] [incubator-nuttx] acassis merged pull request #2212: arch/arm/src/imxrt: adds support for WDOG1

Posted by GitBox <gi...@apache.org>.
acassis merged pull request #2212:
URL: https://github.com/apache/incubator-nuttx/pull/2212


   


----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #2212:
URL: https://github.com/apache/incubator-nuttx/pull/2212#issuecomment-723309742


   Thank you @NicholasChin 


----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
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