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

This commit is contained in:
Peter Johnson
2025-02-07 12:37:23 -08:00
committed by GitHub
parent bfff891b5c
commit 764ada9b66
188 changed files with 637 additions and 2298 deletions

View File

@@ -6,7 +6,7 @@
#include "frc/PS4Controller.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
#include <wpi/sendable/SendableBuilder.h>
#include "frc/event/BooleanEvent.h"
@@ -14,7 +14,7 @@
using namespace frc;
PS4Controller::PS4Controller(int port) : GenericHID(port) {
HAL_Report(HALUsageReporting::kResourceType_PS4Controller, port + 1);
HAL_ReportUsage("HID", port, "PS4Controller");
}
double PS4Controller::GetLeftX() const {

View File

@@ -6,7 +6,7 @@
#include "frc/PS5Controller.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
#include <wpi/sendable/SendableBuilder.h>
#include "frc/event/BooleanEvent.h"
@@ -14,7 +14,7 @@
using namespace frc;
PS5Controller::PS5Controller(int port) : GenericHID(port) {
// HAL_Report(HALUsageReporting::kResourceType_PS5Controller, port + 1);
HAL_ReportUsage("HID", port, "PS5Controller");
}
double PS5Controller::GetLeftX() const {

View File

@@ -6,7 +6,7 @@
#include "frc/StadiaController.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
#include <wpi/sendable/SendableBuilder.h>
#include "frc/event/BooleanEvent.h"
@@ -14,7 +14,7 @@
using namespace frc;
StadiaController::StadiaController(int port) : GenericHID(port) {
// HAL_Report(HALUsageReporting::kResourceType_StadiaController, port + 1);
HAL_ReportUsage("HID", port, "StadiaController");
}
double StadiaController::GetLeftX() const {

View File

@@ -6,7 +6,7 @@
#include "frc/XboxController.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
#include <wpi/sendable/SendableBuilder.h>
#include "frc/event/BooleanEvent.h"
@@ -14,7 +14,7 @@
using namespace frc;
XboxController::XboxController(int port) : GenericHID(port) {
HAL_Report(HALUsageReporting::kResourceType_XboxController, port + 1);
HAL_ReportUsage("HID", port, "XboxController");
}
double XboxController::GetLeftX() const {

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/DMC60.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ DMC60::DMC60(int channel) : PWMMotorController("DMC60", channel) {
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_DigilentDMC60, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "DigilentDMC60");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/Jaguar.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ Jaguar::Jaguar(int channel) : PWMMotorController("Jaguar", channel) {
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_Jaguar, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "Jaguar");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/Koors40.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ Koors40::Koors40(int channel) : PWMMotorController("Koors40", channel) {
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_Koors40, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "Koors40");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/PWMSparkFlex.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ PWMSparkFlex::PWMSparkFlex(int channel) : PWMMotorController("PWMSparkFlex", cha
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_RevSparkFlexPWM, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "RevSparkFlexPWM");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/PWMSparkMax.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ PWMSparkMax::PWMSparkMax(int channel) : PWMMotorController("PWMSparkMax", channe
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_RevSparkMaxPWM, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "RevSparkMaxPWM");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/PWMTalonFX.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ PWMTalonFX::PWMTalonFX(int channel) : PWMMotorController("PWMTalonFX", channel)
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_TalonFX, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "TalonFX");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/PWMTalonSRX.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ PWMTalonSRX::PWMTalonSRX(int channel) : PWMMotorController("PWMTalonSRX", channe
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_PWMTalonSRX, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "PWMTalonSRX");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/PWMVenom.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ PWMVenom::PWMVenom(int channel) : PWMMotorController("PWMVenom", channel) {
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_FusionVenom, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "FusionVenom");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/PWMVictorSPX.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ PWMVictorSPX::PWMVictorSPX(int channel) : PWMMotorController("PWMVictorSPX", cha
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_PWMVictorSPX, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "PWMVictorSPX");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/SD540.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ SD540::SD540(int channel) : PWMMotorController("SD540", channel) {
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_MindsensorsSD540, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "MindsensorsSD540");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/Spark.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ Spark::Spark(int channel) : PWMMotorController("Spark", channel) {
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_RevSPARK, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "RevSPARK");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/SparkMini.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ SparkMini::SparkMini(int channel) : PWMMotorController("SparkMini", channel) {
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_RevSPARK, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "RevSPARK");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/Talon.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ Talon::Talon(int channel) : PWMMotorController("Talon", channel) {
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_Talon, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "Talon");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/Victor.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ Victor::Victor(int channel) : PWMMotorController("Victor", channel) {
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_Victor, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "Victor");
}

View File

@@ -6,7 +6,7 @@
#include "frc/motorcontrol/VictorSP.h"
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
using namespace frc;
@@ -16,5 +16,5 @@ VictorSP::VictorSP(int channel) : PWMMotorController("VictorSP", channel) {
m_pwm.SetSpeed(0.0);
m_pwm.SetZeroLatch();
HAL_Report(HALUsageReporting::kResourceType_VictorSP, GetChannel() + 1);
HAL_ReportUsage("IO", GetChannel(), "VictorSP");
}