mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal] Fix and document addressable LED timings (#5272)
HAL_SetAddressableLEDBitTiming swapped high and low timings for whatever was written to it. This fixes that bug. Additionally, the API has been updated to take high time first, and then low time. This is due to this being the physical data format, so having the API match is clearer. Additionally, update the docs with the defaults.
This commit is contained in:
@@ -85,12 +85,12 @@ Java_edu_wpi_first_hal_AddressableLEDJNI_setData
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_AddressableLEDJNI_setBitTiming
|
||||
(JNIEnv* env, jclass, jint handle, jint lowTime0, jint highTime0,
|
||||
jint lowTime1, jint highTime1)
|
||||
(JNIEnv* env, jclass, jint handle, jint highTime0, jint lowTime0,
|
||||
jint highTime1, jint lowTime1)
|
||||
{
|
||||
int32_t status = 0;
|
||||
HAL_SetAddressableLEDBitTiming(static_cast<HAL_AddressableLEDHandle>(handle),
|
||||
lowTime0, highTime0, lowTime1, highTime1,
|
||||
highTime0, lowTime0, highTime1, lowTime1,
|
||||
&status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user