[hal] Report previous allocation location for indexed resource duplicates (#3322)

This commit is contained in:
Thad House
2021-05-01 10:28:30 -07:00
committed by GitHub
parent e338f9f190
commit 23d2326d1d
54 changed files with 573 additions and 251 deletions

View File

@@ -6,6 +6,8 @@
#include <cassert>
#include <wpi/jni_util.h>
#include "HALUtil.h"
#include "edu_wpi_first_hal_RelayJNI.h"
#include "hal/Ports.h"
@@ -26,10 +28,10 @@ Java_edu_wpi_first_hal_RelayJNI_initializeRelayPort
(JNIEnv* env, jclass, jint id, jboolean fwd)
{
int32_t status = 0;
auto stack = wpi::java::GetJavaStackTrace(env, "edu.wpi.first");
HAL_RelayHandle handle = HAL_InitializeRelayPort(
(HAL_PortHandle)id, static_cast<uint8_t>(fwd), &status);
CheckStatusRange(env, status, 0, HAL_GetNumRelayChannels(),
hal::getPortHandleChannel((HAL_PortHandle)id));
(HAL_PortHandle)id, static_cast<uint8_t>(fwd), stack.c_str(), &status);
CheckStatusForceThrow(env, status);
return (jint)handle;
}