[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

@@ -9,7 +9,7 @@
#include <utility>
#include <vector>
#include <hal/FRCUsageReporting.h>
#include <hal/UsageReporting.h>
#include <networktables/NetworkTable.h>
#include <networktables/NetworkTableInstance.h>
#include <wpi/StringMap.h>
@@ -77,8 +77,7 @@ bool SmartDashboard::IsPersistent(std::string_view key) {
nt::NetworkTableEntry SmartDashboard::GetEntry(std::string_view key) {
if (!gReported) {
HAL_Report(HALUsageReporting::kResourceType_SmartDashboard,
HALUsageReporting::kSmartDashboard_Instance);
HAL_ReportUsage("SmartDashboard", "");
gReported = true;
}
return GetInstance().table->GetEntry(key);
@@ -89,8 +88,7 @@ void SmartDashboard::PutData(std::string_view key, wpi::Sendable* data) {
throw FRC_MakeError(err::NullParameter, "value");
}
if (!gReported) {
HAL_Report(HALUsageReporting::kResourceType_SmartDashboard,
HALUsageReporting::kSmartDashboard_Instance);
HAL_ReportUsage("SmartDashboard", "");
gReported = true;
}
auto& inst = GetInstance();