apps/examples/watchdog: Remove call to up_wdginitialize(). This must be done in board-specific initialization. The call fram application space is not permitted.

This commit is contained in:
Gregory Nutt 2016-05-18 19:21:51 -06:00
parent c663c11764
commit 4f33dd14d4
2 changed files with 16 additions and 28 deletions

View File

@ -9,6 +9,21 @@ config EXAMPLES_WATCHDOG
---help---
Enable the watchdog timer example
In order to use this example, board specific logic must register the
watchdog timer driver. That would be in the board bring-up logic
in the configs/<board>/src directory for the board.
The way that this is done depends on the underlying MCU architecture.
For STM32, this would be done like:
#include "stm32_wdg.h"
#if defined(CONFIG_STM32_WWDG)
stm32_wwdginitialize(CONFIG_STM32_WDG_DEVPATH);
#elif defined(CONFIG_STM32_IWDG)
stm32_iwdginitialize(CONFIG_STM32_WDG_DEVPATH, CONFIG_STM32_LSIFREQ);
#endif
if EXAMPLES_WATCHDOG
config EXAMPLES_WATCHDOG_DEVPATH

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/watchdog/watchdog_main.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -53,10 +53,6 @@
#include "watchdog.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
@ -68,18 +64,6 @@ struct wdog_example_s
uint32_t timeout;
};
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -238,17 +222,6 @@ int wdog_main(int argc, char *argv[])
parse_args(&wdog, argc, argv);
/* Initialization of the WATCHDOG hardware is performed by logic external to
* this test.
*/
ret = up_wdginitialize();
if (ret != OK)
{
printf("wdog_main: up_wdginitialize failed: %d\n", ret);
goto errout;
}
/* Open the watchdog device for reading */
fd = open(CONFIG_EXAMPLES_WATCHDOG_DEVPATH, O_RDONLY);