mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal] Fix unfinished/incorrect GetCPUTemp functions (#5598)
This commit is contained in:
@@ -284,6 +284,23 @@ void RoboRioSim::SetBrownoutVoltage(units::volt_t vInVoltage) {
|
||||
HALSIM_SetRoboRioBrownoutVoltage(vInVoltage.value());
|
||||
}
|
||||
|
||||
std::unique_ptr<CallbackStore> RoboRioSim::RegisterCPUTempCallback(
|
||||
NotifyCallback callback, bool initialNotify) {
|
||||
auto store = std::make_unique<CallbackStore>(
|
||||
-1, callback, &HALSIM_CancelRoboRioCPUTempCallback);
|
||||
store->SetUid(HALSIM_RegisterRoboRioCPUTempCallback(
|
||||
&CallbackStoreThunk, store.get(), initialNotify));
|
||||
return store;
|
||||
}
|
||||
|
||||
units::celsius_t RoboRioSim::GetCPUTemp() {
|
||||
return units::celsius_t{HALSIM_GetRoboRioCPUTemp()};
|
||||
}
|
||||
|
||||
void RoboRioSim::SetCPUTemp(units::celsius_t cpuTemp) {
|
||||
HALSIM_SetRoboRioCPUTemp(cpuTemp.value());
|
||||
}
|
||||
|
||||
std::string RoboRioSim::GetSerialNumber() {
|
||||
char serialNum[9];
|
||||
size_t len = HALSIM_GetRoboRioSerialNumber(serialNum, sizeof(serialNum));
|
||||
|
||||
Reference in New Issue
Block a user