Skip to content

Commit a628339

Browse files
committed
fix: Fixing rebased created bugs
1 parent 7de2af7 commit a628339

File tree

5 files changed

+7
-241
lines changed

5 files changed

+7
-241
lines changed

drivers/Watchdog.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,6 @@ class Watchdog {
7575
*/
7676
void kick();
7777

78-
/** Stops the watchdog timer
79-
*
80-
* Calling this function will attempt to disable any currently running
81-
* watchdog timers if supported by the current platform.
82-
*
83-
* @return Returns WATCHDOG_STATUS_OK if the watchdog timer was successfully
84-
* stopped, or if the timer was never started. Returns
85-
* WATCHDOG_STATUS_NOT_SUPPORTED if the watchdog cannot be disabled
86-
* on the current platform.
87-
*/
88-
watchdog_status_t stop();
89-
9078
/** mbed_watchdog_manager(runs by periodic call from ticker) used this API interface
9179
* to go through all the registered user/threads of watchdog.
9280
*

platform/mbed_watchdog_mgr.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ uint32_t mbed_wdog_manager_get_max_timeout()
6363
bool mbed_wdog_manager_start()
6464
{
6565
watchdog_status_t sts;
66-
bool msts = true;
6766
MBED_ASSERT(HW_WATCHDOG_TIMEOUT < mbed_wdog_manager_get_max_timeout());
6867
core_util_critical_section_enter();
6968
if (is_watchdog_started) {
@@ -73,15 +72,15 @@ bool mbed_wdog_manager_start()
7372
watchdog_config_t config;
7473
config.timeout_ms = HW_WATCHDOG_TIMEOUT;
7574
sts = hal_watchdog_init(&config);
76-
if (sts != WATCHDOG_STATUS_OK) {
77-
msts = false;
78-
} else {
79-
us_timestamp_t timeout = (MS_TO_US(((elapsed_ms <= 0) ? 1 : elapsed_ms)));
80-
get_ticker()->attach_us(callback(&mbed_wdog_manager_kick), timeout);
75+
if (sts == WATCHDOG_STATUS_OK) {
8176
is_watchdog_started = true;
8277
}
8378
core_util_critical_section_exit();
84-
return msts;
79+
if (is_watchdog_started){
80+
us_timestamp_t timeout = (MS_TO_US(((elapsed_ms <= 0) ? 1 : elapsed_ms)));
81+
get_ticker()->attach_us(callback(&mbed_wdog_manager_kick), timeout);
82+
}
83+
return is_watchdog_started;
8584
}
8685

8786
bool mbed_wdog_manager_stop()

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/watchdog.c

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

targets/TARGET_STM/TARGET_STM32F4/watchdog.c

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

targets/targets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"default-form-factor": {
3939
"help": "Default form factor of this board taken from supported_form_factors. This must be a lowercase string such as 'arduino'",
4040
"value": null
41+
},
4142
"hw-watchdog_timeout": {
4243
"help": "Define the timeout in ms value LowPowerTicker to do HW kick",
4344
"value": "800",

0 commit comments

Comments
 (0)