Fix usages of std::min and std::max to be windows safe (#4887)

This commit is contained in:
Thad House
2022-12-31 12:00:45 -08:00
committed by GitHub
parent c11bd2720f
commit b632b288a3
6 changed files with 9 additions and 9 deletions

View File

@@ -196,7 +196,7 @@ bool ADIS16448_IMU::SwitchToStandardSPI() {
while (data_count > 0) {
/* Dequeue 200 at a time, or the remainder of the buffer if less than
* 200 */
m_spi->ReadAutoReceivedData(trashBuffer, std::min(200, data_count),
m_spi->ReadAutoReceivedData(trashBuffer, (std::min)(200, data_count),
0_s);
/* Update remaining buffer count */
data_count = m_spi->ReadAutoReceivedData(trashBuffer, 0, 0_s);
@@ -331,7 +331,7 @@ int ADIS16448_IMU::ConfigCalTime(CalibrationTime new_cal_time) {
void ADIS16448_IMU::Calibrate() {
std::scoped_lock sync(m_mutex);
// Calculate the running average
int gyroAverageSize = std::min(m_accum_count, m_avg_size);
int gyroAverageSize = (std::min)(m_accum_count, m_avg_size);
double accum_gyro_rate_x = 0.0;
double accum_gyro_rate_y = 0.0;
double accum_gyro_rate_z = 0.0;