mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[hal] Fix unfinished/incorrect GetCPUTemp functions (#5598)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <units/current.h>
|
||||
#include <units/temperature.h>
|
||||
#include <units/voltage.h>
|
||||
|
||||
#include "frc/simulation/CallbackStore.h"
|
||||
@@ -435,6 +436,31 @@ class RoboRioSim {
|
||||
*/
|
||||
static void SetBrownoutVoltage(units::volt_t brownoutVoltage);
|
||||
|
||||
/**
|
||||
* Register a callback to be run whenever the cpu temp changes.
|
||||
*
|
||||
* @param callback the callback
|
||||
* @param initialNotify whether to call the callback with the initial state
|
||||
* @return the CallbackStore object associated with this callback
|
||||
*/
|
||||
[[nodiscard]]
|
||||
static std::unique_ptr<CallbackStore> RegisterCPUTempCallback(
|
||||
NotifyCallback callback, bool initialNotify);
|
||||
|
||||
/**
|
||||
* Get the cpu temp.
|
||||
*
|
||||
* @return the cpu temp.
|
||||
*/
|
||||
static units::celsius_t GetCPUTemp();
|
||||
|
||||
/**
|
||||
* Define the cpu temp.
|
||||
*
|
||||
* @param cpuTemp the new cpu temp.
|
||||
*/
|
||||
static void SetCPUTemp(units::celsius_t cpuTemp);
|
||||
|
||||
/**
|
||||
* Get the serial number.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user