-
Notifications
You must be signed in to change notification settings - Fork 7.3k
drivers: watchdog: Watchdog API redesign [RFC] #1260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+277
−36
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.. _timer_counter_interfaces: | ||
|
||
Timer / Counter Driver APIs | ||
########################### | ||
|
||
.. contents:: | ||
:depth: 1 | ||
:local: | ||
:backlinks: top | ||
|
||
Watchdog Interface | ||
****************** | ||
|
||
.. doxygengroup:: watchdog_interface | ||
:project: Zephyr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,50 @@ | ||
# Kconfig - Watchdog configuration options | ||
# | ||
# | ||
# Copyright (c) 2015 Intel Corporation | ||
# Copyright (c) 2017 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# | ||
# Watchdog options | ||
# | ||
menuconfig WATCHDOG | ||
bool | ||
prompt "Watchdog Support" | ||
default n | ||
help | ||
Include support for watchdogs. | ||
|
||
if WATCHDOG | ||
|
||
config WDT_DISABLE_AT_BOOT | ||
bool | ||
prompt "Disable at boot" | ||
help | ||
Disable watchdog at Zephyr system startup. | ||
|
||
config SYS_LOG_WDT_LEVEL | ||
int | ||
prompt "Watchdog Driver Log level" | ||
depends on SYS_LOG | ||
default 0 | ||
range 0 4 | ||
help | ||
Sets log level for Watchdog drivers. | ||
Levels are: | ||
0 OFF, do not write | ||
1 ERROR, only write SYS_LOG_ERR | ||
2 WARNING, write SYS_LOG_WRN in addition to previous level | ||
3 INFO, write SYS_LOG_INF in addition to previous levels | ||
4 DEBUG, write SYS_LOG_DBG in addition to previous levels | ||
|
||
config HAVE_WDT_MULTISTAGE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i there any SoC which has it already? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ESP32 supports 4 watchdog stages. |
||
bool | ||
|
||
config WDT_MULTISTAGE | ||
bool | ||
prompt "Enable multistage timeouts" | ||
depends on HAVE_WDT_MULTISTAGE | ||
help | ||
Enable multistage operation of watchdog timeouts. | ||
|
||
source "drivers/watchdog/Kconfig.qmsi" | ||
|
||
source "drivers/watchdog/Kconfig.stm32" | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to add WDT_DISABLE_AT_BOOT option to Kconfig to allow disabling watchdog at boot. Useful at the initial stage of the project development as well as for many sample applications where we don't explicitly handle watchdogs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mnkp Should it depend on WATCHDOG? It would be funny if you enable WATCHDOG to disable it :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, but actually it should depend on WATCHDOG. If the watchdog subsystem is not enabled we can't disable it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mnkp You think it should be
default y
ordefault n
?By the way which one is correct: at boot or on boot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be
default n
. The board defconfig file can still choose to set it todefault y
if deemed required.Later we should only ensure that all the applications in samples/ directory that don't explicitly handle watchdog have
WDT_DISABLE_AT_BOOT
option enabled.