From 51835f005bc760398373d4cd71535e30d6d6ed00 Mon Sep 17 00:00:00 2001 From: Filip Jagodzinski Date: Fri, 12 Apr 2019 17:28:01 +0200 Subject: [PATCH] Tests: ResetReason: Use the HAL watchdog API The Watchdog driver has been updated making this test incompatible with the new API. Use HAL API instead. --- TESTS/mbed_drivers/reset_reason/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TESTS/mbed_drivers/reset_reason/main.cpp b/TESTS/mbed_drivers/reset_reason/main.cpp index 4b1eaa8e3a..a72796f879 100644 --- a/TESTS/mbed_drivers/reset_reason/main.cpp +++ b/TESTS/mbed_drivers/reset_reason/main.cpp @@ -25,7 +25,7 @@ #include "mbed.h" #if DEVICE_WATCHDOG -#include "drivers/Watchdog.h" +#include "hal/watchdog_api.h" #define MSG_VALUE_WATCHDOG_STATUS "wdg_present" #define WDG_TIMEOUT_MS 50UL @@ -101,9 +101,9 @@ static cmd_status_t handle_command(const char *key, const char *value) if (strcmp(key, MSG_KEY_DEVICE_RESET) == 0 && strcmp(value, MSG_VALUE_DEVICE_RESET_WATCHDOG) == 0) { greentea_send_kv(MSG_KEY_DEVICE_RESET, MSG_VALUE_DEVICE_RESET_ACK); wait_ms(10); // Wait for the serial buffers to flush. - Watchdog watchdog; - if (watchdog.start(WDG_TIMEOUT_MS) != WATCHDOG_STATUS_OK) { - TEST_ASSERT_MESSAGE(0, "watchdog.start() error."); + watchdog_config_t config = { .timeout_ms = WDG_TIMEOUT_MS }; + if (hal_watchdog_init(&config) != WATCHDOG_STATUS_OK) { + TEST_ASSERT_MESSAGE(0, "hal_watchdog_init() error."); return CMD_STATUS_ERROR; } wait_ms(WDG_TIMEOUT_MS + WDG_TIMEOUT_DELTA_MS);