xref: /aosp_15_r20/external/pigweed/pw_assert_zephyr/docs.rst (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1*61c4878aSAndroid Build Coastguard Worker.. _module-pw_assert_zephyr:
2*61c4878aSAndroid Build Coastguard Worker
3*61c4878aSAndroid Build Coastguard Worker================
4*61c4878aSAndroid Build Coastguard Workerpw_assert_zephyr
5*61c4878aSAndroid Build Coastguard Worker================
6*61c4878aSAndroid Build Coastguard Worker
7*61c4878aSAndroid Build Coastguard Worker--------
8*61c4878aSAndroid Build Coastguard WorkerOverview
9*61c4878aSAndroid Build Coastguard Worker--------
10*61c4878aSAndroid Build Coastguard WorkerThis assert backend implements the ``pw_assert`` facade, by routing the assert
11*61c4878aSAndroid Build Coastguard Workermessage to the Zephyr assert subsystem. Failed asserts will call:
12*61c4878aSAndroid Build Coastguard Worker1) ``__ASSERT_LOC(condition)``
13*61c4878aSAndroid Build Coastguard Worker2) If and only if there's a message ``__ASSERT_MSG_INFO(message, ...)``
14*61c4878aSAndroid Build Coastguard Worker3) ``__ASSERT_POST_ACTION()``
15*61c4878aSAndroid Build Coastguard Worker
16*61c4878aSAndroid Build Coastguard WorkerTo enable the assert module, set ``CONFIG_PIGWEED_ASSERT=y``. After that,
17*61c4878aSAndroid Build Coastguard WorkerZephyr's assert configs can be used to control the behavior via CONFIG_ASSERT_
18*61c4878aSAndroid Build Coastguard Workerand CONFIG_ASSERT_LEVEL_.
19*61c4878aSAndroid Build Coastguard Worker
20*61c4878aSAndroid Build Coastguard Worker.. _CONFIG_ASSERT: https://docs.zephyrproject.org/latest/kconfig.html#CONFIG_ASSERT
21*61c4878aSAndroid Build Coastguard Worker.. _CONFIG_ASSERT_LEVEL: https://docs.zephyrproject.org/latest/kconfig.html#CONFIG_ASSERT_LEVEL
22