mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal] Report previous allocation location for indexed resource duplicates (#3322)
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_hal_PWMJNI.h"
|
||||
#include "hal/DIO.h"
|
||||
@@ -27,9 +29,9 @@ Java_edu_wpi_first_hal_PWMJNI_initializePWMPort
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
{
|
||||
int32_t status = 0;
|
||||
auto pwm = HAL_InitializePWMPort((HAL_PortHandle)id, &status);
|
||||
CheckStatusRange(env, status, 0, HAL_GetNumPWMChannels(),
|
||||
hal::getPortHandleChannel((HAL_PortHandle)id));
|
||||
auto stack = wpi::java::GetJavaStackTrace(env, "edu.wpi.first");
|
||||
auto pwm = HAL_InitializePWMPort((HAL_PortHandle)id, stack.c_str(), &status);
|
||||
CheckStatusForceThrow(env, status);
|
||||
return (jint)pwm;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user