mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01: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:
@@ -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