[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:
Peter Johnson
2020-11-20 15:11:11 -08:00
committed by GitHub
parent 4c695ea088
commit 2816b06c05
2 changed files with 1 additions and 1 deletions

View File

@@ -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));

View File

@@ -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;