Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hal] Change usage reporting to string-based #7763

Merged
merged 27 commits into from
Feb 7, 2025

Conversation

PeterJohnson
Copy link
Member

@PeterJohnson PeterJohnson commented Feb 4, 2025

TODO:

  • Add documentation for usage conventions
  • Remove the Count entry point (std::to_string / String.valueOf is easy)
  • Change CameraServerShared to generic reporting as well
  • Update code to match documentation
  • Cleanup formatting

Fixes #301.

@PeterJohnson PeterJohnson requested review from a team as code owners February 4, 2025 06:37
Copy link
Contributor

github-actions bot commented Feb 4, 2025

This PR modifies commands. Please open a corresponding PR in Python Commands and include a link to this PR.

@github-actions github-actions bot added component: wpilibj WPILib Java component: wpilibc WPILib C++ component: hal Hardware Abstraction Layer component: command-based WPILib Command Based Library component: wpimath Math library 2027 2027 target labels Feb 4, 2025
@sciencewhiz
Copy link
Contributor

Fixes #301

Copy link
Contributor

@KangarooKoala KangarooKoala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a mix of adding one to the port and not adding one to the port? (Notably, AnalogAccerelometer and DigitalInput have different behavior depending on the language)

Files that started adding one: None
Files that still add one: hid.lang.jinja, pwm_motor_controller.lang.jinja, AnalogAccelerometer.cpp, DigitalInput.cpp
Files that never added one: ADXL345_I2C.java (didn't report port before), I2C.lang (used to report just device address, now also reports port), PowerDistribution.lang (didn't port module before), UpDownCounter.java
Files that no longer add one: AddressableLED.lang, AnalogAccelerometer.java, AnalogGyro.java, CAN.lang, Compressor.lang, DigitalInput.java, DigitalOutput.lang, DoubleSolenoid.lang, DutyCycle.lang, Encoder.lang (part of changing from using FPGA index to using a and b channels), Joystick.lang, PWM.lang, SerialPort.lang, Servo.lang, Solenoid.lang, Tachometer.lang, UpDownCounter.cpp, NidecBrushless.lang

@PeterJohnson
Copy link
Member Author

Why is there a mix of adding one to the port and not adding one to the port? (Notably, AnalogAccerelometer and DigitalInput have different behavior depending on the language)

We shouldn't be adding 1 anywhere; I'll fix the remaining instances (I realized I needed to fix that partway through doing these updates which is why some were missed). They should have always added 1 in the "old" implementation because 0 had a special meaning in the old implementation.

hal/doc/usage.adoc Show resolved Hide resolved
@PeterJohnson PeterJohnson requested a review from a team as a code owner February 6, 2025 01:40
@github-actions github-actions bot added the component: epilogue Annotation-based logging library label Feb 6, 2025
@PeterJohnson PeterJohnson merged commit 764ada9 into wpilibsuite:2027 Feb 7, 2025
41 checks passed
@PeterJohnson PeterJohnson deleted the new-usage-reporting branch February 7, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2027 2027 target component: command-based WPILib Command Based Library component: epilogue Annotation-based logging library component: hal Hardware Abstraction Layer component: wpilibc WPILib C++ component: wpilibj WPILib Java component: wpimath Math library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants