mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
Updated cpplint.py and fixed its regexes for C-style casts (#193)
Additional C-style cast warnings thrown were also fixed.
This commit is contained in:
committed by
Peter Johnson
parent
e8f1fdda44
commit
3819cd0768
@@ -49,7 +49,7 @@ void ADXL345_SPI::SetRange(Range range) {
|
||||
|
||||
// Specify the data format to read
|
||||
commands[0] = kDataFormatRegister;
|
||||
commands[1] = kDataFormat_FullRes | (uint8_t)(range & 0x03);
|
||||
commands[1] = kDataFormat_FullRes | static_cast<uint8_t>(range & 0x03);
|
||||
m_spi.Transaction(commands, commands, 2);
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ double ADXL345_SPI::GetZ() { return GetAcceleration(kAxis_Z); }
|
||||
double ADXL345_SPI::GetAcceleration(ADXL345_SPI::Axes axis) {
|
||||
uint8_t buffer[3];
|
||||
uint8_t command[3] = {0, 0, 0};
|
||||
command[0] =
|
||||
(kAddress_Read | kAddress_MultiByte | kDataRegister) + (uint8_t)axis;
|
||||
command[0] = (kAddress_Read | kAddress_MultiByte | kDataRegister) +
|
||||
static_cast<uint8_t>(axis);
|
||||
m_spi.Transaction(command, buffer, 3);
|
||||
|
||||
// Sensor is little endian... swap bytes
|
||||
|
||||
Reference in New Issue
Block a user