Commit Graph

15 Commits

Author SHA1 Message Date
Wyatt Hepler
d49f8fe3f3 BUILD.gn files: Improve import formatting
The "# gn-format disable" comments are no longer necessary. Delete these
comments and reformat with a Vim macro and gn format.

Change-Id: Ia62c40ad73eef91187d0d443d6e3b0fa723e5aa9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21380
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-15 18:12:55 +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
Wyatt Hepler
d78f7c6b75 pw_status: Update Status::CODE to Status::Code()
- Update Status::CODE style to Status::Code() using
  pw_status/update_style.py.
- Make minor adjustments to the pw_assert tests to get them passing.

Change-Id: Ie54c3c605178fd1e42c7cedbcff324115f3ed279
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19165
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2020-09-30 18:09:44 +00:00
Wyatt Hepler
3cd2cd4596 pw_bytes: Endian reading function
- bytes::ReadInOrder reads from a buffer with the specified endianness.
- Support "" with bytes::String.

Change-Id: I23820cac582cb07cdf7318e9ce4291c42d809681
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/18141
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
2020-09-17 19:33:36 +00:00
Wyatt Hepler
bfb669df8c pw_hdlc_lite: Encode full HDLC frames
- Encode standard HDLC I-frames by adding an address and control byte
  (sequence numbers are not used currently).
- Switch to CRC-32 from CRC-16-CCITT.

Change-Id: I97248f69144f599b821f94cbca9341b80c02f33f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17660
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2020-09-10 15:54:01 +00:00
Wyatt Hepler
05ca54ccbc pw_bytes: Functions for converting endianness
- Create pw_bytes/endian.h, which provides functions for converting
  integer byte order.
- Update pw_bytes docs.

Change-Id: Icacc91d8c5d4f185c562f3b20b7249572ad84f5d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17464
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-09-09 20:37:54 +00:00
Wyatt Hepler
ecf19233d3 pw_polyfill: Support std::endian from <bit>
- Implement std::endian from <bit> (__cpp_lib_endian).
- Replace pw::ByteOrder with std::endian.
- Update the <span> header to use the same approach as <bit> and define
  the appropriate std::span feature macro.

Change-Id: I5575bde6efbabf71bac66d7f4dc2c2c136ae156f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17463
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-09-09 18:23:05 +00:00
Alexei Frolov
e467579086 misc: Size report binary fixes
This fixes compiler errors that occur within various size reports.

Change-Id: Icdfd439ace38e5183c46a92fc73c39b24ea8638e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/17628
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
2020-09-08 23:12:30 +00:00
shaneajg
f20ef8ef4a pw_bytes: Added code for Size Report
Change-Id: I224e96c88288c890686cb91eac354cf30dbcad4f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/13182
Commit-Queue: Shane Gomindes <shaneajg@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-08-27 20:02:08 +00:00
Wyatt Hepler
6b3a6c9972 pw_bytes: Utilities for building byte arrays
- Rework pw_kvs_private/byte_utils.h into pw_bytes/array.h.
- Remove pw_kvs_private/byte_utils.h and update the KVS code to use the
  new functions.

Change-Id: I55bb861955d67945771391e1887bf3aae37d0f9c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/15663
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: David Rogers <davidrogers@google.com>
2020-08-11 20:24:33 +00:00
shaneajg
5c15f0db3c pw_bytes: Added iterator value-retrieval methods
Added 'peek' and 'read' functionality that enables ordered retreival
(Little/Big Endian) of the inserted integer values, and adjusts the
position of the iterator accordingly.

Change-Id: I418f7bd3ed5a1b627a80a0eaa190c2d26fed032c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12960
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Shane Gomindes <shaneajg@google.com>
2020-06-29 16:24:03 +00:00
Wyatt Hepler
0158ad731e pw_bytes: ByteSpan and ConstByteSpan aliases
- Introduce ByteSpan and ConstByteSpan aliases for std::span<std::byte>
  and std::span<const std::byte>.
- Use the new aliases in pw_bytes/byte_builder.h.

Change-Id: Ifaf5e19c9b34cf7874b366300aa1e582ae1e5587
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12944
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-06-26 22:08:39 +00:00
shaneajg
9fe4cec6f2 pw_bytes: Added an iterator class
Added an iterator class to the ByteBuilder class with functionality
based on C++'s Random access iterator that allows access to the
elements in the buffer.

Change-Id: I3d4c1de916137bb515635fab575b29efc4a8855f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12802
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Shane Gomindes <shaneajg@google.com>
2020-06-24 21:05:45 +00:00
shaneajg
3181d18e36 pw_bytes: Added an ordered put method for values
Added functionality to insert values to the buffer in the endianness
order as specified by the user.

Change-Id: Ie33ac7a38a35cdd1cfdb2952233d13f09242cc8c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12472
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Shane Gomindes <shaneajg@google.com>
2020-06-19 21:01:52 +00:00
shaneajg
9c19db4e78 pw_bytes: Module for bytes manipulation.
Added a ByteBuffer module which contains a collection of utilities for
manipulating binary data.

Change-Id: Ia071c3e68a1ada63232fcb56f3d2d8171bac0778
2020-06-16 22:29:31 +00:00