mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[hal] Replace hardcoded sim array sizes with constants (#4015)
This commit is contained in:
@@ -9,7 +9,7 @@ using namespace hal;
|
||||
|
||||
namespace hal::init {
|
||||
void InitializeAccelerometerData() {
|
||||
static AccelerometerData sad[1];
|
||||
static AccelerometerData sad[kAccelerometers];
|
||||
::hal::SimAccelerometerData = sad;
|
||||
}
|
||||
} // namespace hal::init
|
||||
|
||||
@@ -9,7 +9,7 @@ using namespace hal;
|
||||
|
||||
namespace hal::init {
|
||||
void InitializeI2CData() {
|
||||
static I2CData sid[2];
|
||||
static I2CData sid[kI2CPorts];
|
||||
::hal::SimI2CData = sid;
|
||||
}
|
||||
} // namespace hal::init
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#include "hal/simulation/SimDataValue.h"
|
||||
|
||||
namespace hal {
|
||||
constexpr int32_t kNumPDSimModules = hal::kNumREVPDHModules;
|
||||
constexpr int32_t kNumPDSimChannels = hal::kNumREVPDHChannels;
|
||||
|
||||
class PowerDistributionData {
|
||||
HAL_SIMDATAVALUE_DEFINE_NAME(Initialized)
|
||||
|
||||
@@ -9,7 +9,7 @@ using namespace hal;
|
||||
|
||||
namespace hal::init {
|
||||
void InitializeSPIAccelerometerData() {
|
||||
static SPIAccelerometerData ssad[5];
|
||||
static SPIAccelerometerData ssad[kSPIAccelerometers];
|
||||
::hal::SimSPIAccelerometerData = ssad;
|
||||
}
|
||||
} // namespace hal::init
|
||||
|
||||
@@ -9,7 +9,7 @@ using namespace hal;
|
||||
|
||||
namespace hal::init {
|
||||
void InitializeSPIData() {
|
||||
static SPIData ssd[5];
|
||||
static SPIData ssd[kSPIPorts];
|
||||
::hal::SimSPIData = ssd;
|
||||
}
|
||||
} // namespace hal::init
|
||||
|
||||
Reference in New Issue
Block a user