Commit Graph

26 Commits

Author SHA1 Message Date
Peter Johnson
14d14e4ebc [hal] Prefix all error #defines with HAL_ (#8780) 2026-04-19 16:12:18 -07:00
Peter Johnson
a7f71c9434 [hal] Consistently use .hpp for C++ header content
Some headers were renamed, but others were split.
2026-03-04 22:09:40 -07:00
PJ Reiniger
9aca8e0fd6 SCRIPT namespace replacements 2025-11-07 23:09:21 -08:00
PJ Reiniger
1e7604f81c SCRIPT: wpiformat 2025-11-07 23:09:21 -08:00
PJ Reiniger
7c6efa41ae SCRIPT Run cc include replacements 2025-11-07 23:09:21 -08:00
PJ Reiniger
f0a3c64121 SCRIPT Run java package replacements 2025-11-07 23:09:21 -08:00
Thad House
8d248f61fd [hal] Various CAN fixes (#8043) 2025-07-14 23:46:57 -07:00
Thad House
baa20fa239 [hal, wpilib] Rewrite CAN APIs (#7798) 2025-02-25 19:07:01 -08:00
Tyler Veness
554024767e Fix errors from new cpplint.py (#7105) 2024-09-20 17:43:39 -07:00
Thad House
636ef58d94 [hal] Properly error check readCANStreamSession (#6108) 2023-12-29 23:57:00 -06:00
Thad House
24a76be694 [hal] Add method to detect if the CAN Stream has overflowed (#6105) 2023-12-29 09:10:48 -08:00
Thad House
9333951736 [hal] Allocate CANStreamMessage in JNI if null (#6107) 2023-12-29 00:50:57 -06:00
Joseph Eng
2e4ad35e36 [wpiutil] jni_util: Add JSpan and CriticalJSpan (#5554)
These replace JArrayRef et al and support statically sized arrays similar to std::span.
2023-08-24 00:02:56 -07:00
William Toth
b300518bd1 [hal] Add CAN Stream API to Java through JNI bindings (#4193)
The CAN Stream API allows defining an buffer to receive an
arbitrary set of CAN messages, based on an ID and a mask. Messages
are added to this queue separate of other CAN APIs. This means the
messages can be receive without impacting other APIs such as
vendor APIs.

This enables things like detection of what devices are on the
bus, or custom decoding, without using vendor APIs.

Co-authored-by: Thad House <thadhouse1@gmail.com>
2022-12-06 21:58:09 -08:00
Peter Johnson
ceaf493811 [wpiutil] MakeJByteArray: Use span<uint8> instead of string_view (#4446) 2022-10-02 08:28:50 -05:00
Tyler Veness
95dd20a151 [build] Enable spotbugs (#3601)
Benign spotbugs warnings were suppressed, and all others were fixed. Bug
descriptions are documented here:
https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html

Co-authored-by: Austin Shalit <austinshalit@gmail.com>
2021-09-24 16:04:02 -07:00
Peter Johnson
b2c3b2dd8e Use std::string_view and fmtlib across all libraries (#3402)
- Twine, StringRef, Format, and NativeFormatting have been removed
- Logging now uses fmtlib style formatting
- Nearly all uses of wpi::outs/errs have been replaced with fmt::print() or
std::puts()/std::fputs() (for unformatted strings).
- A wpi/fmt/raw_ostream.h header has been added to enable
fmt::print() with wpi::raw_ostream
2021-06-06 16:13:58 -07:00
Peter Johnson
2aed432b4b Add braces to C++ single-line loops and conditionals (NFC) (#2973)
This makes code easier to read and more consistent between C++ and Java.
Also update clang-format settings to always add a line break (even if no braces are used).
2020-12-28 12:58:06 -08:00
Peter Johnson
8f1f64ffb6 Remove year from file copyright message (NFC) (#2972)
Also update copyright to include "and other WPILib contributors" and clarify
license referral language to not be restricted to FIRST teams.
2020-12-26 14:12:05 -08:00
Peter Johnson
8a80f97c06 [hal] Move JNI helpers and sim namespace to hal namespace (#2543) 2020-06-26 17:12:55 -07:00
Thad House
dd928b4cbf Remove JNI logging (#1872) 2019-09-06 20:42:40 -05:00
Thad House
e210073044 Move HAL classes to their own base package (#1317)
Needed for modularization.
2018-09-20 21:59:46 -07:00
Tyler Veness
d89b7dd412 Move CameraServer and WPILib headers into their own folder
The old headers were moved into folders because doing so avoids polluting
the system include directories.

Folder names were also normalized to lowercase.
2018-07-22 19:40:57 -07:00
Tyler Veness
6729a7d6b1 Run wpiformat on merged repo (#1021) 2018-05-13 17:09:56 -07:00
Peter Johnson
f84018af5f Move entirety of llvm namespace to wpi namespace.
During shared library loading, a different libLLVM can be pulled in, causing
llvm symbols from dependent libraries to resolve to that library instead of
this one. This has been seen in the wild with the Mesa OpenGL implementation
in JavaFX applications (see wpilibsuite/shuffleboard#361).

This is clearly a very breaking change. For some level of backwards
compatibility, a namespace alias from llvm to wpi is performed in the "llvm"
headers.  Unfortunately, forward declarations of llvm classes will still break,
but compilers seem to generate clear error messages in those cases
("namespace alias 'llvm' not allowed here, assuming 'wpi'").

This change also moves all the wpiutil headers to a single "wpi" subdirectory
from the previously split "llvm", "support", "tcpsockets", and "udpsockets".
Shim headers will be added for backwards compatibility in a later commit.
2018-04-30 10:22:54 -07:00
Thad House
7f88cf768d New 2018 and later build setup (#1001) 2018-04-29 13:29:07 -07:00