Skip to content

Commit 0a5c542

Browse files
app: main: add main function
Add a main thread with zbus subscriber instead of callback. Signed-off-by: Giacomo Dematteis <giacomo.dematteis@nordicsemi.no>
1 parent 2d87ac2 commit 0a5c542

File tree

4 files changed

+153
-76
lines changed

4 files changed

+153
-76
lines changed

app/src/Kconfig.main

+20
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,26 @@ config APP_REQUEST_NETWORK_QUALITY
2525
help
2626
Request network quality on triggers.
2727

28+
config APP_WATCHDOG_TIMEOUT_SECONDS
29+
int "Watchdog timeout"
30+
default 180
31+
help
32+
Timeout in seconds for the main module watchdog.
33+
The timeout given in this option covers both:
34+
* Waiting for an incoming message in zbus_sub_wait_msg().
35+
* Time spent processing the message, defined by
36+
CONFIG_APP_MSG_PROCESSING_TIMEOUT_SECONDS.
37+
Ensure that this value exceeds CONFIG_APP_MSG_PROCESSING_TIMEOUT_SECONDS.
38+
A small difference between the two can mean more frequent watchdog feeds, which increases
39+
power consumption.
40+
41+
config APP_MSG_PROCESSING_TIMEOUT_SECONDS
42+
int "Maximum message processing time"
43+
default 120
44+
help
45+
Maximum time allowed for processing a single message in the module's state machine.
46+
The value must be smaller than CONFIG_APP_WATCHDOG_TIMEOUT_SECONDS.
47+
2848
module = APP
2949
module-str = APP
3050
source "subsys/logging/Kconfig.template.log_config"

0 commit comments

Comments
 (0)