mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[sim] HAL_GetControlWord: Fully zero output (#2873)
This ensures the padding is zero'ed. We already do this on Athena, we just didn't in sim.
This commit is contained in:
@@ -172,7 +172,6 @@ Java_edu_wpi_first_hal_HAL_nativeGetControlWord
|
||||
static_assert(sizeof(HAL_ControlWord) == sizeof(jint),
|
||||
"Java int must match the size of control word");
|
||||
HAL_ControlWord controlWord;
|
||||
std::memset(&controlWord, 0, sizeof(HAL_ControlWord));
|
||||
HAL_GetControlWord(&controlWord);
|
||||
jint retVal = 0;
|
||||
std::memcpy(&retVal, &controlWord, sizeof(HAL_ControlWord));
|
||||
|
||||
@@ -122,6 +122,7 @@ int32_t HAL_SendConsoleLine(const char* line) {
|
||||
}
|
||||
|
||||
int32_t HAL_GetControlWord(HAL_ControlWord* controlWord) {
|
||||
std::memset(controlWord, 0, sizeof(HAL_ControlWord));
|
||||
controlWord->enabled = SimDriverStationData->enabled;
|
||||
controlWord->autonomous = SimDriverStationData->autonomous;
|
||||
controlWord->test = SimDriverStationData->test;
|
||||
|
||||
Reference in New Issue
Block a user