From 7bea6854e57a05548fe7c4acb6df767b2148ae6d Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Thu, 30 Aug 2018 16:42:43 +0000 Subject: [PATCH] Merged in sur5r/nuttx-nuttx/lpc43_wwdt-fix (pull request #713) arch/arm/src/lpc43xx: Make WWDT usable again LPC43xx WWDT driver was not updated when irq_dispatch grew an argument flag in b3222bbc8a18af33eef38a147165ee1999124b21. Also fixes two typos and a naming inconsistency (WWDT vs. WWDG). Approved-by: GregoryN --- arch/arm/src/lpc43xx/lpc43_wdt.h | 6 +++--- arch/arm/src/lpc43xx/lpc43_wwdt.c | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/src/lpc43xx/lpc43_wdt.h b/arch/arm/src/lpc43xx/lpc43_wdt.h index c1d88a01e6..b006071db5 100644 --- a/arch/arm/src/lpc43xx/lpc43_wdt.h +++ b/arch/arm/src/lpc43xx/lpc43_wdt.h @@ -43,7 +43,7 @@ #include #include "chip.h" -#include "chip/lpc43_wdt.h" +#include "chip/lpc43_wwdt.h" #ifdef CONFIG_WATCHDOG @@ -67,10 +67,10 @@ extern "C" ****************************************************************************/ /**************************************************************************** - * Name: lpc43_wwtginitialize + * Name: lpc43_wwdtinitialize * * Description: - * Initialize the WWDG watchdog time. The watchdog timer is initializeed and + * Initialize the WWDT watchdog timer. The watchdog timer is initializeed and * registers as 'devpath. The initial state of the watchdog time is * disabled. * diff --git a/arch/arm/src/lpc43xx/lpc43_wwdt.c b/arch/arm/src/lpc43xx/lpc43_wwdt.c index fb60102d42..785be62145 100644 --- a/arch/arm/src/lpc43xx/lpc43_wwdt.c +++ b/arch/arm/src/lpc43xx/lpc43_wwdt.c @@ -101,7 +101,7 @@ static void lpc43_setwarning(uint32_t warning); /* Interrupt hanlding *******************************************************/ -static int lpc43_interrupt(int irq, FAR void *context); +static int lpc43_interrupt(int irq, FAR void *context, FAR void *arg); /* "Lower half" driver methods **********************************************/ @@ -211,7 +211,7 @@ static void lpc43_setwarning(uint32_t warning) * ****************************************************************************/ -static int lpc43_interrupt(int irq, FAR void *context) +static int lpc43_interrupt(int irq, FAR void *context, FAR void *arg) { FAR struct lpc43_lowerhalf_wwdt_s *priv = &g_wdgdev; uint32_t regval; @@ -230,7 +230,7 @@ static int lpc43_interrupt(int irq, FAR void *context) * reset upon return. */ - priv->handler(irq, context); + priv->handler(irq, context, arg); } /* The watchdog interrupt flag is cleared by writing '1' to the WDINT @@ -609,10 +609,10 @@ static int lpc43_ioctl(FAR struct watchdog_lowerhalf_s *lower, int cmd, ****************************************************************************/ /**************************************************************************** - * Name: lpc43_wwdginitialize + * Name: lpc43_wwdtinitialize * * Description: - * Initialize the WWDT watchdog time. The watchdog timer is initialized and + * Initialize the WWDT watchdog timer. The watchdog timer is initialized and * registers as 'devpath. The initial state of the watchdog time is * disabled. * @@ -625,7 +625,7 @@ static int lpc43_ioctl(FAR struct watchdog_lowerhalf_s *lower, int cmd, * ****************************************************************************/ -void lpc43_wwdginitialize(FAR const char *devpath) +void lpc43_wwdtinitialize(FAR const char *devpath) { FAR struct lpc43_lowerhalf_wwdt_s *priv = &g_wdgdev; @@ -644,7 +644,7 @@ void lpc43_wwdginitialize(FAR const char *devpath) /* Attach our watchdog interrupt handler (But don't enable it yet) */ - (void)irq_attach(LPC43M4_IRQ_WWDT, lpc43_interrupt); + (void)irq_attach(LPC43M4_IRQ_WWDT, lpc43_interrupt, NULL); /* Select an arbitrary initial timeout value. But don't start the watchdog * yet. NOTE: If the "Hardware watchdog" feature is enabled through the