arch/arm/src/nrf52: nrf52_wdt_initialize() should return a success/fail indication.
This commit is contained in:
parent
677be2f437
commit
901d20e64b
@ -104,4 +104,3 @@ endif
|
||||
ifeq ($(CONFIG_NRF52_WDT),y)
|
||||
CHIP_CSRCS += nrf52_wdt.c
|
||||
endif
|
||||
|
||||
|
@ -482,14 +482,16 @@ static int nrf52_settimeout(FAR struct watchdog_lowerhalf_s *lower,
|
||||
* /dev/watchdog0
|
||||
*
|
||||
* 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,
|
||||
int16_t mode_halt)
|
||||
int nrf52_wdt_initialize(FAR const char *devpath, int16_t mode_sleep,
|
||||
int16_t mode_halt)
|
||||
{
|
||||
FAR struct nrf52_wdg_lowerhalf_s *priv = &g_wdgdev;
|
||||
FAR void *handle;
|
||||
|
||||
wdinfo("Entry: devpath=%s, mode_sleep=%d, mode_halt=%d\n", devpath,
|
||||
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 */
|
||||
|
||||
(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 */
|
||||
|
@ -89,13 +89,14 @@ enum wdg_behaviour_e
|
||||
* debugger
|
||||
*
|
||||
* Returned Values:
|
||||
* None
|
||||
* Zero (OK) is returned on success; a negated errno value is returned on
|
||||
* any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NRF52_WDT
|
||||
void nrf52_wdg_initialize(FAR const char *devpath, int16_t behaviour_sleep,
|
||||
int16_t behaviour_halt);
|
||||
int nrf52_wdg_initialize(FAR const char *devpath, int16_t behaviour_sleep,
|
||||
int16_t behaviour_halt);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
|
Loading…
Reference in New Issue
Block a user