[hal] Fix unfinished/incorrect GetCPUTemp functions (#5598)

This commit is contained in:
Ryan Blue
2023-08-31 14:51:57 -04:00
committed by GitHub
parent 99f66b1e24
commit b2dd59450b
11 changed files with 171 additions and 6 deletions

View File

@@ -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.
*