mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Add multi PDP getter and sim PCM/PDP multi arg functions (#2014)
This commit is contained in:
committed by
Peter Johnson
parent
931b8ceefd
commit
2ad15cae19
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -42,6 +42,20 @@ DEFINE_CAPI(double, Voltage, voltage)
|
||||
HAL_SIMDATAVALUE_DEFINE_CAPI_CHANNEL(double, HALSIM, PDPCurrent, SimPDPData,
|
||||
current)
|
||||
|
||||
void HALSIM_GetPDPAllCurrents(int32_t index, double* currents) {
|
||||
auto& data = SimPDPData[index].current;
|
||||
for (int i = 0; i < kNumPDPChannels; i++) {
|
||||
currents[i] = data[i];
|
||||
}
|
||||
}
|
||||
|
||||
void HALSIM_SetPDPAllCurrents(int32_t index, const double* currents) {
|
||||
auto& data = SimPDPData[index].current;
|
||||
for (int i = 0; i < kNumPDPChannels; i++) {
|
||||
data[i] = currents[i];
|
||||
}
|
||||
}
|
||||
|
||||
#define REGISTER(NAME) \
|
||||
SimPDPData[index].NAME.RegisterCallback(callback, param, initialNotify)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user