Commit Graph

5 Commits

Author SHA1 Message Date
Ewout van Bekkum
f7a5b51b0c pw_assert_basic: add a handler facade layer
Splits up the pw_assert_basic module to add a facade layer to
allow a user to provide a custom pw_assert_basic_HandleFailure()
implementation. The existing handler, previously named pw_Crash(),
was moved to a basic_handler facade which mirrors the
pw_cpu_exception structure and naming.

Unlike pw_cpu_exception, pw_assert_basic defaults to the
basic_handler backend.

This refactor should allow users, especially during initial
bringup, to trivially bring up assert support with target specific
handlers with less code duplication and complications.

Note that pw_assert_basic is still not recommended for production
use as it is rather heavy weight, we strongly recommend using
tokenized asserts.

Change-Id: I3a0c0aacc9a88d44b35b24ad0a13dd7e2badc209
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/28520
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2021-01-05 19:33:52 +00:00
Wyatt Hepler
f9fb90f299 docs: Make labels consistent; remove boilerplate
- Update labels so they use consistent naming. Instead of the
  copy-and-pasted `chapter` prefix, name labels with a prefix consistent
  with what they point to:
  - "module-" for module
  - "target-" for targets
  - "docs-" for general documentation
- Remove the unnecessary highlight and default-domain directives.
  Neither is necessary since the Pigweed docs always specify the
  language in code snippets and other directives.

Change-Id: I55c34e9ec919f6f4670e5d3d008e0edf5fecf05b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19328
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-10-01 21:47:35 +00:00
Armando Montanez
a761e32bf9 Update docs
First pass at docs to bring them up to date with The Great GN Refactor.
More to follow.

Change-Id: I02dc977fcdc7bf3efa8fc9080282dee9b1455cdd
2020-06-16 10:00:17 -07:00
Keir Mierle
c1cb12d67b pw_assert: Add design discussion to docs
This enhances the assert documentation with information about tradeoffs
considered while designing the module. Additionally, provides some
guidance to be more explicit that PW_CHECK(a < b) shouldn't be used, and
instead PW_CHECK_INT_LT(a, b) should be used.

Change-Id: I421700bfa85cb34c874c999245c201cb3337ebb4
2020-06-03 22:45:54 +00:00
Keir Mierle
ec9bf1bf3a pw_assert: Expand documentation coverage
Change-Id: Ic3f57f30286ca96fb6d0bc303de39c60322ea663
2020-03-03 19:38:56 +00:00