Skip to content

Commit a810ef8

Browse files
Filip Jagodzinski0xc0170
authored andcommitted
Watchdog: Fix timeout constraints
Update the start method to check 0 < timeout <= max_timeout.
1 parent a5ad5e0 commit a810ef8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/Watchdog.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ Watchdog::~Watchdog()
3030

3131
bool Watchdog::start(uint32_t timeout)
3232
{
33-
MBED_ASSERT(timeout < get_max_timeout());
33+
MBED_ASSERT(timeout <= get_max_timeout());
34+
MBED_ASSERT(timeout > 0);
3435

3536
core_util_critical_section_enter();
3637
if (_running) {

0 commit comments

Comments
 (0)