Add multi PDP getter and sim PCM/PDP multi arg functions (#2014)

This commit is contained in:
Thad House
2019-11-01 21:55:35 -07:00
committed by Peter Johnson
parent 931b8ceefd
commit 2ad15cae19
11 changed files with 174 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -98,6 +98,25 @@ Java_edu_wpi_first_hal_PDPJNI_getPDPChannelCurrent
return current;
}
/*
* Class: edu_wpi_first_hal_PDPJNI
* Method: getPDPAllCurrents
* Signature: (I[D)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_PDPJNI_getPDPAllCurrents
(JNIEnv* env, jclass, jint handle, jdoubleArray jarr)
{
double storage[16];
int32_t status = 0;
HAL_GetPDPAllChannelCurrents(handle, storage, &status);
if (!CheckStatus(env, status, false)) {
return;
}
env->SetDoubleArrayRegion(jarr, 0, 16, storage);
}
/*
* Class: edu_wpi_first_hal_PDPJNI
* Method: getPDPTotalCurrent