CTRE Phoenix 6 C++ 26.50.0-alpha-1
Loading...
Searching...
No Matches
CallbackHelper.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) Cross The Road Electronics.  All rights reserved.
3 * License information can be found in CTRE_LICENSE.txt
4 * For support and suggestions contact support@ctr-electronics.com or file
5 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
6 */
7#pragma once
8
9#include <wpi/hal/Value.h>
10
11namespace ctre {
12namespace phoenix6 {
13namespace wpiutils {
14
15class CallbackHelper final {
16public:
17 static double GetRawValue(HAL_Value const *value)
18 {
19 switch (value->type) {
20 case HAL_BOOLEAN:
21 return value->data.v_boolean;
22 case HAL_DOUBLE:
23 return value->data.v_double;
24 case HAL_ENUM:
25 return value->data.v_enum;
26 case HAL_INT:
27 return value->data.v_int;
28 case HAL_LONG:
29 return value->data.v_long;
30 default:
31 return 0;
32 }
33 }
34};
35
36} // namespace wpiutils
37} // namespace phoenix6
38} // namespace ctre
Definition CallbackHelper.hpp:15
static double GetRawValue(HAL_Value const *value)
Definition CallbackHelper.hpp:17
Definition CallbackHelper.hpp:13
Definition ExternalFeedbackConfigs.hpp:16
Definition motor_constants.h:14