Skip to content

Commit

Permalink
drivers: watchdog: align to new driver API
Browse files Browse the repository at this point in the history
Align to nrfx 3.2.0 API.

Signed-off-by: Jakub Zymelka <[email protected]>
  • Loading branch information
jaz1-nordic authored and nika-nordic committed Dec 1, 2023
1 parent cb7e49b commit 7eca915
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions drivers/watchdog/wdt_nrfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,12 @@ static const struct wdt_driver_api wdt_nrfx_driver_api = {
.feed = wdt_nrf_feed,
};

static void wdt_event_handler(const struct device *dev, uint32_t requests)
static void wdt_event_handler(const struct device *dev, nrf_wdt_event_t event_type,
uint32_t requests, void *p_context)
{
(void)event_type;
(void)p_context;

struct wdt_nrfx_data *data = dev->data;

while (requests) {
Expand All @@ -162,9 +166,12 @@ static void wdt_event_handler(const struct device *dev, uint32_t requests)
#define WDT(idx) DT_NODELABEL(wdt##idx)

#define WDT_NRFX_WDT_DEVICE(idx) \
static void wdt_##idx##_event_handler(uint32_t requests) \
static void wdt_##idx##_event_handler(nrf_wdt_event_t event_type, \
uint32_t requests, \
void *p_context) \
{ \
wdt_event_handler(DEVICE_DT_GET(WDT(idx)), requests); \
wdt_event_handler(DEVICE_DT_GET(WDT(idx)), event_type, \
requests, p_context); \
} \
static int wdt_##idx##_init(const struct device *dev) \
{ \
Expand All @@ -174,7 +181,8 @@ static void wdt_event_handler(const struct device *dev, uint32_t requests)
nrfx_isr, nrfx_wdt_##idx##_irq_handler, 0); \
err_code = nrfx_wdt_init(&config->wdt, \
NULL, \
wdt_##idx##_event_handler); \
wdt_##idx##_event_handler, \
NULL); \
if (err_code != NRFX_SUCCESS) { \
return -EBUSY; \
} \
Expand Down

0 comments on commit 7eca915

Please sign in to comment.