mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
arch/arm/src/nrf52: nrf52_wdt_initialize() should return a success/fail indication.
This commit is contained in:
@@ -104,4 +104,3 @@ endif
|
|||||||
ifeq ($(CONFIG_NRF52_WDT),y)
|
ifeq ($(CONFIG_NRF52_WDT),y)
|
||||||
CHIP_CSRCS += nrf52_wdt.c
|
CHIP_CSRCS += nrf52_wdt.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -482,14 +482,16 @@ static int nrf52_settimeout(FAR struct watchdog_lowerhalf_s *lower,
|
|||||||
* /dev/watchdog0
|
* /dev/watchdog0
|
||||||
*
|
*
|
||||||
* Returned Values:
|
* Returned Values:
|
||||||
* None
|
* Zero (OK) is returned on success; a negated errno value is returned on
|
||||||
|
* any failure.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void nrf52_wdt_initialize(FAR const char *devpath, int16_t mode_sleep,
|
int nrf52_wdt_initialize(FAR const char *devpath, int16_t mode_sleep,
|
||||||
int16_t mode_halt)
|
int16_t mode_halt)
|
||||||
{
|
{
|
||||||
FAR struct nrf52_wdg_lowerhalf_s *priv = &g_wdgdev;
|
FAR struct nrf52_wdg_lowerhalf_s *priv = &g_wdgdev;
|
||||||
|
FAR void *handle;
|
||||||
|
|
||||||
wdinfo("Entry: devpath=%s, mode_sleep=%d, mode_halt=%d\n", devpath,
|
wdinfo("Entry: devpath=%s, mode_sleep=%d, mode_halt=%d\n", devpath,
|
||||||
mode_sleep, mode_halt);
|
mode_sleep, mode_halt);
|
||||||
@@ -515,7 +517,8 @@ void nrf52_wdt_initialize(FAR const char *devpath, int16_t mode_sleep,
|
|||||||
|
|
||||||
/* Register the watchdog driver as /dev/watchdog0 */
|
/* Register the watchdog driver as /dev/watchdog0 */
|
||||||
|
|
||||||
(void)watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv);
|
handle = watchdog_register(devpath, (FAR struct watchdog_lowerhalf_s *)priv);
|
||||||
|
return (handle != NULL) ? OK : -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_WATCHDOG && CONFIG_nrf52_IWDT */
|
#endif /* CONFIG_WATCHDOG && CONFIG_nrf52_IWDT */
|
||||||
|
|||||||
@@ -89,13 +89,14 @@ enum wdg_behaviour_e
|
|||||||
* debugger
|
* debugger
|
||||||
*
|
*
|
||||||
* Returned Values:
|
* Returned Values:
|
||||||
* None
|
* Zero (OK) is returned on success; a negated errno value is returned on
|
||||||
|
* any failure.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NRF52_WDT
|
#ifdef CONFIG_NRF52_WDT
|
||||||
void nrf52_wdg_initialize(FAR const char *devpath, int16_t behaviour_sleep,
|
int nrf52_wdg_initialize(FAR const char *devpath, int16_t behaviour_sleep,
|
||||||
int16_t behaviour_halt);
|
int16_t behaviour_halt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
|
|||||||
Reference in New Issue
Block a user