[wpilib][hal] PWM Raw using microseconds (#5283)

Co-authored-by: Joe <sciencewhiz@users.noreply.github.com>
This commit is contained in:
Thad House
2023-06-22 19:43:16 -07:00
committed by GitHub
parent 1fca519fb4
commit c1a01569b4
56 changed files with 374 additions and 466 deletions

View File

@@ -64,52 +64,52 @@ Java_edu_wpi_first_hal_simulation_PWMDataJNI_setInitialized
/*
* Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: registerRawValueCallback
* Method: registerPulseMicrosecondCallback
* Signature: (ILjava/lang/Object;Z)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_PWMDataJNI_registerRawValueCallback
Java_edu_wpi_first_hal_simulation_PWMDataJNI_registerPulseMicrosecondCallback
(JNIEnv* env, jclass, jint index, jobject callback, jboolean initialNotify)
{
return sim::AllocateCallback(env, index, callback, initialNotify,
&HALSIM_RegisterPWMRawValueCallback);
&HALSIM_RegisterPWMPulseMicrosecondCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: cancelRawValueCallback
* Method: cancelPulseMicrosecondCallback
* Signature: (II)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_PWMDataJNI_cancelRawValueCallback
Java_edu_wpi_first_hal_simulation_PWMDataJNI_cancelPulseMicrosecondCallback
(JNIEnv* env, jclass, jint index, jint handle)
{
return sim::FreeCallback(env, handle, index,
&HALSIM_CancelPWMRawValueCallback);
&HALSIM_CancelPWMPulseMicrosecondCallback);
}
/*
* Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: getRawValue
* Method: getPulseMicrosecond
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
Java_edu_wpi_first_hal_simulation_PWMDataJNI_getRawValue
Java_edu_wpi_first_hal_simulation_PWMDataJNI_getPulseMicrosecond
(JNIEnv*, jclass, jint index)
{
return HALSIM_GetPWMRawValue(index);
return HALSIM_GetPWMPulseMicrosecond(index);
}
/*
* Class: edu_wpi_first_hal_simulation_PWMDataJNI
* Method: setRawValue
* Method: setPulseMicrosecond
* Signature: (II)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_simulation_PWMDataJNI_setRawValue
Java_edu_wpi_first_hal_simulation_PWMDataJNI_setPulseMicrosecond
(JNIEnv*, jclass, jint index, jint value)
{
HALSIM_SetPWMRawValue(index, value);
HALSIM_SetPWMPulseMicrosecond(index, value);
}
/*