mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
[wpimath] Remove unit suffixes from variable names (#7529)
* Move units into API docs instead because suffixes make user code verbose and hard to read * Rename trackWidth to trackwidth * Make ultrasonic classes use meters instead of a mix of m, cm, mm, ft, and inches
This commit is contained in:
@@ -57,18 +57,14 @@ public class AddressableLEDJNI extends JNIWrapper {
|
||||
* those.
|
||||
*
|
||||
* @param handle the Addressable LED handle
|
||||
* @param highTime0NanoSeconds high time for 0 bit (default 400ns)
|
||||
* @param lowTime0NanoSeconds low time for 0 bit (default 900ns)
|
||||
* @param highTime1NanoSeconds high time for 1 bit (default 900ns)
|
||||
* @param lowTime1NanoSeconds low time for 1 bit (default 600ns)
|
||||
* @param highTime0 high time for 0 bit in nanoseconds (default 400 ns)
|
||||
* @param lowTime0 low time for 0 bit in nanoseconds (default 900 ns)
|
||||
* @param highTime1 high time for 1 bit in nanoseconds (default 900 ns)
|
||||
* @param lowTime1 low time for 1 bit in nanoseconds (default 600 ns)
|
||||
* @see "HAL_SetAddressableLEDBitTiming"
|
||||
*/
|
||||
public static native void setBitTiming(
|
||||
int handle,
|
||||
int highTime0NanoSeconds,
|
||||
int lowTime0NanoSeconds,
|
||||
int highTime1NanoSeconds,
|
||||
int lowTime1NanoSeconds);
|
||||
int handle, int highTime0, int lowTime0, int highTime1, int lowTime1);
|
||||
|
||||
/**
|
||||
* Sets the sync time.
|
||||
@@ -76,10 +72,10 @@ public class AddressableLEDJNI extends JNIWrapper {
|
||||
* <p>The sync time is the time to hold output so LEDs enable. Default set for WS2812B and WS2815.
|
||||
*
|
||||
* @param handle the Addressable LED handle
|
||||
* @param syncTimeMicroSeconds the sync time (default 280us)
|
||||
* @param syncTime the sync time in microseconds (default 280 μs)
|
||||
* @see "HAL_SetAddressableLEDSyncTime"
|
||||
*/
|
||||
public static native void setSyncTime(int handle, int syncTimeMicroSeconds);
|
||||
public static native void setSyncTime(int handle, int syncTime);
|
||||
|
||||
/**
|
||||
* Starts the output.
|
||||
|
||||
@@ -89,10 +89,10 @@ public class DIOJNI extends JNIWrapper {
|
||||
* going at any time.
|
||||
*
|
||||
* @param dioPortHandle the digital port handle
|
||||
* @param pulseLengthSeconds the active length of the pulse (in seconds)
|
||||
* @param pulseLength the active length of the pulse in seconds
|
||||
* @see "HAL_Pulse"
|
||||
*/
|
||||
public static native void pulse(int dioPortHandle, double pulseLengthSeconds);
|
||||
public static native void pulse(int dioPortHandle, double pulseLength);
|
||||
|
||||
/**
|
||||
* Generates a single digital pulse on multiple channels.
|
||||
@@ -101,10 +101,10 @@ public class DIOJNI extends JNIWrapper {
|
||||
* any time.
|
||||
*
|
||||
* @param channelMask the channel mask
|
||||
* @param pulseLengthSeconds the active length of the pulse (in seconds)
|
||||
* @param pulseLength the active length of the pulse in seconds
|
||||
* @see "HAL_PulseMultiple"
|
||||
*/
|
||||
public static native void pulseMultiple(long channelMask, double pulseLengthSeconds);
|
||||
public static native void pulseMultiple(long channelMask, double pulseLength);
|
||||
|
||||
/**
|
||||
* Checks a DIO line to see if it is currently generating a pulse.
|
||||
|
||||
@@ -81,17 +81,15 @@ void HAL_WriteAddressableLEDData(HAL_AddressableLEDHandle handle,
|
||||
* needs to be set for those.
|
||||
*
|
||||
* @param[in] handle the Addressable LED handle
|
||||
* @param[in] highTime0NanoSeconds high time for 0 bit (default 400ns)
|
||||
* @param[in] lowTime0NanoSeconds low time for 0 bit (default 900ns)
|
||||
* @param[in] highTime1NanoSeconds high time for 1 bit (default 900ns)
|
||||
* @param[in] lowTime1NanoSeconds low time for 1 bit (default 600ns)
|
||||
* @param[in] highTime0 high time for 0 bit in nanoseconds (default 400 ns)
|
||||
* @param[in] lowTime0 low time for 0 bit in nanoseconds (default 900 ns)
|
||||
* @param[in] highTime1 high time for 1 bit in nanoseconds (default 900 ns)
|
||||
* @param[in] lowTime1 low time for 1 bit in nanoseconds (default 600 ns)
|
||||
* @param[out] status the error code, or 0 for success
|
||||
*/
|
||||
void HAL_SetAddressableLEDBitTiming(HAL_AddressableLEDHandle handle,
|
||||
int32_t highTime0NanoSeconds,
|
||||
int32_t lowTime0NanoSeconds,
|
||||
int32_t highTime1NanoSeconds,
|
||||
int32_t lowTime1NanoSeconds,
|
||||
int32_t highTime0, int32_t lowTime0,
|
||||
int32_t highTime1, int32_t lowTime1,
|
||||
int32_t* status);
|
||||
|
||||
/**
|
||||
@@ -101,12 +99,11 @@ void HAL_SetAddressableLEDBitTiming(HAL_AddressableLEDHandle handle,
|
||||
* WS2812B and WS2815.
|
||||
*
|
||||
* @param[in] handle the Addressable LED handle
|
||||
* @param[in] syncTimeMicroSeconds the sync time (default 280us)
|
||||
* @param[in] syncTime the sync time in microseconds (default 280 μs)
|
||||
* @param[out] status the error code, or 0 for success
|
||||
*/
|
||||
void HAL_SetAddressableLEDSyncTime(HAL_AddressableLEDHandle handle,
|
||||
int32_t syncTimeMicroSeconds,
|
||||
int32_t* status);
|
||||
int32_t syncTime, int32_t* status);
|
||||
|
||||
/**
|
||||
* Starts the output.
|
||||
|
||||
@@ -158,10 +158,10 @@ HAL_Bool HAL_GetDIODirection(HAL_DigitalHandle dioPortHandle, int32_t* status);
|
||||
* single pulse going at any time.
|
||||
*
|
||||
* @param[in] dioPortHandle the digital port handle
|
||||
* @param[in] pulseLengthSeconds the active length of the pulse (in seconds)
|
||||
* @param[in] pulseLength the active length of the pulse in seconds
|
||||
* @param[out] status Error status variable. 0 on success.
|
||||
*/
|
||||
void HAL_Pulse(HAL_DigitalHandle dioPortHandle, double pulseLengthSeconds,
|
||||
void HAL_Pulse(HAL_DigitalHandle dioPortHandle, double pulseLength,
|
||||
int32_t* status);
|
||||
|
||||
/**
|
||||
@@ -171,10 +171,10 @@ void HAL_Pulse(HAL_DigitalHandle dioPortHandle, double pulseLengthSeconds,
|
||||
* single pulse going at any time.
|
||||
*
|
||||
* @param[in] channelMask the channel mask
|
||||
* @param[in] pulseLengthSeconds the active length of the pulse (in seconds)
|
||||
* @param[out] status Error status variable. 0 on success.
|
||||
* @param[in] pulseLength the active length of the pulse in seconds
|
||||
* @param[out] status Error status variable. 0 on success.
|
||||
*/
|
||||
void HAL_PulseMultiple(uint32_t channelMask, double pulseLengthSeconds,
|
||||
void HAL_PulseMultiple(uint32_t channelMask, double pulseLength,
|
||||
int32_t* status);
|
||||
|
||||
/**
|
||||
|
||||
@@ -146,15 +146,12 @@ void HAL_WriteAddressableLEDData(HAL_AddressableLEDHandle handle,
|
||||
}
|
||||
|
||||
void HAL_SetAddressableLEDBitTiming(HAL_AddressableLEDHandle handle,
|
||||
int32_t highTime0NanoSeconds,
|
||||
int32_t lowTime0NanoSeconds,
|
||||
int32_t highTime1NanoSeconds,
|
||||
int32_t lowTime1NanoSeconds,
|
||||
int32_t highTime0, int32_t lowTime0,
|
||||
int32_t highTime1, int32_t lowTime1,
|
||||
int32_t* status) {}
|
||||
|
||||
void HAL_SetAddressableLEDSyncTime(HAL_AddressableLEDHandle handle,
|
||||
int32_t syncTimeMicroSeconds,
|
||||
int32_t* status) {}
|
||||
int32_t syncTime, int32_t* status) {}
|
||||
|
||||
void HAL_StartAddressableLEDOutput(HAL_AddressableLEDHandle handle,
|
||||
int32_t* status) {
|
||||
|
||||
@@ -107,9 +107,8 @@ int32_t HAL_GetDutyCycleHighTime(HAL_DutyCycleHandle dutyCycleHandle,
|
||||
return 0;
|
||||
}
|
||||
|
||||
double periodSeconds = 1.0 / SimDutyCycleData[dutyCycle->index].frequency;
|
||||
double periodNanoSeconds = periodSeconds * 1e9;
|
||||
return periodNanoSeconds * SimDutyCycleData[dutyCycle->index].output;
|
||||
double period = 1e9 / SimDutyCycleData[dutyCycle->index].frequency; // ns
|
||||
return period * SimDutyCycleData[dutyCycle->index].output;
|
||||
}
|
||||
|
||||
int32_t HAL_GetDutyCycleOutputScaleFactor(HAL_DutyCycleHandle dutyCycleHandle,
|
||||
|
||||
@@ -54,18 +54,15 @@ void HAL_WriteAddressableLEDData(HAL_AddressableLEDHandle handle,
|
||||
}
|
||||
|
||||
void HAL_SetAddressableLEDBitTiming(HAL_AddressableLEDHandle handle,
|
||||
int32_t highTime0NanoSeconds,
|
||||
int32_t lowTime0NanoSeconds,
|
||||
int32_t highTime1NanoSeconds,
|
||||
int32_t lowTime1NanoSeconds,
|
||||
int32_t highTime0, int32_t lowTime0,
|
||||
int32_t highTime1, int32_t lowTime1,
|
||||
int32_t* status) {
|
||||
*status = HAL_HANDLE_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
void HAL_SetAddressableLEDSyncTime(HAL_AddressableLEDHandle handle,
|
||||
int32_t syncTimeMicroSeconds,
|
||||
int32_t* status) {
|
||||
int32_t syncTime, int32_t* status) {
|
||||
*status = HAL_HANDLE_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -177,13 +177,13 @@ HAL_Bool HAL_GetDIODirection(HAL_DigitalHandle dioPortHandle, int32_t* status) {
|
||||
}
|
||||
}
|
||||
|
||||
void HAL_Pulse(HAL_DigitalHandle dioPortHandle, double pulseLengthSeconds,
|
||||
void HAL_Pulse(HAL_DigitalHandle dioPortHandle, double pulseLength,
|
||||
int32_t* status) {
|
||||
*status = HAL_HANDLE_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
void HAL_PulseMultiple(uint32_t channelMask, double pulseLengthSeconds,
|
||||
void HAL_PulseMultiple(uint32_t channelMask, double pulseLength,
|
||||
int32_t* status) {
|
||||
*status = HAL_HANDLE_ERROR;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user