Skip to content

Commit e3bcf0c

Browse files
authored
Merge pull request #10645 from fkjagodzinski/rajkan01-new_watchdog_api
Watchdog API update
2 parents f4e6966 + 98708d1 commit e3bcf0c

File tree

24 files changed

+1026
-550
lines changed

24 files changed

+1026
-550
lines changed

TESTS/mbed_drivers/reset_reason/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "mbed.h"
2626

2727
#if DEVICE_WATCHDOG
28-
#include "drivers/Watchdog.h"
28+
#include "hal/watchdog_api.h"
2929

3030
#define MSG_VALUE_WATCHDOG_STATUS "wdg_present"
3131
#define WDG_TIMEOUT_MS 50UL
@@ -101,9 +101,9 @@ static cmd_status_t handle_command(const char *key, const char *value)
101101
if (strcmp(key, MSG_KEY_DEVICE_RESET) == 0 && strcmp(value, MSG_VALUE_DEVICE_RESET_WATCHDOG) == 0) {
102102
greentea_send_kv(MSG_KEY_DEVICE_RESET, MSG_VALUE_DEVICE_RESET_ACK);
103103
wait_ms(10); // Wait for the serial buffers to flush.
104-
Watchdog watchdog;
105-
if (watchdog.start(WDG_TIMEOUT_MS) != WATCHDOG_STATUS_OK) {
106-
TEST_ASSERT_MESSAGE(0, "watchdog.start() error.");
104+
watchdog_config_t config = { .timeout_ms = WDG_TIMEOUT_MS };
105+
if (hal_watchdog_init(&config) != WATCHDOG_STATUS_OK) {
106+
TEST_ASSERT_MESSAGE(0, "hal_watchdog_init() error.");
107107
return CMD_STATUS_ERROR;
108108
}
109109
wait_ms(WDG_TIMEOUT_MS + WDG_TIMEOUT_DELTA_MS);

TESTS/mbed_drivers/watchdog/Watchdog_tests.h

Lines changed: 0 additions & 114 deletions
This file was deleted.

TESTS/mbed_drivers/watchdog/main.cpp

Lines changed: 0 additions & 227 deletions
This file was deleted.

0 commit comments

Comments
 (0)