mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal] Report previous allocation location for indexed resource duplicates (#3322)
This commit is contained in:
@@ -4,12 +4,14 @@
|
||||
|
||||
#include "frc/DigitalInput.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
|
||||
#include <hal/DIO.h>
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
#include <hal/HALBase.h>
|
||||
#include <hal/Ports.h>
|
||||
#include <wpi/StackTrace.h>
|
||||
|
||||
#include "frc/Errors.h"
|
||||
#include "frc/SensorUtil.h"
|
||||
@@ -26,7 +28,9 @@ DigitalInput::DigitalInput(int channel) {
|
||||
m_channel = channel;
|
||||
|
||||
int32_t status = 0;
|
||||
m_handle = HAL_InitializeDIOPort(HAL_GetPort(channel), true, &status);
|
||||
std::string stackTrace = wpi::GetStackTrace(1);
|
||||
m_handle = HAL_InitializeDIOPort(HAL_GetPort(channel), true,
|
||||
stackTrace.c_str(), &status);
|
||||
FRC_CheckErrorStatus(status, "Digital Channel " + wpi::Twine{channel});
|
||||
|
||||
HAL_Report(HALUsageReporting::kResourceType_DigitalInput, channel + 1);
|
||||
|
||||
Reference in New Issue
Block a user