Squashed commit of the following:

commit a3ccfab0a42414aa169792356bfc47ee8d0d2d7b
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Tue Sep 23 13:56:59 2014 -0400

    Implement zero latch (used to reduce brownout latency) in Java

    Change-Id: I3bf4ffbf20cf3d8a42da4fa1755b4306c49ede34

commit 0af37dfcc0d1172974519c44126973c302385d55
Author: Kevin O'Connor <koconnor@usfirst.org>
Date:   Tue Sep 23 13:03:07 2014 -0400

    Implement zero latch (used to improve brownout latency) in C++

    Change-Id: I62bedd1af65d367c32e2ab0b5a4fc679776eecb5

Change-Id: Ic27f37a9ab45aad82c1f7154d4edfbccfaa19229
This commit is contained in:
Kevin O'Connor
2014-09-26 17:20:57 -04:00
parent 19b2d05236
commit d72ee199fe
13 changed files with 50 additions and 10 deletions

View File

@@ -84,6 +84,21 @@ JNIEXPORT jshort JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWM
return returnValue;
}
/*
* Class: edu_wpi_first_wpilibj_hal_PWMJNI
* Method: latchPWMZero
* Signature: (Ljava/nio/ByteBuffer;Ljava/nio/IntBuffer;)V
*/
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_latchPWMZero
(JNIEnv * env, jclass, jobject id, jobject status)
{
void ** javaId = (void**)env->GetDirectBufferAddress(id);
PWMJNI_LOG(logDEBUG) << "PWM Ptr = " << *javaId;
jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
latchPWMZero( *javaId, statusPtr );
PWMJNI_LOG(logDEBUG) << "Status = " << *statusPtr;
}
/*
* Class: edu_wpi_first_wpilibj_hal_PWMJNI
* Method: setPWMPeriodScale