mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal] Remove HAL_GetPort (#7754)
This commit is contained in:
@@ -25,12 +25,11 @@ extern "C" {
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_AnalogJNI_initializeAnalogInputPort
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
(JNIEnv* env, jclass, jint channel)
|
||||
{
|
||||
int32_t status = 0;
|
||||
auto stack = wpi::java::GetJavaStackTrace(env, "edu.wpi.first");
|
||||
auto analog =
|
||||
HAL_InitializeAnalogInputPort((HAL_PortHandle)id, stack.c_str(), &status);
|
||||
auto analog = HAL_InitializeAnalogInputPort(channel, stack.c_str(), &status);
|
||||
CheckStatusForceThrow(env, status);
|
||||
return (jint)analog;
|
||||
}
|
||||
|
||||
@@ -26,12 +26,12 @@ extern "C" {
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_DIOJNI_initializeDIOPort
|
||||
(JNIEnv* env, jclass, jint id, jboolean input)
|
||||
(JNIEnv* env, jclass, jint channel, jboolean input)
|
||||
{
|
||||
int32_t status = 0;
|
||||
auto stack = wpi::java::GetJavaStackTrace(env, "edu.wpi.first");
|
||||
auto dio = HAL_InitializeDIOPort(
|
||||
(HAL_PortHandle)id, static_cast<uint8_t>(input), stack.c_str(), &status);
|
||||
auto dio = HAL_InitializeDIOPort(channel, static_cast<uint8_t>(input),
|
||||
stack.c_str(), &status);
|
||||
CheckStatusForceThrow(env, status);
|
||||
return (jint)dio;
|
||||
}
|
||||
|
||||
@@ -20,12 +20,11 @@ extern "C" {
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_DutyCycleJNI_initialize
|
||||
(JNIEnv* env, jclass, jint portHandle)
|
||||
(JNIEnv* env, jclass, jint channel)
|
||||
{
|
||||
int32_t status = 0;
|
||||
auto stack = wpi::java::GetJavaStackTrace(env, "edu.wpi.first");
|
||||
auto handle = HAL_InitializeDutyCycle(static_cast<HAL_Handle>(portHandle),
|
||||
stack.c_str(), &status);
|
||||
auto handle = HAL_InitializeDutyCycle(channel, stack.c_str(), &status);
|
||||
CheckStatus(env, status);
|
||||
return handle;
|
||||
}
|
||||
|
||||
@@ -199,30 +199,4 @@ Java_edu_wpi_first_hal_HAL_getSystemTimeValid
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_HAL
|
||||
* Method: getPortWithModule
|
||||
* Signature: (BB)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_HAL_getPortWithModule
|
||||
(JNIEnv* env, jclass, jbyte module, jbyte channel)
|
||||
{
|
||||
HAL_PortHandle port = HAL_GetPortWithModule(module, channel);
|
||||
return (jint)port;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_HAL
|
||||
* Method: getPort
|
||||
* Signature: (B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_HAL_getPort
|
||||
(JNIEnv* env, jclass, jbyte channel)
|
||||
{
|
||||
HAL_PortHandle port = HAL_GetPort(channel);
|
||||
return (jint)port;
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
@@ -26,11 +26,11 @@ extern "C" {
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_edu_wpi_first_hal_PWMJNI_initializePWMPort
|
||||
(JNIEnv* env, jclass, jint id)
|
||||
(JNIEnv* env, jclass, jint channel)
|
||||
{
|
||||
int32_t status = 0;
|
||||
auto stack = wpi::java::GetJavaStackTrace(env, "edu.wpi.first");
|
||||
auto pwm = HAL_InitializePWMPort((HAL_PortHandle)id, stack.c_str(), &status);
|
||||
auto pwm = HAL_InitializePWMPort(channel, stack.c_str(), &status);
|
||||
CheckStatusForceThrow(env, status);
|
||||
return (jint)pwm;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user