pw_assert_zephyr#
Pigweed AI summary: This paragraph describes the implementation of the pw_assert_zephyr backend, which routes assert messages to the Zephyr assert subsystem. The failed asserts will call specific functions, and the assert module can be enabled by setting CONFIG_PIGWEED_ASSERT=y. The behavior can be controlled using Zephyr's assert configs via CONFIG_ASSERT and CONFIG_ASSERT_LEVEL.
Overview#
Pigweed AI summary: This article describes the implementation of the pw_assert facade, which routes assert messages to the Zephyr assert subsystem. The assert module can be enabled by setting CONFIG_PIGWEED_ASSERT=y, and Zephyr's assert configs can be used to control the behavior via CONFIG_ASSERT and CONFIG_ASSERT_LEVEL.
This assert backend implements the pw_assert
facade, by routing the assert
message to the Zephyr assert subsystem. Failed asserts will call:
1) __ASSERT_LOC(condition)
2) If and only if there’s a message __ASSERT_MSG_INFO(message, ...)
3) __ASSERT_POST_ACTION()
To enable the assert module, set CONFIG_PIGWEED_ASSERT=y
. After that,
Zephyr’s assert configs can be used to control the behavior via CONFIG_ASSERT
and CONFIG_ASSERT_LEVEL.