blob: 44ed397dbc4eee336e2adf16784edef75b002e95 [file] [log] [blame]
Keir Mierle3cee8792020-01-22 17:08:13 -08001.. _chapter-pw-assert:
2
3.. default-domain:: cpp
4
5.. highlight:: cpp
6
7---------
8pw_assert
9---------
10Pigweed's assert module provides facilities for applications to check
11preconditions. The module is split into two components:
12
131. The facade (this module) which is only a macro interface layer
142. The backend, provided elsewhere, that implements the low level checks
15
16Basic usage example
17-------------------
18
19.. code-block:: cpp
20
21 #include "pw_assert/assert.h"
22
23 int main() {
24 bool sensor_running = StartSensor(&msg);
25 PW_CHECK(sensor_running, "Sensor failed to start; code: %s", msg);
26 }
27