mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Variable name fixes (#758)
This commit is contained in:
committed by
Peter Johnson
parent
85157a56c3
commit
96de0b5b11
@@ -53,7 +53,7 @@ void DigitalGlitchFilter::Add(DigitalSource* input) {
|
||||
DoAdd(input, m_channelIndex + 1);
|
||||
}
|
||||
|
||||
void DigitalGlitchFilter::DoAdd(DigitalSource* input, int requested_index) {
|
||||
void DigitalGlitchFilter::DoAdd(DigitalSource* input, int requestedIndex) {
|
||||
// Some sources from Counters and Encoders are null. By pushing the check
|
||||
// here, we catch the issue more generally.
|
||||
if (input) {
|
||||
@@ -64,14 +64,14 @@ void DigitalGlitchFilter::DoAdd(DigitalSource* input, int requested_index) {
|
||||
return;
|
||||
}
|
||||
int32_t status = 0;
|
||||
HAL_SetFilterSelect(input->GetPortHandleForRouting(), requested_index,
|
||||
HAL_SetFilterSelect(input->GetPortHandleForRouting(), requestedIndex,
|
||||
&status);
|
||||
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
|
||||
|
||||
// Validate that we set it correctly.
|
||||
int actual_index =
|
||||
int actualIndex =
|
||||
HAL_GetFilterSelect(input->GetPortHandleForRouting(), &status);
|
||||
wpi_assertEqual(actual_index, requested_index);
|
||||
wpi_assertEqual(actualIndex, requestedIndex);
|
||||
|
||||
HAL_Report(HALUsageReporting::kResourceType_DigitalInput,
|
||||
input->GetChannel());
|
||||
@@ -149,11 +149,11 @@ void DigitalGlitchFilter::Remove(Counter* input) {
|
||||
/**
|
||||
* Sets the number of cycles that the input must not change state for.
|
||||
*
|
||||
* @param fpga_cycles The number of FPGA cycles.
|
||||
* @param fpgaCycles The number of FPGA cycles.
|
||||
*/
|
||||
void DigitalGlitchFilter::SetPeriodCycles(int fpga_cycles) {
|
||||
void DigitalGlitchFilter::SetPeriodCycles(int fpgaCycles) {
|
||||
int32_t status = 0;
|
||||
HAL_SetFilterPeriod(m_channelIndex, fpga_cycles, &status);
|
||||
HAL_SetFilterPeriod(m_channelIndex, fpgaCycles, &status);
|
||||
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
|
||||
}
|
||||
|
||||
@@ -164,9 +164,9 @@ void DigitalGlitchFilter::SetPeriodCycles(int fpga_cycles) {
|
||||
*/
|
||||
void DigitalGlitchFilter::SetPeriodNanoSeconds(uint64_t nanoseconds) {
|
||||
int32_t status = 0;
|
||||
int fpga_cycles =
|
||||
int fpgaCycles =
|
||||
nanoseconds * HAL_GetSystemClockTicksPerMicrosecond() / 4 / 1000;
|
||||
HAL_SetFilterPeriod(m_channelIndex, fpga_cycles, &status);
|
||||
HAL_SetFilterPeriod(m_channelIndex, fpgaCycles, &status);
|
||||
|
||||
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
|
||||
}
|
||||
@@ -178,11 +178,11 @@ void DigitalGlitchFilter::SetPeriodNanoSeconds(uint64_t nanoseconds) {
|
||||
*/
|
||||
int DigitalGlitchFilter::GetPeriodCycles() {
|
||||
int32_t status = 0;
|
||||
int fpga_cycles = HAL_GetFilterPeriod(m_channelIndex, &status);
|
||||
int fpgaCycles = HAL_GetFilterPeriod(m_channelIndex, &status);
|
||||
|
||||
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
|
||||
|
||||
return fpga_cycles;
|
||||
return fpgaCycles;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -192,10 +192,10 @@ int DigitalGlitchFilter::GetPeriodCycles() {
|
||||
*/
|
||||
uint64_t DigitalGlitchFilter::GetPeriodNanoSeconds() {
|
||||
int32_t status = 0;
|
||||
int fpga_cycles = HAL_GetFilterPeriod(m_channelIndex, &status);
|
||||
int fpgaCycles = HAL_GetFilterPeriod(m_channelIndex, &status);
|
||||
|
||||
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
|
||||
|
||||
return static_cast<uint64_t>(fpga_cycles) * 1000L /
|
||||
return static_cast<uint64_t>(fpgaCycles) * 1000L /
|
||||
static_cast<uint64_t>(HAL_GetSystemClockTicksPerMicrosecond() / 4);
|
||||
}
|
||||
|
||||
@@ -74,13 +74,13 @@ void DriverStation::ReportWarning(llvm::StringRef error) {
|
||||
*
|
||||
* The error is also printed to the program console.
|
||||
*/
|
||||
void DriverStation::ReportError(bool is_error, int32_t code,
|
||||
void DriverStation::ReportError(bool isError, int32_t code,
|
||||
llvm::StringRef error, llvm::StringRef location,
|
||||
llvm::StringRef stack) {
|
||||
llvm::SmallString<128> errorTemp;
|
||||
llvm::SmallString<128> locationTemp;
|
||||
llvm::SmallString<128> stackTemp;
|
||||
HAL_SendError(is_error, code, 0, error.c_str(errorTemp),
|
||||
HAL_SendError(isError, code, 0, error.c_str(errorTemp),
|
||||
location.c_str(locationTemp), stack.c_str(stackTemp), 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,25 +173,25 @@ int SPI::Transaction(uint8_t* dataToSend, uint8_t* dataReceived, int size) {
|
||||
/**
|
||||
* Initialize the accumulator.
|
||||
*
|
||||
* @param period Time between reads
|
||||
* @param cmd SPI command to send to request data
|
||||
* @param xfer_size SPI transfer size, in bytes
|
||||
* @param valid_mask Mask to apply to received data for validity checking
|
||||
* @param valid_data After valid_mask is applied, required matching value for
|
||||
* validity checking
|
||||
* @param data_shift Bit shift to apply to received data to get actual data
|
||||
* value
|
||||
* @param data_size Size (in bits) of data field
|
||||
* @param is_signed Is data field signed?
|
||||
* @param big_endian Is device big endian?
|
||||
* @param period Time between reads
|
||||
* @param cmd SPI command to send to request data
|
||||
* @param xferSize SPI transfer size, in bytes
|
||||
* @param validMask Mask to apply to received data for validity checking
|
||||
* @param validData After valid_mask is applied, required matching value for
|
||||
* validity checking
|
||||
* @param dataShift Bit shift to apply to received data to get actual data
|
||||
* value
|
||||
* @param dataSize Size (in bits) of data field
|
||||
* @param isSigned Is data field signed?
|
||||
* @param bigEndian Is device big endian?
|
||||
*/
|
||||
void SPI::InitAccumulator(double period, int cmd, int xfer_size, int valid_mask,
|
||||
int valid_value, int data_shift, int data_size,
|
||||
bool is_signed, bool big_endian) {
|
||||
void SPI::InitAccumulator(double period, int cmd, int xferSize, int validMask,
|
||||
int validValue, int dataShift, int dataSize,
|
||||
bool isSigned, bool bigEndian) {
|
||||
int32_t status = 0;
|
||||
HAL_InitSPIAccumulator(m_port, static_cast<int32_t>(period * 1e6), cmd,
|
||||
xfer_size, valid_mask, valid_value, data_shift,
|
||||
data_size, is_signed, big_endian, &status);
|
||||
xferSize, validMask, validValue, dataShift, dataSize,
|
||||
isSigned, bigEndian, &status);
|
||||
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user