diff --git a/commandsv2/src/main/native/cpp/frc2/command/CommandScheduler.cpp b/commandsv2/src/main/native/cpp/frc2/command/CommandScheduler.cpp index 9c9a8bdb25..41c8a1798f 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/CommandScheduler.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/CommandScheduler.cpp @@ -15,10 +15,7 @@ #include "wpi/driverstation/DriverStation.hpp" #include "wpi/framework/RobotBase.hpp" #include "wpi/framework/TimedRobot.hpp" -#include "wpi/hal/HALBase.h" -#include "wpi/hal/UsageReporting.h" -#include "wpi/nt/IntegerArrayTopic.hpp" -#include "wpi/nt/StringArrayTopic.hpp" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/util/DenseMap.hpp" #include "wpi/util/SmallVector.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" diff --git a/hal/robotpy_pybind_build_info.bzl b/hal/robotpy_pybind_build_info.bzl index a437dd7cb2..9380ae3100 100644 --- a/hal/robotpy_pybind_build_info.bzl +++ b/hal/robotpy_pybind_build_info.bzl @@ -15,11 +15,19 @@ def hal_simulation_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [] tmpl_class_names = [], trampolines = [], ), + struct( + class_name = "MockHooks_c", + yml_file = "semiwrap/simulation/MockHooks_c.yml", + header_root = "$(execpath :robotpy-native-wpihal.copy_headers)", + header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/simulation/MockHooks.h", + tmpl_class_names = [], + trampolines = [], + ), struct( class_name = "MockHooks", yml_file = "semiwrap/simulation/MockHooks.yml", header_root = "$(execpath :robotpy-native-wpihal.copy_headers)", - header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/simulation/MockHooks.h", + header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/simulation/MockHooks.hpp", tmpl_class_names = [], trampolines = [], ), @@ -147,16 +155,24 @@ def wpihal_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [], includ ], ), struct( - class_name = "DriverStation", - yml_file = "semiwrap/DriverStation.yml", + class_name = "DriverStation_c", + yml_file = "semiwrap/DriverStation_c.yml", header_root = "$(execpath :robotpy-native-wpihal.copy_headers)", header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/DriverStation.h", tmpl_class_names = [], trampolines = [], ), struct( - class_name = "DriverStationTypes", - yml_file = "semiwrap/DriverStationTypes.yml", + class_name = "DriverStation", + yml_file = "semiwrap/DriverStation.yml", + header_root = "$(execpath :robotpy-native-wpihal.copy_headers)", + header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/DriverStation.hpp", + tmpl_class_names = [], + trampolines = [], + ), + struct( + class_name = "DriverStationTypes_c", + yml_file = "semiwrap/DriverStationTypes_c.yml", header_root = "$(execpath :robotpy-native-wpihal.copy_headers)", header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/DriverStationTypes.h", tmpl_class_names = [], @@ -171,10 +187,19 @@ def wpihal_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [], includ ("HAL_JoystickTouchpad", "__HAL_JoystickTouchpad.hpp"), ("HAL_JoystickTouchpads", "__HAL_JoystickTouchpads.hpp"), ("HAL_OpModeOption", "__HAL_OpModeOption.hpp"), - ("wpi::hal::ControlWord", "wpi__hal__ControlWord.hpp"), ("HAL_GameData", "__HAL_GameData.hpp"), ], ), + struct( + class_name = "DriverStationTypes", + yml_file = "semiwrap/DriverStationTypes.yml", + header_root = "$(execpath :robotpy-native-wpihal.copy_headers)", + header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/DriverStationTypes.hpp", + tmpl_class_names = [], + trampolines = [ + ("wpi::hal::ControlWord", "wpi__hal__ControlWord.hpp"), + ], + ), struct( class_name = "Extensions", yml_file = "semiwrap/Extensions.yml", @@ -199,11 +224,27 @@ def wpihal_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [], includ tmpl_class_names = [], trampolines = [], ), + struct( + class_name = "Notifier_c", + yml_file = "semiwrap/Notifier_c.yml", + header_root = "$(execpath :robotpy-native-wpihal.copy_headers)", + header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/Notifier.h", + tmpl_class_names = [], + trampolines = [], + ), struct( class_name = "Notifier", yml_file = "semiwrap/Notifier.yml", header_root = "$(execpath :robotpy-native-wpihal.copy_headers)", - header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/Notifier.h", + header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/Notifier.hpp", + tmpl_class_names = [], + trampolines = [], + ), + struct( + class_name = "SimDevice_c", + yml_file = "semiwrap/SimDevice_c.yml", + header_root = "$(execpath :robotpy-native-wpihal.copy_headers)", + header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/SimDevice.h", tmpl_class_names = [], trampolines = [], ), @@ -211,7 +252,7 @@ def wpihal_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [], includ class_name = "SimDevice", yml_file = "semiwrap/SimDevice.yml", header_root = "$(execpath :robotpy-native-wpihal.copy_headers)", - header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/SimDevice.h", + header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/SimDevice.hpp", tmpl_class_names = [], trampolines = [ ("wpi::hal::SimValue", "wpi__hal__SimValue.hpp"), @@ -235,7 +276,7 @@ def wpihal_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [], includ class_name = "UsageReporting", yml_file = "semiwrap/UsageReporting.yml", header_root = "$(execpath :robotpy-native-wpihal.copy_headers)", - header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/UsageReporting.h", + header_file = "$(execpath :robotpy-native-wpihal.copy_headers)/wpi/hal/UsageReporting.hpp", tmpl_class_names = [], trampolines = [], ), diff --git a/hal/src/main/native/cpp/UsageReporting.cpp b/hal/src/main/native/cpp/UsageReporting.cpp index 55b2fbcae2..b7d6e36da3 100644 --- a/hal/src/main/native/cpp/UsageReporting.cpp +++ b/hal/src/main/native/cpp/UsageReporting.cpp @@ -2,7 +2,7 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include diff --git a/hal/src/main/native/cpp/cpp/fpga_clock.cpp b/hal/src/main/native/cpp/cpp/fpga_clock.cpp index be2819e4ad..f317430d31 100644 --- a/hal/src/main/native/cpp/cpp/fpga_clock.cpp +++ b/hal/src/main/native/cpp/cpp/fpga_clock.cpp @@ -2,7 +2,7 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "wpi/hal/cpp/fpga_clock.h" +#include "wpi/hal/cpp/fpga_clock.hpp" #include #include diff --git a/hal/src/main/native/cpp/handles/HandlesInternal.cpp b/hal/src/main/native/cpp/handles/HandlesInternal.cpp index a88f2bfcac..062a0db585 100644 --- a/hal/src/main/native/cpp/handles/HandlesInternal.cpp +++ b/hal/src/main/native/cpp/handles/HandlesInternal.cpp @@ -2,7 +2,7 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include diff --git a/hal/src/main/native/cpp/jni/AddressableLEDJNI.cpp b/hal/src/main/native/cpp/jni/AddressableLEDJNI.cpp index 6f3c52d142..6bbbde33f0 100644 --- a/hal/src/main/native/cpp/jni/AddressableLEDJNI.cpp +++ b/hal/src/main/native/cpp/jni/AddressableLEDJNI.cpp @@ -4,7 +4,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_AddressableLEDJNI.h" #include "wpi/hal/AddressableLED.h" #include "wpi/util/jni_util.hpp" diff --git a/hal/src/main/native/cpp/jni/AlertJNI.cpp b/hal/src/main/native/cpp/jni/AlertJNI.cpp index 913ba19f33..976589344d 100644 --- a/hal/src/main/native/cpp/jni/AlertJNI.cpp +++ b/hal/src/main/native/cpp/jni/AlertJNI.cpp @@ -7,7 +7,7 @@ #include #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_AlertJNI.h" #include "wpi/hal/Alert.h" #include "wpi/util/jni_util.hpp" diff --git a/hal/src/main/native/cpp/jni/AnalogJNI.cpp b/hal/src/main/native/cpp/jni/AnalogJNI.cpp index 30bcb78a46..e4a49fb127 100644 --- a/hal/src/main/native/cpp/jni/AnalogJNI.cpp +++ b/hal/src/main/native/cpp/jni/AnalogJNI.cpp @@ -6,11 +6,11 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_AnalogJNI.h" #include "wpi/hal/AnalogInput.h" #include "wpi/hal/Ports.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/util/jni_util.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/cpp/jni/CANAPIJNI.cpp b/hal/src/main/native/cpp/jni/CANAPIJNI.cpp index d9a3e604eb..240d803b7c 100644 --- a/hal/src/main/native/cpp/jni/CANAPIJNI.cpp +++ b/hal/src/main/native/cpp/jni/CANAPIJNI.cpp @@ -6,7 +6,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_CANAPIJNI.h" #include "wpi/hal/CAN.h" #include "wpi/hal/CANAPI.h" diff --git a/hal/src/main/native/cpp/jni/CANJNI.cpp b/hal/src/main/native/cpp/jni/CANJNI.cpp index c4d8518802..a6049daf49 100644 --- a/hal/src/main/native/cpp/jni/CANJNI.cpp +++ b/hal/src/main/native/cpp/jni/CANJNI.cpp @@ -6,7 +6,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_can_CANJNI.h" #include "wpi/hal/CAN.h" #include "wpi/hal/Errors.h" diff --git a/hal/src/main/native/cpp/jni/CTREPCMJNI.cpp b/hal/src/main/native/cpp/jni/CTREPCMJNI.cpp index 1636c1c18b..c3913168e3 100644 --- a/hal/src/main/native/cpp/jni/CTREPCMJNI.cpp +++ b/hal/src/main/native/cpp/jni/CTREPCMJNI.cpp @@ -4,11 +4,11 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_CTREPCMJNI.h" #include "wpi/hal/CTREPCM.h" #include "wpi/hal/Ports.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/util/jni_util.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/cpp/jni/ConstantsJNI.cpp b/hal/src/main/native/cpp/jni/ConstantsJNI.cpp index d204f02a27..01a08fa5cb 100644 --- a/hal/src/main/native/cpp/jni/ConstantsJNI.cpp +++ b/hal/src/main/native/cpp/jni/ConstantsJNI.cpp @@ -6,7 +6,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_ConstantsJNI.h" #include "wpi/hal/Constants.h" diff --git a/hal/src/main/native/cpp/jni/CounterJNI.cpp b/hal/src/main/native/cpp/jni/CounterJNI.cpp index c2218aafd2..c16ceab5f7 100644 --- a/hal/src/main/native/cpp/jni/CounterJNI.cpp +++ b/hal/src/main/native/cpp/jni/CounterJNI.cpp @@ -6,7 +6,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_CounterJNI.h" #include "wpi/hal/Counter.h" #include "wpi/hal/Errors.h" diff --git a/hal/src/main/native/cpp/jni/DIOJNI.cpp b/hal/src/main/native/cpp/jni/DIOJNI.cpp index 3059682a90..29c11ee841 100644 --- a/hal/src/main/native/cpp/jni/DIOJNI.cpp +++ b/hal/src/main/native/cpp/jni/DIOJNI.cpp @@ -6,12 +6,12 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_DIOJNI.h" #include "wpi/hal/DIO.h" #include "wpi/hal/PWM.h" #include "wpi/hal/Ports.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/util/jni_util.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/cpp/jni/DriverStationJNI.cpp b/hal/src/main/native/cpp/jni/DriverStationJNI.cpp index 897dd6094d..90e30d1fb6 100644 --- a/hal/src/main/native/cpp/jni/DriverStationJNI.cpp +++ b/hal/src/main/native/cpp/jni/DriverStationJNI.cpp @@ -10,7 +10,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_DriverStationJNI.h" #include "wpi/hal/DriverStation.h" #include "wpi/hal/HALBase.h" diff --git a/hal/src/main/native/cpp/jni/DutyCycleJNI.cpp b/hal/src/main/native/cpp/jni/DutyCycleJNI.cpp index 8191654d5b..d894f64cb8 100644 --- a/hal/src/main/native/cpp/jni/DutyCycleJNI.cpp +++ b/hal/src/main/native/cpp/jni/DutyCycleJNI.cpp @@ -4,7 +4,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_DutyCycleJNI.h" #include "wpi/hal/DutyCycle.h" #include "wpi/util/jni_util.hpp" diff --git a/hal/src/main/native/cpp/jni/EncoderJNI.cpp b/hal/src/main/native/cpp/jni/EncoderJNI.cpp index 313b618734..254b8e3be6 100644 --- a/hal/src/main/native/cpp/jni/EncoderJNI.cpp +++ b/hal/src/main/native/cpp/jni/EncoderJNI.cpp @@ -6,7 +6,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_EncoderJNI.h" #include "wpi/hal/Encoder.h" #include "wpi/hal/Errors.h" diff --git a/hal/src/main/native/cpp/jni/HAL.cpp b/hal/src/main/native/cpp/jni/HAL.cpp index cd829796e7..a113725e30 100644 --- a/hal/src/main/native/cpp/jni/HAL.cpp +++ b/hal/src/main/native/cpp/jni/HAL.cpp @@ -15,7 +15,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_HAL.h" #include "wpi/hal/DriverStation.h" #include "wpi/hal/Main.h" diff --git a/hal/src/main/native/cpp/jni/HALUtil.cpp b/hal/src/main/native/cpp/jni/HALUtil.cpp index 41197d27b6..ca9eb389c8 100644 --- a/hal/src/main/native/cpp/jni/HALUtil.cpp +++ b/hal/src/main/native/cpp/jni/HALUtil.cpp @@ -2,7 +2,7 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "HALUtil.h" +#include "HALUtil.hpp" #include diff --git a/hal/src/main/native/cpp/jni/HALUtil.h b/hal/src/main/native/cpp/jni/HALUtil.hpp similarity index 100% rename from hal/src/main/native/cpp/jni/HALUtil.h rename to hal/src/main/native/cpp/jni/HALUtil.hpp diff --git a/hal/src/main/native/cpp/jni/I2CJNI.cpp b/hal/src/main/native/cpp/jni/I2CJNI.cpp index 341e5a4270..48856a8116 100644 --- a/hal/src/main/native/cpp/jni/I2CJNI.cpp +++ b/hal/src/main/native/cpp/jni/I2CJNI.cpp @@ -6,7 +6,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_I2CJNI.h" #include "wpi/hal/I2C.h" #include "wpi/util/jni_util.hpp" diff --git a/hal/src/main/native/cpp/jni/IMUJNI.cpp b/hal/src/main/native/cpp/jni/IMUJNI.cpp index a8adfa03a3..4df618375d 100644 --- a/hal/src/main/native/cpp/jni/IMUJNI.cpp +++ b/hal/src/main/native/cpp/jni/IMUJNI.cpp @@ -8,7 +8,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_IMUJNI.h" #include "wpi/hal/IMU.h" diff --git a/hal/src/main/native/cpp/jni/NotifierJNI.cpp b/hal/src/main/native/cpp/jni/NotifierJNI.cpp index 68c7a9b773..f3af7e5dd9 100644 --- a/hal/src/main/native/cpp/jni/NotifierJNI.cpp +++ b/hal/src/main/native/cpp/jni/NotifierJNI.cpp @@ -7,7 +7,7 @@ #include #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_NotifierJNI.h" #include "wpi/hal/Notifier.h" #include "wpi/util/jni_util.hpp" diff --git a/hal/src/main/native/cpp/jni/PWMJNI.cpp b/hal/src/main/native/cpp/jni/PWMJNI.cpp index 446316fd4b..1e6ce47723 100644 --- a/hal/src/main/native/cpp/jni/PWMJNI.cpp +++ b/hal/src/main/native/cpp/jni/PWMJNI.cpp @@ -6,12 +6,12 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_PWMJNI.h" #include "wpi/hal/DIO.h" #include "wpi/hal/PWM.h" #include "wpi/hal/Ports.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/util/jni_util.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/cpp/jni/PortsJNI.cpp b/hal/src/main/native/cpp/jni/PortsJNI.cpp index 34030eefa1..f5bb17fe50 100644 --- a/hal/src/main/native/cpp/jni/PortsJNI.cpp +++ b/hal/src/main/native/cpp/jni/PortsJNI.cpp @@ -6,7 +6,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_PortsJNI.h" #include "wpi/hal/Ports.h" diff --git a/hal/src/main/native/cpp/jni/PowerDistributionJNI.cpp b/hal/src/main/native/cpp/jni/PowerDistributionJNI.cpp index 2700aca811..9c468e415a 100644 --- a/hal/src/main/native/cpp/jni/PowerDistributionJNI.cpp +++ b/hal/src/main/native/cpp/jni/PowerDistributionJNI.cpp @@ -4,7 +4,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_PowerDistributionJNI.h" #include "wpi/hal/Ports.h" #include "wpi/hal/PowerDistribution.h" diff --git a/hal/src/main/native/cpp/jni/PowerJNI.cpp b/hal/src/main/native/cpp/jni/PowerJNI.cpp index 9499801139..d81f99c035 100644 --- a/hal/src/main/native/cpp/jni/PowerJNI.cpp +++ b/hal/src/main/native/cpp/jni/PowerJNI.cpp @@ -4,7 +4,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_PowerJNI.h" #include "wpi/hal/Power.h" diff --git a/hal/src/main/native/cpp/jni/REVPHJNI.cpp b/hal/src/main/native/cpp/jni/REVPHJNI.cpp index de93b03405..45dd2ab5c3 100644 --- a/hal/src/main/native/cpp/jni/REVPHJNI.cpp +++ b/hal/src/main/native/cpp/jni/REVPHJNI.cpp @@ -4,11 +4,11 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_REVPHJNI.h" #include "wpi/hal/Ports.h" #include "wpi/hal/REVPH.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/util/jni_util.hpp" static_assert( diff --git a/hal/src/main/native/cpp/jni/SerialPortJNI.cpp b/hal/src/main/native/cpp/jni/SerialPortJNI.cpp index cfe760d0d4..4f1abe6fe5 100644 --- a/hal/src/main/native/cpp/jni/SerialPortJNI.cpp +++ b/hal/src/main/native/cpp/jni/SerialPortJNI.cpp @@ -6,7 +6,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_SerialPortJNI.h" #include "wpi/hal/SerialPort.h" #include "wpi/util/jni_util.hpp" diff --git a/hal/src/main/native/cpp/jni/SimDeviceJNI.cpp b/hal/src/main/native/cpp/jni/SimDeviceJNI.cpp index 7e36d5ce87..e450037d1e 100644 --- a/hal/src/main/native/cpp/jni/SimDeviceJNI.cpp +++ b/hal/src/main/native/cpp/jni/SimDeviceJNI.cpp @@ -7,9 +7,9 @@ #include #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_SimDeviceJNI.h" -#include "wpi/hal/SimDevice.h" +#include "wpi/hal/SimDevice.hpp" #include "wpi/util/jni_util.hpp" using namespace wpi::util::java; diff --git a/hal/src/main/native/cpp/jni/ThreadsJNI.cpp b/hal/src/main/native/cpp/jni/ThreadsJNI.cpp index 6f611db24f..6f07a7e073 100644 --- a/hal/src/main/native/cpp/jni/ThreadsJNI.cpp +++ b/hal/src/main/native/cpp/jni/ThreadsJNI.cpp @@ -6,7 +6,7 @@ #include -#include "HALUtil.h" +#include "HALUtil.hpp" #include "org_wpilib_hardware_hal_ThreadsJNI.h" #include "wpi/hal/Threads.h" diff --git a/hal/src/main/native/cpp/jni/simulation/AddressableLEDDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/AddressableLEDDataJNI.cpp index 34961b376a..a7e3bd8b3c 100644 --- a/hal/src/main/native/cpp/jni/simulation/AddressableLEDDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/AddressableLEDDataJNI.cpp @@ -6,8 +6,8 @@ #include -#include "CallbackStore.h" -#include "ConstBufferCallbackStore.h" +#include "CallbackStore.hpp" +#include "ConstBufferCallbackStore.hpp" #include "org_wpilib_hardware_hal_simulation_AddressableLEDDataJNI.h" #include "wpi/hal/simulation/AddressableLEDData.h" diff --git a/hal/src/main/native/cpp/jni/simulation/AnalogInDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/AnalogInDataJNI.cpp index da56034524..023e4a7120 100644 --- a/hal/src/main/native/cpp/jni/simulation/AnalogInDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/AnalogInDataJNI.cpp @@ -4,7 +4,7 @@ #include -#include "CallbackStore.h" +#include "CallbackStore.hpp" #include "org_wpilib_hardware_hal_simulation_AnalogInDataJNI.h" #include "wpi/hal/simulation/AnalogInData.h" diff --git a/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp index 20352d0811..2342b81249 100644 --- a/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp +++ b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp @@ -2,16 +2,16 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "BufferCallbackStore.h" +#include "BufferCallbackStore.hpp" #include #include #include -#include "SimulatorJNI.h" +#include "SimulatorJNI.hpp" #include "wpi/hal/Types.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/util/jni_util.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.hpp similarity index 94% rename from hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h rename to hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.hpp index cee5338a95..8a9907c936 100644 --- a/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h +++ b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.hpp @@ -6,10 +6,10 @@ #include -#include "SimulatorJNI.h" +#include "SimulatorJNI.hpp" #include "wpi/hal/Types.h" #include "wpi/hal/Value.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/hal/simulation/NotifyListener.h" #include "wpi/util/jni_util.hpp" diff --git a/hal/src/main/native/cpp/jni/simulation/CTREPCMDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/CTREPCMDataJNI.cpp index 327d941724..dbf9aee834 100644 --- a/hal/src/main/native/cpp/jni/simulation/CTREPCMDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/CTREPCMDataJNI.cpp @@ -4,7 +4,7 @@ #include -#include "CallbackStore.h" +#include "CallbackStore.hpp" #include "org_wpilib_hardware_hal_simulation_CTREPCMDataJNI.h" #include "wpi/hal/simulation/CTREPCMData.h" diff --git a/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp index f5bf4c20b8..eaae197610 100644 --- a/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp +++ b/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp @@ -2,17 +2,17 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "CallbackStore.h" +#include "CallbackStore.hpp" #include #include #include -#include "SimulatorJNI.h" +#include "SimulatorJNI.hpp" #include "wpi/hal/Types.h" #include "wpi/hal/Value.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/util/jni_util.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/cpp/jni/simulation/CallbackStore.h b/hal/src/main/native/cpp/jni/simulation/CallbackStore.hpp similarity index 96% rename from hal/src/main/native/cpp/jni/simulation/CallbackStore.h rename to hal/src/main/native/cpp/jni/simulation/CallbackStore.hpp index 5e27b8ff02..17d0b68bfd 100644 --- a/hal/src/main/native/cpp/jni/simulation/CallbackStore.h +++ b/hal/src/main/native/cpp/jni/simulation/CallbackStore.hpp @@ -6,10 +6,10 @@ #include -#include "SimulatorJNI.h" +#include "SimulatorJNI.hpp" #include "wpi/hal/Types.h" #include "wpi/hal/Value.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/hal/simulation/NotifyListener.h" #include "wpi/util/jni_util.hpp" diff --git a/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp index 7c21a51dd1..b1ea7fc917 100644 --- a/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp +++ b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp @@ -2,16 +2,16 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "ConstBufferCallbackStore.h" +#include "ConstBufferCallbackStore.hpp" #include #include #include -#include "SimulatorJNI.h" +#include "SimulatorJNI.hpp" #include "wpi/hal/Types.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/util/jni_util.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.hpp similarity index 94% rename from hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h rename to hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.hpp index 3e6d9e0672..89faea8d72 100644 --- a/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h +++ b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.hpp @@ -6,10 +6,10 @@ #include -#include "SimulatorJNI.h" +#include "SimulatorJNI.hpp" #include "wpi/hal/Types.h" #include "wpi/hal/Value.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/hal/simulation/NotifyListener.h" #include "wpi/util/jni_util.hpp" diff --git a/hal/src/main/native/cpp/jni/simulation/DIODataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/DIODataJNI.cpp index 3e93ff7127..1428e1109a 100644 --- a/hal/src/main/native/cpp/jni/simulation/DIODataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/DIODataJNI.cpp @@ -4,7 +4,7 @@ #include -#include "CallbackStore.h" +#include "CallbackStore.hpp" #include "org_wpilib_hardware_hal_simulation_DIODataJNI.h" #include "wpi/hal/simulation/DIOData.h" diff --git a/hal/src/main/native/cpp/jni/simulation/DigitalPWMDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/DigitalPWMDataJNI.cpp index 6346e098e4..6091b567a9 100644 --- a/hal/src/main/native/cpp/jni/simulation/DigitalPWMDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/DigitalPWMDataJNI.cpp @@ -4,7 +4,7 @@ #include -#include "CallbackStore.h" +#include "CallbackStore.hpp" #include "org_wpilib_hardware_hal_simulation_DigitalPWMDataJNI.h" #include "wpi/hal/simulation/DigitalPWMData.h" diff --git a/hal/src/main/native/cpp/jni/simulation/DriverStationDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/DriverStationDataJNI.cpp index 942d9cc7e3..1709ee5e8c 100644 --- a/hal/src/main/native/cpp/jni/simulation/DriverStationDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/DriverStationDataJNI.cpp @@ -4,10 +4,10 @@ #include -#include "../HALUtil.h" -#include "CallbackStore.h" -#include "OpModeOptionsCallbackStore.h" -#include "SimulatorJNI.h" +#include "../HALUtil.hpp" +#include "CallbackStore.hpp" +#include "OpModeOptionsCallbackStore.hpp" +#include "SimulatorJNI.hpp" #include "org_wpilib_hardware_hal_simulation_DriverStationDataJNI.h" #include "wpi/hal/simulation/DriverStationData.h" #include "wpi/hal/simulation/MockHooks.h" diff --git a/hal/src/main/native/cpp/jni/simulation/DutyCycleDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/DutyCycleDataJNI.cpp index 3191adff98..bc6299addb 100644 --- a/hal/src/main/native/cpp/jni/simulation/DutyCycleDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/DutyCycleDataJNI.cpp @@ -4,7 +4,7 @@ #include -#include "CallbackStore.h" +#include "CallbackStore.hpp" #include "org_wpilib_hardware_hal_simulation_DutyCycleDataJNI.h" #include "wpi/hal/simulation/DutyCycleData.h" diff --git a/hal/src/main/native/cpp/jni/simulation/EncoderDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/EncoderDataJNI.cpp index 86cfdb4dd1..d7e8eae308 100644 --- a/hal/src/main/native/cpp/jni/simulation/EncoderDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/EncoderDataJNI.cpp @@ -4,7 +4,7 @@ #include -#include "CallbackStore.h" +#include "CallbackStore.hpp" #include "org_wpilib_hardware_hal_simulation_EncoderDataJNI.h" #include "wpi/hal/simulation/EncoderData.h" diff --git a/hal/src/main/native/cpp/jni/simulation/I2CDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/I2CDataJNI.cpp index 20aca83cfe..e17ea845a8 100644 --- a/hal/src/main/native/cpp/jni/simulation/I2CDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/I2CDataJNI.cpp @@ -4,9 +4,9 @@ #include -#include "BufferCallbackStore.h" -#include "CallbackStore.h" -#include "ConstBufferCallbackStore.h" +#include "BufferCallbackStore.hpp" +#include "CallbackStore.hpp" +#include "ConstBufferCallbackStore.hpp" #include "org_wpilib_hardware_hal_simulation_I2CDataJNI.h" #include "wpi/hal/simulation/I2CData.h" diff --git a/hal/src/main/native/cpp/jni/simulation/OpModeOptionsCallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/OpModeOptionsCallbackStore.cpp index 4bbd8e071d..14f4f5775b 100644 --- a/hal/src/main/native/cpp/jni/simulation/OpModeOptionsCallbackStore.cpp +++ b/hal/src/main/native/cpp/jni/simulation/OpModeOptionsCallbackStore.cpp @@ -2,17 +2,17 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "OpModeOptionsCallbackStore.h" +#include "OpModeOptionsCallbackStore.hpp" #include #include #include -#include "../HALUtil.h" -#include "SimulatorJNI.h" +#include "../HALUtil.hpp" +#include "SimulatorJNI.hpp" #include "wpi/hal/Types.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/util/jni_util.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/cpp/jni/simulation/OpModeOptionsCallbackStore.h b/hal/src/main/native/cpp/jni/simulation/OpModeOptionsCallbackStore.hpp similarity index 97% rename from hal/src/main/native/cpp/jni/simulation/OpModeOptionsCallbackStore.h rename to hal/src/main/native/cpp/jni/simulation/OpModeOptionsCallbackStore.hpp index 36ca9594e6..35f3bd8652 100644 --- a/hal/src/main/native/cpp/jni/simulation/OpModeOptionsCallbackStore.h +++ b/hal/src/main/native/cpp/jni/simulation/OpModeOptionsCallbackStore.hpp @@ -6,7 +6,7 @@ #include -#include "SimulatorJNI.h" +#include "SimulatorJNI.hpp" #include "wpi/hal/Types.h" #include "wpi/hal/simulation/DriverStationData.h" #include "wpi/util/jni_util.hpp" diff --git a/hal/src/main/native/cpp/jni/simulation/PWMDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/PWMDataJNI.cpp index d5de492775..ca95595dad 100644 --- a/hal/src/main/native/cpp/jni/simulation/PWMDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/PWMDataJNI.cpp @@ -4,7 +4,7 @@ #include -#include "CallbackStore.h" +#include "CallbackStore.hpp" #include "org_wpilib_hardware_hal_simulation_PWMDataJNI.h" #include "wpi/hal/simulation/PWMData.h" diff --git a/hal/src/main/native/cpp/jni/simulation/PowerDistributionDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/PowerDistributionDataJNI.cpp index 6fe61be0fe..d800163be6 100644 --- a/hal/src/main/native/cpp/jni/simulation/PowerDistributionDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/PowerDistributionDataJNI.cpp @@ -4,7 +4,7 @@ #include -#include "CallbackStore.h" +#include "CallbackStore.hpp" #include "org_wpilib_hardware_hal_simulation_PowerDistributionDataJNI.h" #include "wpi/hal/simulation/PowerDistributionData.h" diff --git a/hal/src/main/native/cpp/jni/simulation/REVPHDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/REVPHDataJNI.cpp index 23a6c5e426..f8ab307b79 100644 --- a/hal/src/main/native/cpp/jni/simulation/REVPHDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/REVPHDataJNI.cpp @@ -4,7 +4,7 @@ #include -#include "CallbackStore.h" +#include "CallbackStore.hpp" #include "org_wpilib_hardware_hal_simulation_REVPHDataJNI.h" #include "wpi/hal/simulation/REVPHData.h" diff --git a/hal/src/main/native/cpp/jni/simulation/RoboRioDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/RoboRioDataJNI.cpp index 715b2537ba..667a1031ee 100644 --- a/hal/src/main/native/cpp/jni/simulation/RoboRioDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/RoboRioDataJNI.cpp @@ -4,7 +4,7 @@ #include -#include "CallbackStore.h" +#include "CallbackStore.hpp" #include "org_wpilib_hardware_hal_simulation_RoboRioDataJNI.h" #include "wpi/hal/simulation/RoboRioData.h" #include "wpi/util/jni_util.hpp" diff --git a/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp index 5f968b4daf..f237c2b232 100644 --- a/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp @@ -2,7 +2,7 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "SimDeviceDataJNI.h" +#include "SimDeviceDataJNI.hpp" #include @@ -12,9 +12,9 @@ #include #include -#include "SimulatorJNI.h" +#include "SimulatorJNI.hpp" #include "org_wpilib_hardware_hal_simulation_SimDeviceDataJNI.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/hal/simulation/SimDeviceData.h" #include "wpi/util/jni_util.hpp" diff --git a/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.h b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.hpp similarity index 100% rename from hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.h rename to hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.hpp diff --git a/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.cpp b/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.cpp index 1a156ea7af..2aab0b293d 100644 --- a/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.cpp @@ -2,17 +2,17 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "SimulatorJNI.h" +#include "SimulatorJNI.hpp" #include "AlertDataJNI.hpp" -#include "BufferCallbackStore.h" -#include "CallbackStore.h" -#include "ConstBufferCallbackStore.h" -#include "OpModeOptionsCallbackStore.h" -#include "SimDeviceDataJNI.h" +#include "BufferCallbackStore.hpp" +#include "CallbackStore.hpp" +#include "ConstBufferCallbackStore.hpp" +#include "OpModeOptionsCallbackStore.hpp" +#include "SimDeviceDataJNI.hpp" #include "org_wpilib_hardware_hal_simulation_SimulatorJNI.h" #include "wpi/hal/HAL.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/hal/simulation/MockHooks.h" #include "wpi/util/jni_util.hpp" diff --git a/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.h b/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.hpp similarity index 100% rename from hal/src/main/native/cpp/jni/simulation/SimulatorJNI.h rename to hal/src/main/native/cpp/jni/simulation/SimulatorJNI.hpp diff --git a/hal/src/main/native/include/wpi/hal/DriverStation.h b/hal/src/main/native/include/wpi/hal/DriverStation.h index a244ee1c6d..a595370311 100644 --- a/hal/src/main/native/include/wpi/hal/DriverStation.h +++ b/hal/src/main/native/include/wpi/hal/DriverStation.h @@ -305,19 +305,5 @@ void HAL_ObserveUserProgram(HAL_ControlWord word); #ifdef __cplusplus } // extern "C" - -namespace wpi::hal { -inline ControlWord GetControlWord() { - HAL_ControlWord word; - HAL_GetControlWord(&word); - return ControlWord{word}; -} - -inline ControlWord GetUncachedControlWord() { - HAL_ControlWord word; - HAL_GetUncachedControlWord(&word); - return ControlWord{word}; -} -} // namespace wpi::hal #endif /** @} */ diff --git a/hal/src/main/native/include/wpi/hal/DriverStation.hpp b/hal/src/main/native/include/wpi/hal/DriverStation.hpp new file mode 100644 index 0000000000..53307465aa --- /dev/null +++ b/hal/src/main/native/include/wpi/hal/DriverStation.hpp @@ -0,0 +1,22 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#pragma once + +#include "wpi/hal/DriverStation.h" +#include "wpi/hal/DriverStationTypes.hpp" + +namespace wpi::hal { +inline ControlWord GetControlWord() { + HAL_ControlWord word; + HAL_GetControlWord(&word); + return ControlWord{word}; +} + +inline ControlWord GetUncachedControlWord() { + HAL_ControlWord word; + HAL_GetUncachedControlWord(&word); + return ControlWord{word}; +} +} // namespace wpi::hal diff --git a/hal/src/main/native/include/wpi/hal/DriverStationTypes.h b/hal/src/main/native/include/wpi/hal/DriverStationTypes.h index 25495773af..5d0108690b 100644 --- a/hal/src/main/native/include/wpi/hal/DriverStationTypes.h +++ b/hal/src/main/native/include/wpi/hal/DriverStationTypes.h @@ -9,10 +9,6 @@ #include "wpi/hal/Types.h" #include "wpi/util/string.h" -#ifdef __cplusplus -#include "wpi/util/struct/Struct.hpp" -#endif // __cplusplus - /** * @defgroup hal_driverstation Driver Station Functions * @ingroup hal_capi @@ -190,7 +186,7 @@ typedef struct HAL_OpModeOption HAL_OpModeOption; #ifdef __cplusplus extern "C" { -#endif // __cplusplus +#endif inline HAL_ControlWord HAL_MakeControlWord(int64_t opModeHash, HAL_RobotMode robotMode, @@ -277,235 +273,6 @@ inline int64_t HAL_OpMode_GetHash(int64_t id) { } #ifdef __cplusplus } // extern "C" -#endif // __cplusplus +#endif /** @} */ - -#ifdef __cplusplus -namespace wpi::hal { - -/** - * The overall robot mode (not including enabled state). - */ -enum class RobotMode { - /// Unknown. - UNKNOWN = HAL_ROBOTMODE_UNKNOWN, - /// Autonomous. - AUTONOMOUS = HAL_ROBOTMODE_AUTONOMOUS, - /// Qualification. - TELEOPERATED = HAL_ROBOTMODE_TELEOPERATED, - /// Elimination. - TEST = HAL_ROBOTMODE_TEST -}; - -/** - * A wrapper around Driver Station control word. - */ -class ControlWord { - public: - /** - * Default constructor. - */ - ControlWord() = default; - - /** - * Constructs from state values. - * - * @param opModeHash opmode hash - * @param robotMode robot mode - * @param enabled enabled - * @param eStop emergency stopped - * @param fmsAttached FMS attached - * @param dsAttached DS attached - */ - ControlWord(int64_t opModeHash, RobotMode robotMode, bool enabled, bool eStop, - bool fmsAttached, bool dsAttached) - : m_word{HAL_MakeControlWord(opModeHash, - static_cast(robotMode), - enabled, eStop, fmsAttached, dsAttached)} {} - - /** - * Constructs from the native HAL value. - * - * @param word value - */ - explicit ControlWord(HAL_ControlWord word) : m_word{word} {} - - ControlWord(const ControlWord&) = default; - ControlWord& operator=(const ControlWord&) = default; - - /** - * Updates from state values. - * - * @param opModeHash opmode hash - * @param robotMode robot mode - * @param enabled enabled - * @param eStop emergency stopped - * @param fmsAttached FMS attached - * @param dsAttached DS attached - */ - void Update(int64_t opModeHash, RobotMode robotMode, bool enabled, bool eStop, - bool fmsAttached, bool dsAttached) { - m_word = - HAL_MakeControlWord(opModeHash, static_cast(robotMode), - enabled, eStop, fmsAttached, dsAttached); - } - - /** - * Updates from the native HAL value. - * - * @param word value - */ - void Update(HAL_ControlWord word) { m_word = word; } - - /** - * Check if the DS has enabled the robot. - * - * @return True if the robot is enabled and the DS is connected - */ - bool IsEnabled() const { return HAL_ControlWord_IsEnabled(m_word); } - - /** - * Gets the current robot mode. - * - *

Note that this does not indicate whether the robot is enabled or - * disabled. - * - * @return robot mode - */ - RobotMode GetRobotMode() const { - return static_cast(HAL_ControlWord_GetRobotMode(m_word)); - } - - /** - * Gets the current opmode ID. - * - * @return opmode - */ - int64_t GetOpModeId() const { return HAL_ControlWord_GetOpModeId(m_word); } - - /** - * Sets the opmode ID. - * - * @param id opmode ID - */ - void SetOpModeId(int64_t id) { HAL_ControlWord_SetOpModeId(&m_word, id); } - - /** - * Check if the robot is e-stopped. - * - * @return True if the robot is e-stopped - */ - bool IsEStopped() const { return HAL_ControlWord_IsEStopped(m_word); } - - /** - * Is the driver station attached to a Field Management System? - * - * @return True if the robot is competing on a field being controlled by a - * Field Management System - */ - bool IsFMSAttached() const { return HAL_ControlWord_IsFMSAttached(m_word); } - - /** - * Check if the DS is attached. - * - * @return True if the DS is connected to the robot - */ - bool IsDSAttached() const { return HAL_ControlWord_IsDSAttached(m_word); } - - /** - * Check if the DS is commanding autonomous mode. - * - * @return True if the robot is being commanded to be in autonomous mode - */ - bool IsAutonomous() const { return GetRobotMode() == RobotMode::AUTONOMOUS; } - - /** - * Check if the DS is commanding autonomous mode and if it has enabled the - * robot. - * - * @return True if the robot is being commanded to be in autonomous mode and - * enabled. - */ - bool IsAutonomousEnabled() const { - return IsAutonomous() && IsEnabled() && IsDSAttached(); - } - - /** - * Check if the DS is commanding teleop mode. - * - * @return True if the robot is being commanded to be in teleop mode - */ - bool IsTeleop() const { return GetRobotMode() == RobotMode::TELEOPERATED; } - - /** - * Check if the DS is commanding teleop mode and if it has enabled the robot. - * - * @return True if the robot is being commanded to be in teleop mode and - * enabled. - */ - bool IsTeleopEnabled() const { - return IsTeleop() && IsEnabled() && IsDSAttached(); - } - - /** - * Check if the DS is commanding test mode. - * - * @return True if the robot is being commanded to be in test mode - */ - bool IsTest() const { return GetRobotMode() == RobotMode::TEST; } - - /** - * Check if the DS is commanding test mode and if it has enabled the robot. - * - * @return True if the robot is being commanded to be in test mode and - * enabled. - */ - bool IsTestEnabled() const { - return IsTest() && IsEnabled() && IsDSAttached(); - } - - /** - * Get the HAL raw value. - * - * @return Control word value - */ - HAL_ControlWord GetValue() const { return m_word; } - - private: - HAL_ControlWord m_word{.value = 0}; -}; - -inline bool operator==(const ControlWord& lhs, const ControlWord& rhs) { - return lhs.GetValue().value == rhs.GetValue().value; -} - -inline bool operator!=(const ControlWord& lhs, const ControlWord& rhs) { - return !(lhs == rhs); -} - -} // namespace wpi::hal - -template <> -struct wpi::util::Struct { - static constexpr std::string_view GetTypeName() { return "ControlWord"; } - static constexpr size_t GetSize() { return 8; } - static constexpr std::string_view GetSchema() { - return "uint64 opModeHash:56;" - "enum{unknown=0,autonomous=1,teleoperated=2,test=3}" - "uint64 robotMode:2;" - "bool enabled:1;bool eStop:1;bool fmsAttached:1;bool dsAttached:1;"; - } - - static inline wpi::hal::ControlWord Unpack(std::span data) { - return wpi::hal::ControlWord{ - {.value = wpi::util::UnpackStruct(data)}}; - } - static inline void Pack(std::span data, - wpi::hal::ControlWord value) { - wpi::util::PackStruct(data, value.GetValue().value); - } -}; - -static_assert(wpi::util::StructSerializable); -#endif // __cplusplus diff --git a/hal/src/main/native/include/wpi/hal/DriverStationTypes.hpp b/hal/src/main/native/include/wpi/hal/DriverStationTypes.hpp new file mode 100644 index 0000000000..e015791a26 --- /dev/null +++ b/hal/src/main/native/include/wpi/hal/DriverStationTypes.hpp @@ -0,0 +1,235 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#pragma once + +#include "wpi/hal/DriverStationTypes.h" +#include "wpi/util/struct/Struct.hpp" + +namespace wpi::hal { + +/** + * The overall robot mode (not including enabled state). + */ +enum class RobotMode { + /// Unknown. + UNKNOWN = HAL_ROBOTMODE_UNKNOWN, + /// Autonomous. + AUTONOMOUS = HAL_ROBOTMODE_AUTONOMOUS, + /// Teleoperated. + TELEOPERATED = HAL_ROBOTMODE_TELEOPERATED, + /// Test. + TEST = HAL_ROBOTMODE_TEST +}; + +/** + * A wrapper around Driver Station control word. + */ +class ControlWord { + public: + /** + * Default constructor. + */ + ControlWord() = default; + + /** + * Constructs from state values. + * + * @param opModeHash opmode hash + * @param robotMode robot mode + * @param enabled enabled + * @param eStop emergency stopped + * @param fmsAttached FMS attached + * @param dsAttached DS attached + */ + ControlWord(int64_t opModeHash, RobotMode robotMode, bool enabled, bool eStop, + bool fmsAttached, bool dsAttached) + : m_word{HAL_MakeControlWord(opModeHash, + static_cast(robotMode), + enabled, eStop, fmsAttached, dsAttached)} {} + + /** + * Constructs from the native HAL value. + * + * @param word value + */ + explicit ControlWord(HAL_ControlWord word) : m_word{word} {} + + ControlWord(const ControlWord&) = default; + ControlWord& operator=(const ControlWord&) = default; + + /** + * Updates from state values. + * + * @param opModeHash opmode hash + * @param robotMode robot mode + * @param enabled enabled + * @param eStop emergency stopped + * @param fmsAttached FMS attached + * @param dsAttached DS attached + */ + void Update(int64_t opModeHash, RobotMode robotMode, bool enabled, bool eStop, + bool fmsAttached, bool dsAttached) { + m_word = + HAL_MakeControlWord(opModeHash, static_cast(robotMode), + enabled, eStop, fmsAttached, dsAttached); + } + + /** + * Updates from the native HAL value. + * + * @param word value + */ + void Update(HAL_ControlWord word) { m_word = word; } + + /** + * Check if the DS has enabled the robot. + * + * @return True if the robot is enabled and the DS is connected + */ + bool IsEnabled() const { return HAL_ControlWord_IsEnabled(m_word); } + + /** + * Gets the current robot mode. + * + *

Note that this does not indicate whether the robot is enabled or + * disabled. + * + * @return robot mode + */ + RobotMode GetRobotMode() const { + return static_cast(HAL_ControlWord_GetRobotMode(m_word)); + } + + /** + * Gets the current opmode ID. + * + * @return opmode + */ + int64_t GetOpModeId() const { return HAL_ControlWord_GetOpModeId(m_word); } + + /** + * Sets the opmode ID. + * + * @param id opmode ID + */ + void SetOpModeId(int64_t id) { HAL_ControlWord_SetOpModeId(&m_word, id); } + + /** + * Check if the robot is e-stopped. + * + * @return True if the robot is e-stopped + */ + bool IsEStopped() const { return HAL_ControlWord_IsEStopped(m_word); } + + /** + * Is the driver station attached to a Field Management System? + * + * @return True if the robot is competing on a field being controlled by a + * Field Management System + */ + bool IsFMSAttached() const { return HAL_ControlWord_IsFMSAttached(m_word); } + + /** + * Check if the DS is attached. + * + * @return True if the DS is connected to the robot + */ + bool IsDSAttached() const { return HAL_ControlWord_IsDSAttached(m_word); } + + /** + * Check if the DS is commanding autonomous mode. + * + * @return True if the robot is being commanded to be in autonomous mode + */ + bool IsAutonomous() const { return GetRobotMode() == RobotMode::AUTONOMOUS; } + + /** + * Check if the DS is commanding autonomous mode and if it has enabled the + * robot. + * + * @return True if the robot is being commanded to be in autonomous mode and + * enabled. + */ + bool IsAutonomousEnabled() const { + return IsAutonomous() && IsEnabled() && IsDSAttached(); + } + + /** + * Check if the DS is commanding teleop mode. + * + * @return True if the robot is being commanded to be in teleop mode + */ + bool IsTeleop() const { return GetRobotMode() == RobotMode::TELEOPERATED; } + + /** + * Check if the DS is commanding teleop mode and if it has enabled the robot. + * + * @return True if the robot is being commanded to be in teleop mode and + * enabled. + */ + bool IsTeleopEnabled() const { + return IsTeleop() && IsEnabled() && IsDSAttached(); + } + + /** + * Check if the DS is commanding test mode. + * + * @return True if the robot is being commanded to be in test mode + */ + bool IsTest() const { return GetRobotMode() == RobotMode::TEST; } + + /** + * Check if the DS is commanding test mode and if it has enabled the robot. + * + * @return True if the robot is being commanded to be in test mode and + * enabled. + */ + bool IsTestEnabled() const { + return IsTest() && IsEnabled() && IsDSAttached(); + } + + /** + * Get the HAL raw value. + * + * @return Control word value + */ + HAL_ControlWord GetValue() const { return m_word; } + + private: + HAL_ControlWord m_word{.value = 0}; +}; + +inline bool operator==(const ControlWord& lhs, const ControlWord& rhs) { + return lhs.GetValue().value == rhs.GetValue().value; +} + +inline bool operator!=(const ControlWord& lhs, const ControlWord& rhs) { + return !(lhs == rhs); +} + +} // namespace wpi::hal + +template <> +struct wpi::util::Struct { + static constexpr std::string_view GetTypeName() { return "ControlWord"; } + static constexpr size_t GetSize() { return 8; } + static constexpr std::string_view GetSchema() { + return "uint64 opModeHash:56;" + "enum{unknown=0,autonomous=1,teleoperated=2,test=3}" + "uint64 robotMode:2;" + "bool enabled:1;bool eStop:1;bool fmsAttached:1;bool dsAttached:1;"; + } + + static inline wpi::hal::ControlWord Unpack(std::span data) { + return wpi::hal::ControlWord{ + {.value = wpi::util::UnpackStruct(data)}}; + } + static inline void Pack(std::span data, + wpi::hal::ControlWord value) { + wpi::util::PackStruct(data, value.GetValue().value); + } +}; + +static_assert(wpi::util::StructSerializable); diff --git a/hal/src/main/native/include/wpi/hal/Notifier.h b/hal/src/main/native/include/wpi/hal/Notifier.h index 85658215fd..9d6981e10e 100644 --- a/hal/src/main/native/include/wpi/hal/Notifier.h +++ b/hal/src/main/native/include/wpi/hal/Notifier.h @@ -6,10 +6,6 @@ #include -#ifdef __cplusplus -#include -#endif - #include "wpi/hal/Types.h" #include "wpi/util/string.h" @@ -134,18 +130,3 @@ int32_t HAL_GetNotifierOverrun(HAL_NotifierHandle notifierHandle, } // extern "C" #endif /** @} */ - -#ifdef __cplusplus -/** - * Sets the name of a notifier. - * - * @param[in] notifierHandle the notifier handle - * @param[in] name name - * @param[out] status Error status variable. 0 on success. - */ -inline void HAL_SetNotifierName(HAL_NotifierHandle notifierHandle, - std::string_view name, int32_t* status) { - WPI_String nameStr = wpi::util::make_string(name); - HAL_SetNotifierName(notifierHandle, &nameStr, status); -} -#endif diff --git a/hal/src/main/native/include/wpi/hal/Notifier.hpp b/hal/src/main/native/include/wpi/hal/Notifier.hpp new file mode 100644 index 0000000000..22a7e80603 --- /dev/null +++ b/hal/src/main/native/include/wpi/hal/Notifier.hpp @@ -0,0 +1,22 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#pragma once + +#include + +#include "wpi/hal/Notifier.h" + +/** + * Sets the name of a notifier. + * + * @param[in] notifierHandle the notifier handle + * @param[in] name name + * @param[out] status Error status variable. 0 on success. + */ +inline void HAL_SetNotifierName(HAL_NotifierHandle notifierHandle, + std::string_view name, int32_t* status) { + WPI_String nameStr = wpi::util::make_string(name); + HAL_SetNotifierName(notifierHandle, &nameStr, status); +} diff --git a/hal/src/main/native/include/wpi/hal/SimDevice.h b/hal/src/main/native/include/wpi/hal/SimDevice.h index 2aa20ffdb1..806da6fda4 100644 --- a/hal/src/main/native/include/wpi/hal/SimDevice.h +++ b/hal/src/main/native/include/wpi/hal/SimDevice.h @@ -6,12 +6,6 @@ #include -#ifdef __cplusplus -#include -#include -#include -#endif - #include "wpi/hal/Types.h" #include "wpi/hal/Value.h" @@ -92,17 +86,6 @@ HAL_SimValueHandle HAL_CreateSimValue(HAL_SimDeviceHandle device, const char* name, int32_t direction, const struct HAL_Value* initialValue); -#ifdef __cplusplus -extern "C++" { -inline HAL_SimValueHandle HAL_CreateSimValue(HAL_SimDeviceHandle device, - const char* name, - int32_t direction, - const HAL_Value& initialValue) { - return HAL_CreateSimValue(device, name, direction, &initialValue); -} -} // extern "C++" -#endif - /** * Creates an int value on a simulated device. * @@ -235,16 +218,6 @@ inline HAL_SimValueHandle HAL_CreateSimValueBoolean(HAL_SimDeviceHandle device, */ void HAL_GetSimValue(HAL_SimValueHandle handle, struct HAL_Value* value); -#ifdef __cplusplus -extern "C++" { -inline HAL_Value HAL_GetSimValue(HAL_SimValueHandle handle) { - HAL_Value v; - HAL_GetSimValue(handle, &v); - return v; -} -} // extern "C++" -#endif - /** * Gets a simulated value (int). * @@ -313,14 +286,6 @@ inline HAL_Bool HAL_GetSimValueBoolean(HAL_SimValueHandle handle) { */ void HAL_SetSimValue(HAL_SimValueHandle handle, const struct HAL_Value* value); -#ifdef __cplusplus -extern "C++" { -inline void HAL_SetSimValue(HAL_SimValueHandle handle, const HAL_Value& value) { - HAL_SetSimValue(handle, &value); -} -} // extern "C++" -#endif - /** * Sets a simulated value (int). * @@ -392,557 +357,3 @@ void HAL_ResetSimValue(HAL_SimValueHandle handle); #ifdef __cplusplus } // extern "C" #endif - -#ifdef __cplusplus -namespace wpi::hal { - -/** - * C++ wrapper around a HAL simulator value handle. - */ -class SimValue { - public: - /** - * Default constructor that results in an "empty" object that is false in - * a boolean context. - */ - SimValue() = default; - - /** - * Wraps a simulated value handle as returned by HAL_CreateSimValue(). - * - * @param val simulated value handle - */ - /*implicit*/ SimValue(HAL_SimValueHandle val) // NOLINT - : m_handle(val) {} - - /** - * Determine if handle is empty. Should be used to optimize out code paths - * that are taken/not taken in simulation. - * - * @return False if handle is empty, true if handle is valid. - */ - explicit operator bool() const { return m_handle != HAL_kInvalidHandle; } - - /** - * Get the internal device handle. - * - * @return internal handle - */ - operator HAL_SimValueHandle() const { return m_handle; } // NOLINT - - /** - * Gets the simulated value. - * - * @return The current value - */ - HAL_Value GetValue() const { return HAL_GetSimValue(m_handle); } - - /** - * Sets the simulated value. - * - * @param value the value to set - */ - void SetValue(const HAL_Value& value) { HAL_SetSimValue(m_handle, value); } - - protected: - HAL_SimValueHandle m_handle = HAL_kInvalidHandle; -}; - -/** - * C++ wrapper around a HAL simulator int value handle. - */ -class SimInt : public SimValue { - public: - /** - * Default constructor that results in an "empty" object that is false in - * a boolean context. - */ - SimInt() = default; - - /** - * Wraps a simulated value handle as returned by HAL_CreateSimValueInt(). - * - * @param val simulated value handle - */ - /*implicit*/ SimInt(HAL_SimValueHandle val) // NOLINT - : SimValue(val) {} - - /** - * Gets the simulated value. - * - * @return The current value - */ - int32_t Get() const { return HAL_GetSimValueInt(m_handle); } - - /** - * Sets the simulated value. - * - * @param value the value to set - */ - void Set(int32_t value) { HAL_SetSimValueInt(m_handle, value); } - - /** - * Resets the simulated value to 0. Use this instead of Set(0) for resetting - * incremental sensor values like encoder counts or gyro accumulated angle - * to ensure correct behavior in a distributed system (e.g. WebSockets). - */ - void Reset() { HAL_ResetSimValue(m_handle); } -}; - -/** - * C++ wrapper around a HAL simulator long value handle. - */ -class SimLong : public SimValue { - public: - /** - * Default constructor that results in an "empty" object that is false in - * a boolean context. - */ - SimLong() = default; - - /** - * Wraps a simulated value handle as returned by HAL_CreateSimValueLong(). - * - * @param val simulated value handle - */ - /*implicit*/ SimLong(HAL_SimValueHandle val) // NOLINT - : SimValue(val) {} - - /** - * Gets the simulated value. - * - * @return The current value - */ - int64_t Get() const { return HAL_GetSimValueLong(m_handle); } - - /** - * Sets the simulated value. - * - * @param value the value to set - */ - void Set(int64_t value) { HAL_SetSimValueLong(m_handle, value); } - - /** - * Resets the simulated value to 0. Use this instead of Set(0) for resetting - * incremental sensor values like encoder counts or gyro accumulated angle - * to ensure correct behavior in a distributed system (e.g. WebSockets). - */ - void Reset() { HAL_ResetSimValue(m_handle); } -}; - -/** - * C++ wrapper around a HAL simulator double value handle. - */ -class SimDouble : public SimValue { - public: - /** - * Default constructor that results in an "empty" object that is false in - * a boolean context. - */ - SimDouble() = default; - - /** - * Wraps a simulated value handle as returned by HAL_CreateSimValueDouble(). - * - * @param val simulated value handle - */ - /*implicit*/ SimDouble(HAL_SimValueHandle val) // NOLINT - : SimValue(val) {} - - /** - * Gets the simulated value. - * - * @return The current value - */ - double Get() const { return HAL_GetSimValueDouble(m_handle); } - - /** - * Sets the simulated value. - * - * @param value the value to set - */ - void Set(double value) { HAL_SetSimValueDouble(m_handle, value); } - - /** - * Resets the simulated value to 0. Use this instead of Set(0) for resetting - * incremental sensor values like encoder counts or gyro accumulated angle - * to ensure correct behavior in a distributed system (e.g. WebSockets). - */ - void Reset() { HAL_ResetSimValue(m_handle); } -}; - -/** - * C++ wrapper around a HAL simulator enum value handle. - */ -class SimEnum : public SimValue { - public: - /** - * Default constructor that results in an "empty" object that is false in - * a boolean context. - */ - SimEnum() = default; - - /** - * Wraps a simulated value handle as returned by HAL_CreateSimValueEnum(). - * - * @param val simulated value handle - */ - /*implicit*/ SimEnum(HAL_SimValueHandle val) // NOLINT - : SimValue(val) {} - - /** - * Gets the simulated value. - * - * @return The current value - */ - int32_t Get() const { return HAL_GetSimValueEnum(m_handle); } - - /** - * Sets the simulated value. - * - * @param value the value to set - */ - void Set(int32_t value) { HAL_SetSimValueEnum(m_handle, value); } -}; - -/** - * C++ wrapper around a HAL simulator boolean value handle. - */ -class SimBoolean : public SimValue { - public: - /** - * Default constructor that results in an "empty" object that is false in - * a boolean context. - */ - SimBoolean() = default; - - /** - * Wraps a simulated value handle as returned by HAL_CreateSimValueBoolean(). - * - * @param val simulated value handle - */ - /*implicit*/ SimBoolean(HAL_SimValueHandle val) // NOLINT - : SimValue(val) {} - - /** - * Gets the simulated value. - * - * @return The current value - */ - bool Get() const { return HAL_GetSimValueBoolean(m_handle); } - - /** - * Sets the simulated value. - * - * @param value the value to set - */ - void Set(bool value) { HAL_SetSimValueBoolean(m_handle, value); } -}; - -/** - * A move-only C++ wrapper around a HAL simulator device handle. - */ -class SimDevice { - public: - /** - * Direction of a simulated value (from the perspective of user code). - */ - enum Direction { - kInput = HAL_SimValueInput, - kOutput = HAL_SimValueOutput, - kBidir = HAL_SimValueBidir - }; - - /** - * Default constructor that results in an "empty" object that is false in - * a boolean context. - */ - SimDevice() = default; - - /** - * Creates a simulated device. - * - * The device name must be unique. Returns null if the device name - * already exists. If multiple instances of the same device are desired, - * recommend appending the instance/unique identifier in brackets to the base - * name, e.g. "device[1]". - * - * Using a device name of the form "Type:Name" will create a WebSockets node - * with a type value of "Type" and a device value of "Name" - * - * If not in simulation, results in an "empty" object that evaluates to false - * in a boolean context. - * - * @param name device name - */ - explicit SimDevice(const char* name) : m_handle(HAL_CreateSimDevice(name)) {} - - /** - * Creates a simulated device. - * - * The device name must be unique. Returns null if the device name - * already exists. This is a convenience method that appends index in - * brackets to the device name, e.g. passing index=1 results in "device[1]" - * for the device name. - * - * Using a device name of the form "Type:Name" will create a WebSockets node - * with a type value of "Type" and a device value of "Name" - * - * If not in simulation, results in an "empty" object that evaluates to false - * in a boolean context. - * - * @param name device name - * @param index device index number to append to name - */ - SimDevice(const char* name, int index); - - /** - * Creates a simulated device. - * - * The device name must be unique. Returns null if the device name - * already exists. This is a convenience method that appends index and - * channel in brackets to the device name, e.g. passing index=1 and channel=2 - * results in "device[1,2]" for the device name. - * - * Using a device name of the form "Type:Name" will create a WebSockets node - * with a type value of "Type" and a device value of "Name" - * - * If not in simulation, results in an "empty" object that evaluates to false - * in a boolean context. - * - * @param name device name - * @param index device index number to append to name - * @param channel device channel number to append to name - */ - SimDevice(const char* name, int index, int channel); - - ~SimDevice() { - if (m_handle != HAL_kInvalidHandle) { - HAL_FreeSimDevice(m_handle); - } - } - - SimDevice(const SimDevice&) = delete; - SimDevice& operator=(const SimDevice&) = delete; - - SimDevice(SimDevice&& rhs) : m_handle(rhs.m_handle) { - rhs.m_handle = HAL_kInvalidHandle; - } - - SimDevice& operator=(SimDevice&& rhs) { - m_handle = rhs.m_handle; - rhs.m_handle = HAL_kInvalidHandle; - return *this; - } - - /** - * Determine if handle is empty. Should be used to optimize out code paths - * that are taken/not taken in simulation. - * - * @return False if handle is empty, true if handle is valid. - */ - explicit operator bool() const { return m_handle != HAL_kInvalidHandle; } - - /** - * Get the internal device handle. - * - * @return internal handle - */ - operator HAL_SimDeviceHandle() const { return m_handle; } // NOLINT - - /** - * Get the name of the simulated device. - * - * @return name - */ - std::string GetName() const { - return std::string(HAL_GetSimDeviceName(m_handle)); - } - - /** - * Creates a value on the simulated device. - * - * If not in simulation, results in an "empty" object that evaluates to false - * in a boolean context. - * - * @param name value name - * @param direction input/output/bidir (from perspective of user code) - * @param initialValue initial value - * @return simulated value object - */ - SimValue CreateValue(const char* name, int32_t direction, - const HAL_Value& initialValue) { - return HAL_CreateSimValue(m_handle, name, direction, &initialValue); - } - - /** - * Creates an int value on the simulated device. - * - * If not in simulation, results in an "empty" object that evaluates to false - * in a boolean context. - * - * @param name value name - * @param direction input/output/bidir (from perspective of user code) - * @param initialValue initial value - * @return simulated double value object - */ - SimInt CreateInt(const char* name, int32_t direction, int32_t initialValue) { - return HAL_CreateSimValueInt(m_handle, name, direction, initialValue); - } - - /** - * Creates a long value on the simulated device. - * - * If not in simulation, results in an "empty" object that evaluates to false - * in a boolean context. - * - * @param name value name - * @param direction input/output/bidir (from perspective of user code) - * @param initialValue initial value - * @return simulated double value object - */ - SimLong CreateLong(const char* name, int32_t direction, - int64_t initialValue) { - return HAL_CreateSimValueLong(m_handle, name, direction, initialValue); - } - - /** - * Creates a double value on the simulated device. - * - * If not in simulation, results in an "empty" object that evaluates to false - * in a boolean context. - * - * @param name value name - * @param direction input/output/bidir (from perspective of user code) - * @param initialValue initial value - * @return simulated double value object - */ - SimDouble CreateDouble(const char* name, int32_t direction, - double initialValue) { - return HAL_CreateSimValueDouble(m_handle, name, direction, initialValue); - } - - /** - * Creates an enumerated value on the simulated device. - * - * Enumerated values are always in the range 0 to numOptions-1. - * - * If not in simulation, results in an "empty" object that evaluates to false - * in a boolean context. - * - * @param name value name - * @param direction input/output/bidir (from perspective of user code) - * @param options array of option descriptions - * @param initialValue initial value (selection) - * @return simulated enum value object - */ - SimEnum CreateEnum(const char* name, int32_t direction, - std::initializer_list options, - int32_t initialValue) { - return HAL_CreateSimValueEnum(m_handle, name, direction, options.size(), - const_cast(options.begin()), - initialValue); - } - - /** - * Creates an enumerated value on the simulated device. - * - * Enumerated values are always in the range 0 to numOptions-1. - * - * If not in simulation, results in an "empty" object that evaluates to false - * in a boolean context. - * - * @param name value name - * @param direction input/output/bidir (from perspective of user code) - * @param options array of option descriptions - * @param initialValue initial value (selection) - * @return simulated enum value object - */ - SimEnum CreateEnum(const char* name, int32_t direction, - std::span options, - int32_t initialValue) { - return HAL_CreateSimValueEnum(m_handle, name, direction, options.size(), - const_cast(options.data()), - initialValue); - } - - /** - * Creates an enumerated value on the simulated device with double values. - * - * Enumerated values are always in the range 0 to numOptions-1. - * - * If not in simulation, results in an "empty" object that evaluates to false - * in a boolean context. - * - * @param name value name - * @param direction input/output/bidir (from perspective of user code) - * @param options array of option descriptions - * @param optionValues array of option values (must be the same size as - * options) - * @param initialValue initial value (selection) - * @return simulated enum value object - */ - SimEnum CreateEnumDouble(const char* name, int32_t direction, - std::initializer_list options, - std::initializer_list optionValues, - int32_t initialValue) { - if (options.size() != optionValues.size()) { - return {}; - } - return HAL_CreateSimValueEnumDouble( - m_handle, name, direction, options.size(), - const_cast(options.begin()), optionValues.begin(), - initialValue); - } - - /** - * Creates an enumerated value on the simulated device with double values. - * - * Enumerated values are always in the range 0 to numOptions-1. - * - * If not in simulation, results in an "empty" object that evaluates to false - * in a boolean context. - * - * @param name value name - * @param direction input/output/bidir (from perspective of user code) - * @param options array of option descriptions - * @param optionValues array of option values (must be the same size as - * options) - * @param initialValue initial value (selection) - * @return simulated enum value object - */ - SimEnum CreateEnumDouble(const char* name, int32_t direction, - std::span options, - std::span optionValues, - int32_t initialValue) { - if (options.size() != optionValues.size()) { - return {}; - } - return HAL_CreateSimValueEnumDouble( - m_handle, name, direction, options.size(), - const_cast(options.data()), optionValues.data(), - initialValue); - } - - /** - * Creates a boolean value on the simulated device. - * - * If not in simulation, results in an "empty" object that evaluates to false - * in a boolean context. - * - * @param name value name - * @param direction input/output/bidir (from perspective of user code) - * @param initialValue initial value - * @return simulated boolean value object - */ - SimBoolean CreateBoolean(const char* name, int32_t direction, - bool initialValue) { - return HAL_CreateSimValueBoolean(m_handle, name, direction, initialValue); - } - - protected: - HAL_SimDeviceHandle m_handle = HAL_kInvalidHandle; -}; - -} // namespace wpi::hal -#endif // __cplusplus diff --git a/hal/src/main/native/include/wpi/hal/SimDevice.hpp b/hal/src/main/native/include/wpi/hal/SimDevice.hpp new file mode 100644 index 0000000000..1608001003 --- /dev/null +++ b/hal/src/main/native/include/wpi/hal/SimDevice.hpp @@ -0,0 +1,580 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#pragma once + +#include +#include +#include + +#include "wpi/hal/SimDevice.h" + +inline HAL_SimValueHandle HAL_CreateSimValue(HAL_SimDeviceHandle device, + const char* name, + int32_t direction, + const HAL_Value& initialValue) { + return HAL_CreateSimValue(device, name, direction, &initialValue); +} + +inline HAL_Value HAL_GetSimValue(HAL_SimValueHandle handle) { + HAL_Value v; + HAL_GetSimValue(handle, &v); + return v; +} + +inline void HAL_SetSimValue(HAL_SimValueHandle handle, const HAL_Value& value) { + HAL_SetSimValue(handle, &value); +} + +namespace wpi::hal { + +/** + * C++ wrapper around a HAL simulator value handle. + */ +class SimValue { + public: + /** + * Default constructor that results in an "empty" object that is false in + * a boolean context. + */ + SimValue() = default; + + /** + * Wraps a simulated value handle as returned by HAL_CreateSimValue(). + * + * @param val simulated value handle + */ + /*implicit*/ SimValue(HAL_SimValueHandle val) // NOLINT + : m_handle(val) {} + + /** + * Determine if handle is empty. Should be used to optimize out code paths + * that are taken/not taken in simulation. + * + * @return False if handle is empty, true if handle is valid. + */ + explicit operator bool() const { return m_handle != HAL_kInvalidHandle; } + + /** + * Get the internal device handle. + * + * @return internal handle + */ + operator HAL_SimValueHandle() const { return m_handle; } // NOLINT + + /** + * Gets the simulated value. + * + * @return The current value + */ + HAL_Value GetValue() const { return HAL_GetSimValue(m_handle); } + + /** + * Sets the simulated value. + * + * @param value the value to set + */ + void SetValue(const HAL_Value& value) { HAL_SetSimValue(m_handle, value); } + + protected: + HAL_SimValueHandle m_handle = HAL_kInvalidHandle; +}; + +/** + * C++ wrapper around a HAL simulator int value handle. + */ +class SimInt : public SimValue { + public: + /** + * Default constructor that results in an "empty" object that is false in + * a boolean context. + */ + SimInt() = default; + + /** + * Wraps a simulated value handle as returned by HAL_CreateSimValueInt(). + * + * @param val simulated value handle + */ + /*implicit*/ SimInt(HAL_SimValueHandle val) // NOLINT + : SimValue(val) {} + + /** + * Gets the simulated value. + * + * @return The current value + */ + int32_t Get() const { return HAL_GetSimValueInt(m_handle); } + + /** + * Sets the simulated value. + * + * @param value the value to set + */ + void Set(int32_t value) { HAL_SetSimValueInt(m_handle, value); } + + /** + * Resets the simulated value to 0. Use this instead of Set(0) for resetting + * incremental sensor values like encoder counts or gyro accumulated angle + * to ensure correct behavior in a distributed system (e.g. WebSockets). + */ + void Reset() { HAL_ResetSimValue(m_handle); } +}; + +/** + * C++ wrapper around a HAL simulator long value handle. + */ +class SimLong : public SimValue { + public: + /** + * Default constructor that results in an "empty" object that is false in + * a boolean context. + */ + SimLong() = default; + + /** + * Wraps a simulated value handle as returned by HAL_CreateSimValueLong(). + * + * @param val simulated value handle + */ + /*implicit*/ SimLong(HAL_SimValueHandle val) // NOLINT + : SimValue(val) {} + + /** + * Gets the simulated value. + * + * @return The current value + */ + int64_t Get() const { return HAL_GetSimValueLong(m_handle); } + + /** + * Sets the simulated value. + * + * @param value the value to set + */ + void Set(int64_t value) { HAL_SetSimValueLong(m_handle, value); } + + /** + * Resets the simulated value to 0. Use this instead of Set(0) for resetting + * incremental sensor values like encoder counts or gyro accumulated angle + * to ensure correct behavior in a distributed system (e.g. WebSockets). + */ + void Reset() { HAL_ResetSimValue(m_handle); } +}; + +/** + * C++ wrapper around a HAL simulator double value handle. + */ +class SimDouble : public SimValue { + public: + /** + * Default constructor that results in an "empty" object that is false in + * a boolean context. + */ + SimDouble() = default; + + /** + * Wraps a simulated value handle as returned by HAL_CreateSimValueDouble(). + * + * @param val simulated value handle + */ + /*implicit*/ SimDouble(HAL_SimValueHandle val) // NOLINT + : SimValue(val) {} + + /** + * Gets the simulated value. + * + * @return The current value + */ + double Get() const { return HAL_GetSimValueDouble(m_handle); } + + /** + * Sets the simulated value. + * + * @param value the value to set + */ + void Set(double value) { HAL_SetSimValueDouble(m_handle, value); } + + /** + * Resets the simulated value to 0. Use this instead of Set(0) for resetting + * incremental sensor values like encoder counts or gyro accumulated angle + * to ensure correct behavior in a distributed system (e.g. WebSockets). + */ + void Reset() { HAL_ResetSimValue(m_handle); } +}; + +/** + * C++ wrapper around a HAL simulator enum value handle. + */ +class SimEnum : public SimValue { + public: + /** + * Default constructor that results in an "empty" object that is false in + * a boolean context. + */ + SimEnum() = default; + + /** + * Wraps a simulated value handle as returned by HAL_CreateSimValueEnum(). + * + * @param val simulated value handle + */ + /*implicit*/ SimEnum(HAL_SimValueHandle val) // NOLINT + : SimValue(val) {} + + /** + * Gets the simulated value. + * + * @return The current value + */ + int32_t Get() const { return HAL_GetSimValueEnum(m_handle); } + + /** + * Sets the simulated value. + * + * @param value the value to set + */ + void Set(int32_t value) { HAL_SetSimValueEnum(m_handle, value); } +}; + +/** + * C++ wrapper around a HAL simulator boolean value handle. + */ +class SimBoolean : public SimValue { + public: + /** + * Default constructor that results in an "empty" object that is false in + * a boolean context. + */ + SimBoolean() = default; + + /** + * Wraps a simulated value handle as returned by HAL_CreateSimValueBoolean(). + * + * @param val simulated value handle + */ + /*implicit*/ SimBoolean(HAL_SimValueHandle val) // NOLINT + : SimValue(val) {} + + /** + * Gets the simulated value. + * + * @return The current value + */ + bool Get() const { return HAL_GetSimValueBoolean(m_handle); } + + /** + * Sets the simulated value. + * + * @param value the value to set + */ + void Set(bool value) { HAL_SetSimValueBoolean(m_handle, value); } +}; + +/** + * A move-only C++ wrapper around a HAL simulator device handle. + */ +class SimDevice { + public: + /** + * Direction of a simulated value (from the perspective of user code). + */ + enum Direction { + kInput = HAL_SimValueInput, + kOutput = HAL_SimValueOutput, + kBidir = HAL_SimValueBidir + }; + + /** + * Default constructor that results in an "empty" object that is false in + * a boolean context. + */ + SimDevice() = default; + + /** + * Creates a simulated device. + * + * The device name must be unique. Returns null if the device name + * already exists. If multiple instances of the same device are desired, + * recommend appending the instance/unique identifier in brackets to the base + * name, e.g. "device[1]". + * + * Using a device name of the form "Type:Name" will create a WebSockets node + * with a type value of "Type" and a device value of "Name" + * + * If not in simulation, results in an "empty" object that evaluates to false + * in a boolean context. + * + * @param name device name + */ + explicit SimDevice(const char* name) : m_handle(HAL_CreateSimDevice(name)) {} + + /** + * Creates a simulated device. + * + * The device name must be unique. Returns null if the device name + * already exists. This is a convenience method that appends index in + * brackets to the device name, e.g. passing index=1 results in "device[1]" + * for the device name. + * + * Using a device name of the form "Type:Name" will create a WebSockets node + * with a type value of "Type" and a device value of "Name" + * + * If not in simulation, results in an "empty" object that evaluates to false + * in a boolean context. + * + * @param name device name + * @param index device index number to append to name + */ + SimDevice(const char* name, int index); + + /** + * Creates a simulated device. + * + * The device name must be unique. Returns null if the device name + * already exists. This is a convenience method that appends index and + * channel in brackets to the device name, e.g. passing index=1 and channel=2 + * results in "device[1,2]" for the device name. + * + * Using a device name of the form "Type:Name" will create a WebSockets node + * with a type value of "Type" and a device value of "Name" + * + * If not in simulation, results in an "empty" object that evaluates to false + * in a boolean context. + * + * @param name device name + * @param index device index number to append to name + * @param channel device channel number to append to name + */ + SimDevice(const char* name, int index, int channel); + + ~SimDevice() { + if (m_handle != HAL_kInvalidHandle) { + HAL_FreeSimDevice(m_handle); + } + } + + SimDevice(const SimDevice&) = delete; + SimDevice& operator=(const SimDevice&) = delete; + + SimDevice(SimDevice&& rhs) : m_handle(rhs.m_handle) { + rhs.m_handle = HAL_kInvalidHandle; + } + + SimDevice& operator=(SimDevice&& rhs) { + m_handle = rhs.m_handle; + rhs.m_handle = HAL_kInvalidHandle; + return *this; + } + + /** + * Determine if handle is empty. Should be used to optimize out code paths + * that are taken/not taken in simulation. + * + * @return False if handle is empty, true if handle is valid. + */ + explicit operator bool() const { return m_handle != HAL_kInvalidHandle; } + + /** + * Get the internal device handle. + * + * @return internal handle + */ + operator HAL_SimDeviceHandle() const { return m_handle; } // NOLINT + + /** + * Get the name of the simulated device. + * + * @return name + */ + std::string GetName() const { + return std::string(HAL_GetSimDeviceName(m_handle)); + } + + /** + * Creates a value on the simulated device. + * + * If not in simulation, results in an "empty" object that evaluates to false + * in a boolean context. + * + * @param name value name + * @param direction input/output/bidir (from perspective of user code) + * @param initialValue initial value + * @return simulated value object + */ + SimValue CreateValue(const char* name, int32_t direction, + const HAL_Value& initialValue) { + return HAL_CreateSimValue(m_handle, name, direction, &initialValue); + } + + /** + * Creates an int value on the simulated device. + * + * If not in simulation, results in an "empty" object that evaluates to false + * in a boolean context. + * + * @param name value name + * @param direction input/output/bidir (from perspective of user code) + * @param initialValue initial value + * @return simulated double value object + */ + SimInt CreateInt(const char* name, int32_t direction, int32_t initialValue) { + return HAL_CreateSimValueInt(m_handle, name, direction, initialValue); + } + + /** + * Creates a long value on the simulated device. + * + * If not in simulation, results in an "empty" object that evaluates to false + * in a boolean context. + * + * @param name value name + * @param direction input/output/bidir (from perspective of user code) + * @param initialValue initial value + * @return simulated double value object + */ + SimLong CreateLong(const char* name, int32_t direction, + int64_t initialValue) { + return HAL_CreateSimValueLong(m_handle, name, direction, initialValue); + } + + /** + * Creates a double value on the simulated device. + * + * If not in simulation, results in an "empty" object that evaluates to false + * in a boolean context. + * + * @param name value name + * @param direction input/output/bidir (from perspective of user code) + * @param initialValue initial value + * @return simulated double value object + */ + SimDouble CreateDouble(const char* name, int32_t direction, + double initialValue) { + return HAL_CreateSimValueDouble(m_handle, name, direction, initialValue); + } + + /** + * Creates an enumerated value on the simulated device. + * + * Enumerated values are always in the range 0 to numOptions-1. + * + * If not in simulation, results in an "empty" object that evaluates to false + * in a boolean context. + * + * @param name value name + * @param direction input/output/bidir (from perspective of user code) + * @param options array of option descriptions + * @param initialValue initial value (selection) + * @return simulated enum value object + */ + SimEnum CreateEnum(const char* name, int32_t direction, + std::initializer_list options, + int32_t initialValue) { + return HAL_CreateSimValueEnum(m_handle, name, direction, options.size(), + const_cast(options.begin()), + initialValue); + } + + /** + * Creates an enumerated value on the simulated device. + * + * Enumerated values are always in the range 0 to numOptions-1. + * + * If not in simulation, results in an "empty" object that evaluates to false + * in a boolean context. + * + * @param name value name + * @param direction input/output/bidir (from perspective of user code) + * @param options array of option descriptions + * @param initialValue initial value (selection) + * @return simulated enum value object + */ + SimEnum CreateEnum(const char* name, int32_t direction, + std::span options, + int32_t initialValue) { + return HAL_CreateSimValueEnum(m_handle, name, direction, options.size(), + const_cast(options.data()), + initialValue); + } + + /** + * Creates an enumerated value on the simulated device with double values. + * + * Enumerated values are always in the range 0 to numOptions-1. + * + * If not in simulation, results in an "empty" object that evaluates to false + * in a boolean context. + * + * @param name value name + * @param direction input/output/bidir (from perspective of user code) + * @param options array of option descriptions + * @param optionValues array of option values (must be the same size as + * options) + * @param initialValue initial value (selection) + * @return simulated enum value object + */ + SimEnum CreateEnumDouble(const char* name, int32_t direction, + std::initializer_list options, + std::initializer_list optionValues, + int32_t initialValue) { + if (options.size() != optionValues.size()) { + return {}; + } + return HAL_CreateSimValueEnumDouble( + m_handle, name, direction, options.size(), + const_cast(options.begin()), optionValues.begin(), + initialValue); + } + + /** + * Creates an enumerated value on the simulated device with double values. + * + * Enumerated values are always in the range 0 to numOptions-1. + * + * If not in simulation, results in an "empty" object that evaluates to false + * in a boolean context. + * + * @param name value name + * @param direction input/output/bidir (from perspective of user code) + * @param options array of option descriptions + * @param optionValues array of option values (must be the same size as + * options) + * @param initialValue initial value (selection) + * @return simulated enum value object + */ + SimEnum CreateEnumDouble(const char* name, int32_t direction, + std::span options, + std::span optionValues, + int32_t initialValue) { + if (options.size() != optionValues.size()) { + return {}; + } + return HAL_CreateSimValueEnumDouble( + m_handle, name, direction, options.size(), + const_cast(options.data()), optionValues.data(), + initialValue); + } + + /** + * Creates a boolean value on the simulated device. + * + * If not in simulation, results in an "empty" object that evaluates to false + * in a boolean context. + * + * @param name value name + * @param direction input/output/bidir (from perspective of user code) + * @param initialValue initial value + * @return simulated boolean value object + */ + SimBoolean CreateBoolean(const char* name, int32_t direction, + bool initialValue) { + return HAL_CreateSimValueBoolean(m_handle, name, direction, initialValue); + } + + protected: + HAL_SimDeviceHandle m_handle = HAL_kInvalidHandle; +}; + +} // namespace wpi::hal diff --git a/hal/src/main/native/include/wpi/hal/Types.h b/hal/src/main/native/include/wpi/hal/Types.h index 5f332ffa5e..856f3aa038 100644 --- a/hal/src/main/native/include/wpi/hal/Types.h +++ b/hal/src/main/native/include/wpi/hal/Types.h @@ -89,75 +89,4 @@ typedef int32_t HAL_Bool; #define HAL_ENUM(name) HAL_ENUM_WITH_UNDERLYING_TYPE(name, int32_t) -#ifdef __cplusplus -namespace wpi::hal { -/** - * A move-only C++ wrapper around a HAL handle. - * Will free the handle if FreeFunction is provided - */ -template -class Handle { - public: - Handle() = default; - /*implicit*/ Handle(CType val) : m_handle(val) {} // NOLINT - - Handle(const Handle&) = delete; - Handle& operator=(const Handle&) = delete; - - Handle(Handle&& rhs) : m_handle(rhs.m_handle) { rhs.m_handle = CInvalid; } - - Handle& operator=(Handle&& rhs) { - if (this != &rhs) { -// FIXME: GCC gives the false positive "the address of will never -// be NULL" because it doesn't realize the default template parameter can make -// GetDefault nullptr. Fixed in GCC 13. -// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94554 -// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105885 -#if __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Waddress" -#endif // __GNUC__ - if constexpr (FreeFunction != nullptr) { -#if __GNUC__ -#pragma GCC diagnostic pop -#endif // __GNUC__ - if (m_handle != CInvalid) { - FreeFunction(m_handle); - } - } - } - m_handle = rhs.m_handle; - rhs.m_handle = CInvalid; - return *this; - } - - ~Handle() { -// FIXME: GCC gives the false positive "the address of will never -// be NULL" because it doesn't realize the default template parameter can make -// GetDefault nullptr. Fixed in GCC 13. -// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94554 -// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105885 -#if __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Waddress" -#endif // __GNUC__ - if constexpr (FreeFunction != nullptr) { -#if __GNUC__ -#pragma GCC diagnostic pop -#endif // __GNUC__ - if (m_handle != CInvalid) { - FreeFunction(m_handle); - } - } - } - - operator CType() const { return m_handle; } // NOLINT - - private: - CType m_handle = CInvalid; -}; - -} // namespace wpi::hal -#endif /** @} */ diff --git a/hal/src/main/native/include/wpi/hal/Types.hpp b/hal/src/main/native/include/wpi/hal/Types.hpp new file mode 100644 index 0000000000..76c17acb5a --- /dev/null +++ b/hal/src/main/native/include/wpi/hal/Types.hpp @@ -0,0 +1,77 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#pragma once + +#include "wpi/hal/Types.h" + +namespace wpi::hal { +/** + * A move-only C++ wrapper around a HAL handle. + * Will free the handle if FreeFunction is provided + */ +template +class Handle { + public: + Handle() = default; + /*implicit*/ Handle(CType val) : m_handle(val) {} // NOLINT + + Handle(const Handle&) = delete; + Handle& operator=(const Handle&) = delete; + + Handle(Handle&& rhs) : m_handle(rhs.m_handle) { rhs.m_handle = CInvalid; } + + Handle& operator=(Handle&& rhs) { + if (this != &rhs) { +// FIXME: GCC gives the false positive "the address of will never +// be NULL" because it doesn't realize the default template parameter can make +// GetDefault nullptr. Fixed in GCC 13. +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94554 +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105885 +#if __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Waddress" +#endif // __GNUC__ + if constexpr (FreeFunction != nullptr) { +#if __GNUC__ +#pragma GCC diagnostic pop +#endif // __GNUC__ + if (m_handle != CInvalid) { + FreeFunction(m_handle); + } + } + } + m_handle = rhs.m_handle; + rhs.m_handle = CInvalid; + return *this; + } + + ~Handle() { +// FIXME: GCC gives the false positive "the address of will never +// be NULL" because it doesn't realize the default template parameter can make +// GetDefault nullptr. Fixed in GCC 13. +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94554 +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105885 +#if __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Waddress" +#endif // __GNUC__ + if constexpr (FreeFunction != nullptr) { +#if __GNUC__ +#pragma GCC diagnostic pop +#endif // __GNUC__ + if (m_handle != CInvalid) { + FreeFunction(m_handle); + } + } + } + + operator CType() const { return m_handle; } // NOLINT + + private: + CType m_handle = CInvalid; +}; + +} // namespace wpi::hal diff --git a/hal/src/main/native/include/wpi/hal/UsageReporting.h b/hal/src/main/native/include/wpi/hal/UsageReporting.h index 6927057e65..c33b3fe58f 100644 --- a/hal/src/main/native/include/wpi/hal/UsageReporting.h +++ b/hal/src/main/native/include/wpi/hal/UsageReporting.h @@ -6,10 +6,6 @@ #include -#ifdef __cplusplus -#include -#endif - #include "wpi/util/string.h" #ifdef __cplusplus @@ -31,32 +27,3 @@ void HAL_ReportUsage(const struct WPI_String* resource, #ifdef __cplusplus } // extern "C" #endif - -#ifdef __cplusplus -/** - * Reports usage of a resource of interest. Repeated calls for the same - * resource name replace the previous report. - * - * @param resource the used resource name; convention is to suffix with - * "[instanceNum]" for multiple instances of the same - * resource - * @param data arbitrary associated data string - */ -inline void HAL_ReportUsage(std::string_view resource, std::string_view data) { - WPI_String resourceStr = wpi::util::make_string(resource); - WPI_String dataStr = wpi::util::make_string(data); - HAL_ReportUsage(&resourceStr, &dataStr); -} - -/** - * Reports usage of a resource of interest. Repeated calls for the same - * resource name replace the previous report. - * - * @param resource the used resource name - * @param instanceNumber an index that identifies the resource instance - * @param data arbitrary associated data string - */ -void HAL_ReportUsage(std::string_view resource, int instanceNumber, - std::string_view data); - -#endif diff --git a/hal/src/main/native/include/wpi/hal/UsageReporting.hpp b/hal/src/main/native/include/wpi/hal/UsageReporting.hpp new file mode 100644 index 0000000000..b6707179b6 --- /dev/null +++ b/hal/src/main/native/include/wpi/hal/UsageReporting.hpp @@ -0,0 +1,35 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#pragma once + +#include + +#include "wpi/hal/UsageReporting.h" + +/** + * Reports usage of a resource of interest. Repeated calls for the same + * resource name replace the previous report. + * + * @param resource the used resource name; convention is to suffix with + * "[instanceNum]" for multiple instances of the same + * resource + * @param data arbitrary associated data string + */ +inline void HAL_ReportUsage(std::string_view resource, std::string_view data) { + WPI_String resourceStr = wpi::util::make_string(resource); + WPI_String dataStr = wpi::util::make_string(data); + HAL_ReportUsage(&resourceStr, &dataStr); +} + +/** + * Reports usage of a resource of interest. Repeated calls for the same + * resource name replace the previous report. + * + * @param resource the used resource name + * @param instanceNumber an index that identifies the resource instance + * @param data arbitrary associated data string + */ +void HAL_ReportUsage(std::string_view resource, int instanceNumber, + std::string_view data); diff --git a/hal/src/main/native/include/wpi/hal/cpp/fpga_clock.h b/hal/src/main/native/include/wpi/hal/cpp/fpga_clock.hpp similarity index 100% rename from hal/src/main/native/include/wpi/hal/cpp/fpga_clock.h rename to hal/src/main/native/include/wpi/hal/cpp/fpga_clock.hpp diff --git a/hal/src/main/native/include/wpi/hal/handles/DigitalHandleResource.h b/hal/src/main/native/include/wpi/hal/handles/DigitalHandleResource.hpp similarity index 98% rename from hal/src/main/native/include/wpi/hal/handles/DigitalHandleResource.h rename to hal/src/main/native/include/wpi/hal/handles/DigitalHandleResource.hpp index c5e9d85788..06be830c8d 100644 --- a/hal/src/main/native/include/wpi/hal/handles/DigitalHandleResource.h +++ b/hal/src/main/native/include/wpi/hal/handles/DigitalHandleResource.hpp @@ -11,7 +11,7 @@ #include "wpi/hal/Errors.h" #include "wpi/hal/Types.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/util/mutex.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/include/wpi/hal/handles/HandlesInternal.h b/hal/src/main/native/include/wpi/hal/handles/HandlesInternal.hpp similarity index 100% rename from hal/src/main/native/include/wpi/hal/handles/HandlesInternal.h rename to hal/src/main/native/include/wpi/hal/handles/HandlesInternal.hpp diff --git a/hal/src/main/native/include/wpi/hal/handles/IndexedClassedHandleResource.h b/hal/src/main/native/include/wpi/hal/handles/IndexedClassedHandleResource.hpp similarity index 98% rename from hal/src/main/native/include/wpi/hal/handles/IndexedClassedHandleResource.h rename to hal/src/main/native/include/wpi/hal/handles/IndexedClassedHandleResource.hpp index 76294efe6d..01a1349a9b 100644 --- a/hal/src/main/native/include/wpi/hal/handles/IndexedClassedHandleResource.h +++ b/hal/src/main/native/include/wpi/hal/handles/IndexedClassedHandleResource.hpp @@ -8,11 +8,10 @@ #include #include -#include #include "wpi/hal/Errors.h" #include "wpi/hal/Types.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/util/mutex.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/include/wpi/hal/handles/IndexedHandleResource.h b/hal/src/main/native/include/wpi/hal/handles/IndexedHandleResource.hpp similarity index 98% rename from hal/src/main/native/include/wpi/hal/handles/IndexedHandleResource.h rename to hal/src/main/native/include/wpi/hal/handles/IndexedHandleResource.hpp index 51d64507a9..819294037d 100644 --- a/hal/src/main/native/include/wpi/hal/handles/IndexedHandleResource.h +++ b/hal/src/main/native/include/wpi/hal/handles/IndexedHandleResource.hpp @@ -11,7 +11,7 @@ #include "wpi/hal/Errors.h" #include "wpi/hal/Types.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/util/mutex.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/include/wpi/hal/handles/LimitedClassedHandleResource.h b/hal/src/main/native/include/wpi/hal/handles/LimitedClassedHandleResource.hpp similarity index 98% rename from hal/src/main/native/include/wpi/hal/handles/LimitedClassedHandleResource.h rename to hal/src/main/native/include/wpi/hal/handles/LimitedClassedHandleResource.hpp index 77dd4d2034..55fda70461 100644 --- a/hal/src/main/native/include/wpi/hal/handles/LimitedClassedHandleResource.h +++ b/hal/src/main/native/include/wpi/hal/handles/LimitedClassedHandleResource.hpp @@ -10,7 +10,7 @@ #include #include "wpi/hal/Types.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/util/mutex.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/include/wpi/hal/handles/LimitedHandleResource.h b/hal/src/main/native/include/wpi/hal/handles/LimitedHandleResource.hpp similarity index 98% rename from hal/src/main/native/include/wpi/hal/handles/LimitedHandleResource.h rename to hal/src/main/native/include/wpi/hal/handles/LimitedHandleResource.hpp index b54e355d94..7847043b54 100644 --- a/hal/src/main/native/include/wpi/hal/handles/LimitedHandleResource.h +++ b/hal/src/main/native/include/wpi/hal/handles/LimitedHandleResource.hpp @@ -9,8 +9,8 @@ #include #include -#include "HandlesInternal.h" #include "wpi/hal/Types.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/util/mutex.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/include/wpi/hal/handles/UnlimitedHandleResource.h b/hal/src/main/native/include/wpi/hal/handles/UnlimitedHandleResource.hpp similarity index 98% rename from hal/src/main/native/include/wpi/hal/handles/UnlimitedHandleResource.h rename to hal/src/main/native/include/wpi/hal/handles/UnlimitedHandleResource.hpp index ec21662bd5..9c78f10692 100644 --- a/hal/src/main/native/include/wpi/hal/handles/UnlimitedHandleResource.h +++ b/hal/src/main/native/include/wpi/hal/handles/UnlimitedHandleResource.hpp @@ -11,7 +11,7 @@ #include #include "wpi/hal/Types.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/util/mutex.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/include/wpi/hal/simulation/CanData.h b/hal/src/main/native/include/wpi/hal/simulation/CanData.h index 20acb344d5..ccca1174f4 100644 --- a/hal/src/main/native/include/wpi/hal/simulation/CanData.h +++ b/hal/src/main/native/include/wpi/hal/simulation/CanData.h @@ -5,8 +5,6 @@ #pragma once #include "wpi/hal/Types.h" -#include "wpi/hal/Value.h" -#include "wpi/hal/simulation/NotifyListener.h" typedef void (*HAL_CAN_SendMessageCallback)( const char* name, void* param, int32_t busId, uint32_t messageId, diff --git a/hal/src/main/native/include/wpi/hal/simulation/MockHooks.h b/hal/src/main/native/include/wpi/hal/simulation/MockHooks.h index 2e900730b3..bc1b1dbf67 100644 --- a/hal/src/main/native/include/wpi/hal/simulation/MockHooks.h +++ b/hal/src/main/native/include/wpi/hal/simulation/MockHooks.h @@ -47,16 +47,4 @@ void HALSIM_CancelAllSimPeriodicCallbacks(void); #ifdef __cplusplus } // extern "C" - -namespace wpi::hal::sim { -inline void SetProgramState(const ControlWord& controlWord) { - HALSIM_SetProgramState(controlWord.GetValue()); -} - -inline ControlWord GetProgramState() { - HAL_ControlWord word; - HALSIM_GetProgramState(&word); - return ControlWord{word}; -} -} // namespace wpi::hal::sim -#endif // __cplusplus +#endif diff --git a/hal/src/main/native/include/wpi/hal/simulation/MockHooks.hpp b/hal/src/main/native/include/wpi/hal/simulation/MockHooks.hpp new file mode 100644 index 0000000000..9b73ef6b79 --- /dev/null +++ b/hal/src/main/native/include/wpi/hal/simulation/MockHooks.hpp @@ -0,0 +1,20 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#pragma once + +#include "wpi/hal/DriverStationTypes.hpp" +#include "wpi/hal/simulation/MockHooks.h" + +namespace wpi::hal::sim { +inline void SetProgramState(const ControlWord& controlWord) { + HALSIM_SetProgramState(controlWord.GetValue()); +} + +inline ControlWord GetProgramState() { + HAL_ControlWord word; + HALSIM_GetProgramState(&word); + return ControlWord{word}; +} +} // namespace wpi::hal::sim diff --git a/hal/src/main/native/include/wpi/hal/simulation/NotifyListener.h b/hal/src/main/native/include/wpi/hal/simulation/NotifyListener.h index a2b3e18ffb..18f9ad1e77 100644 --- a/hal/src/main/native/include/wpi/hal/simulation/NotifyListener.h +++ b/hal/src/main/native/include/wpi/hal/simulation/NotifyListener.h @@ -15,23 +15,3 @@ typedef void (*HAL_BufferCallback)(const char* name, void* param, typedef void (*HAL_ConstBufferCallback)(const char* name, void* param, const unsigned char* buffer, unsigned int count); - -#ifdef __cplusplus - -namespace wpi::hal { - -template -struct HalCallbackListener { - HalCallbackListener() = default; - HalCallbackListener(void* param_, CallbackFunction callback_) - : callback(callback_), param(param_) {} - - explicit operator bool() const { return callback != nullptr; } - - CallbackFunction callback = nullptr; - void* param = nullptr; -}; - -} // namespace wpi::hal - -#endif diff --git a/hal/src/main/native/include/wpi/hal/simulation/NotifyListener.hpp b/hal/src/main/native/include/wpi/hal/simulation/NotifyListener.hpp new file mode 100644 index 0000000000..60d58f4025 --- /dev/null +++ b/hal/src/main/native/include/wpi/hal/simulation/NotifyListener.hpp @@ -0,0 +1,23 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#pragma once + +#include "wpi/hal/simulation/NotifyListener.h" + +namespace wpi::hal { + +template +struct HalCallbackListener { + HalCallbackListener() = default; + HalCallbackListener(void* param_, CallbackFunction callback_) + : callback(callback_), param(param_) {} + + explicit operator bool() const { return callback != nullptr; } + + CallbackFunction callback = nullptr; + void* param = nullptr; +}; + +} // namespace wpi::hal diff --git a/hal/src/main/native/include/wpi/hal/simulation/SimCallbackRegistry.h b/hal/src/main/native/include/wpi/hal/simulation/SimCallbackRegistry.hpp similarity index 99% rename from hal/src/main/native/include/wpi/hal/simulation/SimCallbackRegistry.h rename to hal/src/main/native/include/wpi/hal/simulation/SimCallbackRegistry.hpp index 5518eb2cb0..50988f2b10 100644 --- a/hal/src/main/native/include/wpi/hal/simulation/SimCallbackRegistry.h +++ b/hal/src/main/native/include/wpi/hal/simulation/SimCallbackRegistry.hpp @@ -7,7 +7,7 @@ #include #include -#include "wpi/hal/simulation/NotifyListener.h" +#include "wpi/hal/simulation/NotifyListener.hpp" #include "wpi/util/Compiler.hpp" #include "wpi/util/UidVector.hpp" #include "wpi/util/spinlock.hpp" diff --git a/hal/src/main/native/include/wpi/hal/simulation/SimDataValue.h b/hal/src/main/native/include/wpi/hal/simulation/SimDataValue.hpp similarity index 99% rename from hal/src/main/native/include/wpi/hal/simulation/SimDataValue.h rename to hal/src/main/native/include/wpi/hal/simulation/SimDataValue.hpp index 85daa674fb..d6e84ad8f3 100644 --- a/hal/src/main/native/include/wpi/hal/simulation/SimDataValue.h +++ b/hal/src/main/native/include/wpi/hal/simulation/SimDataValue.hpp @@ -4,12 +4,11 @@ #pragma once -#include +#include #include "wpi/hal/simulation/NotifyListener.h" -#include "wpi/hal/simulation/SimCallbackRegistry.h" +#include "wpi/hal/simulation/SimCallbackRegistry.hpp" #include "wpi/util/Compiler.hpp" -#include "wpi/util/UidVector.hpp" #include "wpi/util/spinlock.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/sim/AddressableLED.cpp b/hal/src/main/native/sim/AddressableLED.cpp index a6c561ee19..fb758cd68c 100644 --- a/hal/src/main/native/sim/AddressableLED.cpp +++ b/hal/src/main/native/sim/AddressableLED.cpp @@ -6,14 +6,13 @@ #include -#include "DigitalInternal.h" -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "mockdata/AddressableLEDDataInternal.h" +#include "DigitalInternal.hpp" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "mockdata/AddressableLEDDataInternal.hpp" #include "wpi/hal/Errors.h" -#include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/handles/IndexedHandleResource.h" +#include "wpi/hal/handles/HandlesInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/Alert.cpp b/hal/src/main/native/sim/Alert.cpp index 6d0d3785b5..b8dc00a079 100644 --- a/hal/src/main/native/sim/Alert.cpp +++ b/hal/src/main/native/sim/Alert.cpp @@ -9,11 +9,11 @@ #include #include -#include "HALInitializer.h" +#include "HALInitializer.hpp" #include "wpi/hal/Errors.h" #include "wpi/hal/HALBase.h" #include "wpi/hal/Types.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/hal/simulation/AlertData.h" #include "wpi/util/mutex.hpp" #include "wpi/util/string.h" diff --git a/hal/src/main/native/sim/AnalogInput.cpp b/hal/src/main/native/sim/AnalogInput.cpp index 6a727f54b6..abbd0ffe97 100644 --- a/hal/src/main/native/sim/AnalogInput.cpp +++ b/hal/src/main/native/sim/AnalogInput.cpp @@ -4,12 +4,11 @@ #include "wpi/hal/AnalogInput.h" -#include "AnalogInternal.h" -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "mockdata/AnalogInDataInternal.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "AnalogInternal.hpp" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "mockdata/AnalogInDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/AnalogInternal.cpp b/hal/src/main/native/sim/AnalogInternal.cpp index cac52acd65..0919280f2b 100644 --- a/hal/src/main/native/sim/AnalogInternal.cpp +++ b/hal/src/main/native/sim/AnalogInternal.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "AnalogInternal.h" +#include "AnalogInternal.hpp" -#include "PortsInternal.h" -#include "wpi/hal/handles/IndexedHandleResource.h" +#include "PortsInternal.hpp" +#include "wpi/hal/handles/IndexedHandleResource.hpp" namespace wpi::hal { IndexedHandleResource -#include "PortsInternal.h" -#include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/handles/IndexedHandleResource.h" +#include "PortsInternal.hpp" +#include "wpi/hal/handles/HandlesInternal.hpp" +#include "wpi/hal/handles/IndexedHandleResource.hpp" namespace wpi::hal { constexpr int32_t kTimebase = 40000000; ///< 40 MHz clock diff --git a/hal/src/main/native/sim/CAN.cpp b/hal/src/main/native/sim/CAN.cpp index d7ad4c8e02..e9e1086b29 100644 --- a/hal/src/main/native/sim/CAN.cpp +++ b/hal/src/main/native/sim/CAN.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/CAN.h" -#include "mockdata/CanDataInternal.h" +#include "mockdata/CanDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/CANAPI.cpp b/hal/src/main/native/sim/CANAPI.cpp index fb861c3a60..0f5e4907f7 100644 --- a/hal/src/main/native/sim/CANAPI.cpp +++ b/hal/src/main/native/sim/CANAPI.cpp @@ -7,11 +7,11 @@ #include #include -#include "HALInitializer.h" -#include "PortsInternal.h" +#include "HALInitializer.hpp" +#include "PortsInternal.hpp" #include "wpi/hal/CAN.h" #include "wpi/hal/Errors.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/util/DenseMap.hpp" #include "wpi/util/mutex.hpp" #include "wpi/util/timestamp.h" diff --git a/hal/src/main/native/sim/CANAPIInternal.h b/hal/src/main/native/sim/CANAPIInternal.hpp similarity index 100% rename from hal/src/main/native/sim/CANAPIInternal.h rename to hal/src/main/native/sim/CANAPIInternal.hpp diff --git a/hal/src/main/native/sim/CTREPCM.cpp b/hal/src/main/native/sim/CTREPCM.cpp index 905134d3a2..2e9a543da7 100644 --- a/hal/src/main/native/sim/CTREPCM.cpp +++ b/hal/src/main/native/sim/CTREPCM.cpp @@ -6,12 +6,12 @@ #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "mockdata/CTREPCMDataInternal.h" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "mockdata/CTREPCMDataInternal.hpp" #include "wpi/hal/Errors.h" -#include "wpi/hal/handles/IndexedHandleResource.h" +#include "wpi/hal/handles/IndexedHandleResource.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/Constants.cpp b/hal/src/main/native/sim/Constants.cpp index 795544e637..e44fdad764 100644 --- a/hal/src/main/native/sim/Constants.cpp +++ b/hal/src/main/native/sim/Constants.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/Constants.h" -#include "ConstantsInternal.h" +#include "ConstantsInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/ConstantsInternal.h b/hal/src/main/native/sim/ConstantsInternal.hpp similarity index 100% rename from hal/src/main/native/sim/ConstantsInternal.h rename to hal/src/main/native/sim/ConstantsInternal.hpp diff --git a/hal/src/main/native/sim/Counter.cpp b/hal/src/main/native/sim/Counter.cpp index a146e1859a..9e71af126c 100644 --- a/hal/src/main/native/sim/Counter.cpp +++ b/hal/src/main/native/sim/Counter.cpp @@ -4,11 +4,11 @@ #include "wpi/hal/Counter.h" -#include "CounterInternal.h" -#include "HALInitializer.h" -#include "PortsInternal.h" -#include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/handles/LimitedHandleResource.h" +#include "CounterInternal.hpp" +#include "HALInitializer.hpp" +#include "PortsInternal.hpp" +#include "wpi/hal/handles/HandlesInternal.hpp" +#include "wpi/hal/handles/LimitedHandleResource.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/sim/CounterInternal.h b/hal/src/main/native/sim/CounterInternal.hpp similarity index 77% rename from hal/src/main/native/sim/CounterInternal.h rename to hal/src/main/native/sim/CounterInternal.hpp index c779483b1f..8e2054d423 100644 --- a/hal/src/main/native/sim/CounterInternal.h +++ b/hal/src/main/native/sim/CounterInternal.hpp @@ -4,9 +4,9 @@ #pragma once -#include "PortsInternal.h" -#include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/handles/LimitedHandleResource.h" +#include "PortsInternal.hpp" +#include "wpi/hal/handles/HandlesInternal.hpp" +#include "wpi/hal/handles/LimitedHandleResource.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/sim/DIO.cpp b/hal/src/main/native/sim/DIO.cpp index 3de7d27422..2632f82c73 100644 --- a/hal/src/main/native/sim/DIO.cpp +++ b/hal/src/main/native/sim/DIO.cpp @@ -4,14 +4,14 @@ #include "wpi/hal/DIO.h" -#include "DigitalInternal.h" -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "mockdata/DIODataInternal.h" -#include "mockdata/DigitalPWMDataInternal.h" -#include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/handles/LimitedHandleResource.h" +#include "DigitalInternal.hpp" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "mockdata/DIODataInternal.hpp" +#include "mockdata/DigitalPWMDataInternal.hpp" +#include "wpi/hal/handles/HandlesInternal.hpp" +#include "wpi/hal/handles/LimitedHandleResource.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/DigitalInternal.cpp b/hal/src/main/native/sim/DigitalInternal.cpp index 5fd9c75390..8c9337320c 100644 --- a/hal/src/main/native/sim/DigitalInternal.cpp +++ b/hal/src/main/native/sim/DigitalInternal.cpp @@ -2,12 +2,12 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "DigitalInternal.h" +#include "DigitalInternal.hpp" -#include "PortsInternal.h" +#include "PortsInternal.hpp" #include "wpi/hal/Errors.h" -#include "wpi/hal/handles/DigitalHandleResource.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/DigitalHandleResource.hpp" +#include "wpi/hal/handles/HandlesInternal.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/sim/DigitalInternal.h b/hal/src/main/native/sim/DigitalInternal.hpp similarity index 95% rename from hal/src/main/native/sim/DigitalInternal.h rename to hal/src/main/native/sim/DigitalInternal.hpp index 1be867bf96..39b1ac28dc 100644 --- a/hal/src/main/native/sim/DigitalInternal.h +++ b/hal/src/main/native/sim/DigitalInternal.hpp @@ -8,8 +8,8 @@ #include -#include "PortsInternal.h" -#include "wpi/hal/handles/DigitalHandleResource.h" +#include "PortsInternal.hpp" +#include "wpi/hal/handles/DigitalHandleResource.hpp" namespace wpi::hal { /** diff --git a/hal/src/main/native/sim/DriverStation.cpp b/hal/src/main/native/sim/DriverStation.cpp index f583a3d62c..8bfbb7c9bb 100644 --- a/hal/src/main/native/sim/DriverStation.cpp +++ b/hal/src/main/native/sim/DriverStation.cpp @@ -16,11 +16,11 @@ #include -#include "HALInitializer.h" -#include "mockdata/DriverStationDataInternal.h" +#include "HALInitializer.hpp" +#include "mockdata/DriverStationDataInternal.hpp" #include "wpi/hal/DriverStationTypes.h" #include "wpi/hal/Errors.h" -#include "wpi/hal/cpp/fpga_clock.h" +#include "wpi/hal/cpp/fpga_clock.hpp" #include "wpi/hal/simulation/MockHooks.h" #include "wpi/util/EventVector.hpp" #include "wpi/util/mutex.hpp" diff --git a/hal/src/main/native/sim/DutyCycle.cpp b/hal/src/main/native/sim/DutyCycle.cpp index 0dc0658ca3..86277e226f 100644 --- a/hal/src/main/native/sim/DutyCycle.cpp +++ b/hal/src/main/native/sim/DutyCycle.cpp @@ -6,13 +6,13 @@ #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "mockdata/DutyCycleDataInternal.h" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "mockdata/DutyCycleDataInternal.hpp" #include "wpi/hal/Errors.h" -#include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/handles/IndexedHandleResource.h" +#include "wpi/hal/handles/HandlesInternal.hpp" +#include "wpi/hal/handles/IndexedHandleResource.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/Encoder.cpp b/hal/src/main/native/sim/Encoder.cpp index 41f88704df..220504df81 100644 --- a/hal/src/main/native/sim/Encoder.cpp +++ b/hal/src/main/native/sim/Encoder.cpp @@ -6,14 +6,14 @@ #include -#include "CounterInternal.h" -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "mockdata/EncoderDataInternal.h" +#include "CounterInternal.hpp" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "mockdata/EncoderDataInternal.hpp" #include "wpi/hal/Errors.h" -#include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/handles/LimitedHandleResource.h" +#include "wpi/hal/handles/HandlesInternal.hpp" +#include "wpi/hal/handles/LimitedHandleResource.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/HAL.cpp b/hal/src/main/native/sim/HAL.cpp index e38e99a4f5..7dcfa25c43 100644 --- a/hal/src/main/native/sim/HAL.cpp +++ b/hal/src/main/native/sim/HAL.cpp @@ -21,14 +21,14 @@ NtQueryTimerResolution(PULONG MinimumResolution, PULONG MaximumResolution, #endif // _WIN32 #include "ErrorsInternal.h" -#include "HALInitializer.h" -#include "MockHooksInternal.h" -#include "mockdata/RoboRioDataInternal.h" +#include "HALInitializer.hpp" +#include "MockHooksInternal.hpp" +#include "mockdata/RoboRioDataInternal.hpp" #include "wpi/hal/Errors.h" #include "wpi/hal/Extensions.h" -#include "wpi/hal/handles/HandlesInternal.h" #include "wpi/hal/simulation/DriverStationData.h" -#include "wpi/hal/simulation/SimCallbackRegistry.h" +#include "wpi/hal/simulation/MockHooks.h" +#include "wpi/hal/simulation/SimCallbackRegistry.hpp" #include "wpi/util/mutex.hpp" #include "wpi/util/spinlock.hpp" diff --git a/hal/src/main/native/sim/HALInitializer.cpp b/hal/src/main/native/sim/HALInitializer.cpp index 4312571b81..517b97e7cf 100644 --- a/hal/src/main/native/sim/HALInitializer.cpp +++ b/hal/src/main/native/sim/HALInitializer.cpp @@ -2,7 +2,7 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "HALInitializer.h" +#include "HALInitializer.hpp" #include "wpi/hal/HALBase.h" diff --git a/hal/src/main/native/sim/HALInitializer.h b/hal/src/main/native/sim/HALInitializer.hpp similarity index 100% rename from hal/src/main/native/sim/HALInitializer.h rename to hal/src/main/native/sim/HALInitializer.hpp diff --git a/hal/src/main/native/sim/HALInternal.h b/hal/src/main/native/sim/HALInternal.hpp similarity index 100% rename from hal/src/main/native/sim/HALInternal.h rename to hal/src/main/native/sim/HALInternal.hpp diff --git a/hal/src/main/native/sim/I2C.cpp b/hal/src/main/native/sim/I2C.cpp index 08e3d8914e..77fef4d5a4 100644 --- a/hal/src/main/native/sim/I2C.cpp +++ b/hal/src/main/native/sim/I2C.cpp @@ -4,8 +4,8 @@ #include "wpi/hal/I2C.h" -#include "HALInitializer.h" -#include "mockdata/I2CDataInternal.h" +#include "HALInitializer.hpp" +#include "mockdata/I2CDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/MockHooks.cpp b/hal/src/main/native/sim/MockHooks.cpp index ebe5fddb50..059f430932 100644 --- a/hal/src/main/native/sim/MockHooks.cpp +++ b/hal/src/main/native/sim/MockHooks.cpp @@ -2,14 +2,16 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include "wpi/hal/simulation/MockHooks.h" + #include #include #include #include #include -#include "MockHooksInternal.h" -#include "NotifierInternal.h" +#include "MockHooksInternal.hpp" +#include "NotifierInternal.hpp" #include "wpi/hal/simulation/NotifierData.h" #include "wpi/util/print.hpp" #include "wpi/util/timestamp.h" diff --git a/hal/src/main/native/sim/MockHooksInternal.h b/hal/src/main/native/sim/MockHooksInternal.hpp similarity index 91% rename from hal/src/main/native/sim/MockHooksInternal.h rename to hal/src/main/native/sim/MockHooksInternal.hpp index fafe25e939..0ebf0f29c5 100644 --- a/hal/src/main/native/sim/MockHooksInternal.h +++ b/hal/src/main/native/sim/MockHooksInternal.hpp @@ -6,8 +6,6 @@ #include -#include "wpi/hal/simulation/MockHooks.h" - namespace wpi::hal { void RestartTiming(); diff --git a/hal/src/main/native/sim/Notifier.cpp b/hal/src/main/native/sim/Notifier.cpp index 1eb5c0d723..231f019dbe 100644 --- a/hal/src/main/native/sim/Notifier.cpp +++ b/hal/src/main/native/sim/Notifier.cpp @@ -15,13 +15,13 @@ #include #include -#include "HALInitializer.h" -#include "NotifierInternal.h" +#include "HALInitializer.hpp" +#include "NotifierInternal.hpp" #include "wpi/hal/Errors.h" #include "wpi/hal/HALBase.h" #include "wpi/hal/Threads.h" #include "wpi/hal/Types.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/hal/simulation/NotifierData.h" #include "wpi/util/SafeThread.hpp" #include "wpi/util/SmallVector.hpp" diff --git a/hal/src/main/native/sim/NotifierInternal.h b/hal/src/main/native/sim/NotifierInternal.hpp similarity index 100% rename from hal/src/main/native/sim/NotifierInternal.h rename to hal/src/main/native/sim/NotifierInternal.hpp diff --git a/hal/src/main/native/sim/PWM.cpp b/hal/src/main/native/sim/PWM.cpp index 90ad3f2d89..35536618a3 100644 --- a/hal/src/main/native/sim/PWM.cpp +++ b/hal/src/main/native/sim/PWM.cpp @@ -4,16 +4,14 @@ #include "wpi/hal/PWM.h" -#include #include -#include "ConstantsInternal.h" -#include "DigitalInternal.h" -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "mockdata/PWMDataInternal.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "DigitalInternal.hpp" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "mockdata/PWMDataInternal.hpp" +#include "wpi/hal/handles/HandlesInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/Ports.cpp b/hal/src/main/native/sim/Ports.cpp index 28eed2bc27..ed2ff23ecc 100644 --- a/hal/src/main/native/sim/Ports.cpp +++ b/hal/src/main/native/sim/Ports.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/Ports.h" -#include "PortsInternal.h" +#include "PortsInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/PortsInternal.h b/hal/src/main/native/sim/PortsInternal.hpp similarity index 100% rename from hal/src/main/native/sim/PortsInternal.h rename to hal/src/main/native/sim/PortsInternal.hpp diff --git a/hal/src/main/native/sim/Power.cpp b/hal/src/main/native/sim/Power.cpp index 3434ed6b20..80fbf42c7d 100644 --- a/hal/src/main/native/sim/Power.cpp +++ b/hal/src/main/native/sim/Power.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/Power.h" -#include "mockdata/RoboRioDataInternal.h" +#include "mockdata/RoboRioDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/PowerDistribution.cpp b/hal/src/main/native/sim/PowerDistribution.cpp index df0de6e8c7..5aac878c32 100644 --- a/hal/src/main/native/sim/PowerDistribution.cpp +++ b/hal/src/main/native/sim/PowerDistribution.cpp @@ -6,11 +6,11 @@ #include -#include "CANAPIInternal.h" -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "mockdata/PowerDistributionDataInternal.h" +#include "CANAPIInternal.hpp" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "mockdata/PowerDistributionDataInternal.hpp" #include "wpi/hal/CANAPI.h" #include "wpi/hal/Errors.h" diff --git a/hal/src/main/native/sim/REVPH.cpp b/hal/src/main/native/sim/REVPH.cpp index 59591d7702..c0f2ad8cdf 100644 --- a/hal/src/main/native/sim/REVPH.cpp +++ b/hal/src/main/native/sim/REVPH.cpp @@ -6,12 +6,12 @@ #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "mockdata/REVPHDataInternal.h" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "mockdata/REVPHDataInternal.hpp" #include "wpi/hal/Errors.h" -#include "wpi/hal/handles/IndexedHandleResource.h" +#include "wpi/hal/handles/IndexedHandleResource.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/SerialPort.cpp b/hal/src/main/native/sim/SerialPort.cpp index 03cfed6c96..43c319687c 100644 --- a/hal/src/main/native/sim/SerialPort.cpp +++ b/hal/src/main/native/sim/SerialPort.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/SerialPort.h" -#include "HALInitializer.h" +#include "HALInitializer.hpp" namespace wpi::hal::init { void InitializeSerialPort() {} diff --git a/hal/src/main/native/sim/SimDevice.cpp b/hal/src/main/native/sim/SimDevice.cpp index 9e646abea6..d76afaaff4 100644 --- a/hal/src/main/native/sim/SimDevice.cpp +++ b/hal/src/main/native/sim/SimDevice.cpp @@ -2,12 +2,12 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "wpi/hal/SimDevice.h" +#include "wpi/hal/SimDevice.hpp" #include -#include "HALInitializer.h" -#include "mockdata/SimDeviceDataInternal.h" +#include "HALInitializer.hpp" +#include "mockdata/SimDeviceDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/AddressableLEDData.cpp b/hal/src/main/native/sim/mockdata/AddressableLEDData.cpp index 2c080bf9c3..00b1ff7381 100644 --- a/hal/src/main/native/sim/mockdata/AddressableLEDData.cpp +++ b/hal/src/main/native/sim/mockdata/AddressableLEDData.cpp @@ -2,11 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include #include -#include "../PortsInternal.h" -#include "AddressableLEDDataInternal.h" +#include "../PortsInternal.hpp" +#include "AddressableLEDDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/AddressableLEDDataInternal.h b/hal/src/main/native/sim/mockdata/AddressableLEDDataInternal.hpp similarity index 87% rename from hal/src/main/native/sim/mockdata/AddressableLEDDataInternal.h rename to hal/src/main/native/sim/mockdata/AddressableLEDDataInternal.hpp index b5ce234e52..dc7a86017b 100644 --- a/hal/src/main/native/sim/mockdata/AddressableLEDDataInternal.h +++ b/hal/src/main/native/sim/mockdata/AddressableLEDDataInternal.hpp @@ -4,11 +4,11 @@ #pragma once -#include +#include -#include "wpi/hal/simulation/AddressableLEDData.h" -#include "wpi/hal/simulation/SimCallbackRegistry.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/AddressableLEDTypes.h" +#include "wpi/hal/simulation/SimCallbackRegistry.hpp" +#include "wpi/hal/simulation/SimDataValue.hpp" #include "wpi/util/spinlock.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/sim/mockdata/AnalogInData.cpp b/hal/src/main/native/sim/mockdata/AnalogInData.cpp index a703c03211..4c062a363f 100644 --- a/hal/src/main/native/sim/mockdata/AnalogInData.cpp +++ b/hal/src/main/native/sim/mockdata/AnalogInData.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "../PortsInternal.h" -#include "AnalogInDataInternal.h" +#include "../PortsInternal.hpp" +#include "AnalogInDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/AnalogInDataInternal.h b/hal/src/main/native/sim/mockdata/AnalogInDataInternal.hpp similarity index 90% rename from hal/src/main/native/sim/mockdata/AnalogInDataInternal.h rename to hal/src/main/native/sim/mockdata/AnalogInDataInternal.hpp index 8a5ef935a9..9e4ce6a324 100644 --- a/hal/src/main/native/sim/mockdata/AnalogInDataInternal.h +++ b/hal/src/main/native/sim/mockdata/AnalogInDataInternal.hpp @@ -4,8 +4,9 @@ #pragma once -#include "wpi/hal/simulation/AnalogInData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include + +#include "wpi/hal/simulation/SimDataValue.hpp" namespace wpi::hal { class AnalogInData { diff --git a/hal/src/main/native/sim/mockdata/CTREPCMData.cpp b/hal/src/main/native/sim/mockdata/CTREPCMData.cpp index 5096d6538e..8c18bd4267 100644 --- a/hal/src/main/native/sim/mockdata/CTREPCMData.cpp +++ b/hal/src/main/native/sim/mockdata/CTREPCMData.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "../PortsInternal.h" -#include "CTREPCMDataInternal.h" +#include "../PortsInternal.hpp" +#include "CTREPCMDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/CTREPCMDataInternal.h b/hal/src/main/native/sim/mockdata/CTREPCMDataInternal.hpp similarity index 92% rename from hal/src/main/native/sim/mockdata/CTREPCMDataInternal.h rename to hal/src/main/native/sim/mockdata/CTREPCMDataInternal.hpp index 44352e8fc5..61e11d244c 100644 --- a/hal/src/main/native/sim/mockdata/CTREPCMDataInternal.h +++ b/hal/src/main/native/sim/mockdata/CTREPCMDataInternal.hpp @@ -4,9 +4,8 @@ #pragma once -#include "../PortsInternal.h" -#include "wpi/hal/simulation/CTREPCMData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "../PortsInternal.hpp" +#include "wpi/hal/simulation/SimDataValue.hpp" namespace wpi::hal { class CTREPCMData { diff --git a/hal/src/main/native/sim/mockdata/CanDataInternal.cpp b/hal/src/main/native/sim/mockdata/CanDataInternal.cpp index e03c261d37..9035cc216d 100644 --- a/hal/src/main/native/sim/mockdata/CanDataInternal.cpp +++ b/hal/src/main/native/sim/mockdata/CanDataInternal.cpp @@ -2,7 +2,7 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "CanDataInternal.h" +#include "CanDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/CanDataInternal.h b/hal/src/main/native/sim/mockdata/CanDataInternal.hpp similarity index 95% rename from hal/src/main/native/sim/mockdata/CanDataInternal.h rename to hal/src/main/native/sim/mockdata/CanDataInternal.hpp index 3b555363b1..5c9672867b 100644 --- a/hal/src/main/native/sim/mockdata/CanDataInternal.h +++ b/hal/src/main/native/sim/mockdata/CanDataInternal.hpp @@ -5,7 +5,7 @@ #pragma once #include "wpi/hal/simulation/CanData.h" -#include "wpi/hal/simulation/SimCallbackRegistry.h" +#include "wpi/hal/simulation/SimCallbackRegistry.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/sim/mockdata/DIOData.cpp b/hal/src/main/native/sim/mockdata/DIOData.cpp index 1f80eedf92..2d948fbe9d 100644 --- a/hal/src/main/native/sim/mockdata/DIOData.cpp +++ b/hal/src/main/native/sim/mockdata/DIOData.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "../PortsInternal.h" -#include "DIODataInternal.h" +#include "../PortsInternal.hpp" +#include "DIODataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/DIODataInternal.h b/hal/src/main/native/sim/mockdata/DIODataInternal.hpp similarity index 92% rename from hal/src/main/native/sim/mockdata/DIODataInternal.h rename to hal/src/main/native/sim/mockdata/DIODataInternal.hpp index 1d205e5dcb..0027d96902 100644 --- a/hal/src/main/native/sim/mockdata/DIODataInternal.h +++ b/hal/src/main/native/sim/mockdata/DIODataInternal.hpp @@ -4,8 +4,9 @@ #pragma once -#include "wpi/hal/simulation/DIOData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include + +#include "wpi/hal/simulation/SimDataValue.hpp" namespace wpi::hal { class DIOData { diff --git a/hal/src/main/native/sim/mockdata/DigitalPWMData.cpp b/hal/src/main/native/sim/mockdata/DigitalPWMData.cpp index 9afbcd6247..0991b3f7a7 100644 --- a/hal/src/main/native/sim/mockdata/DigitalPWMData.cpp +++ b/hal/src/main/native/sim/mockdata/DigitalPWMData.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "../PortsInternal.h" -#include "DigitalPWMDataInternal.h" +#include "../PortsInternal.hpp" +#include "DigitalPWMDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/DigitalPWMDataInternal.h b/hal/src/main/native/sim/mockdata/DigitalPWMDataInternal.hpp similarity index 88% rename from hal/src/main/native/sim/mockdata/DigitalPWMDataInternal.h rename to hal/src/main/native/sim/mockdata/DigitalPWMDataInternal.hpp index c5e8b1e0be..c1f2b0137c 100644 --- a/hal/src/main/native/sim/mockdata/DigitalPWMDataInternal.h +++ b/hal/src/main/native/sim/mockdata/DigitalPWMDataInternal.hpp @@ -4,8 +4,9 @@ #pragma once -#include "wpi/hal/simulation/DigitalPWMData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include + +#include "wpi/hal/simulation/SimDataValue.hpp" namespace wpi::hal { class DigitalPWMData { diff --git a/hal/src/main/native/sim/mockdata/DriverStationData.cpp b/hal/src/main/native/sim/mockdata/DriverStationData.cpp index d4814339e3..bc7c79d6a4 100644 --- a/hal/src/main/native/sim/mockdata/DriverStationData.cpp +++ b/hal/src/main/native/sim/mockdata/DriverStationData.cpp @@ -11,7 +11,7 @@ #include -#include "DriverStationDataInternal.h" +#include "DriverStationDataInternal.hpp" #include "wpi/hal/DashboardOpMode.hpp" #include "wpi/hal/DriverStationTypes.h" diff --git a/hal/src/main/native/sim/mockdata/DriverStationDataInternal.h b/hal/src/main/native/sim/mockdata/DriverStationDataInternal.hpp similarity index 99% rename from hal/src/main/native/sim/mockdata/DriverStationDataInternal.h rename to hal/src/main/native/sim/mockdata/DriverStationDataInternal.hpp index 023bb2736d..1fd620a8fd 100644 --- a/hal/src/main/native/sim/mockdata/DriverStationDataInternal.h +++ b/hal/src/main/native/sim/mockdata/DriverStationDataInternal.hpp @@ -12,8 +12,8 @@ #include "wpi/hal/DriverStationTypes.h" #include "wpi/hal/simulation/DriverStationData.h" -#include "wpi/hal/simulation/SimCallbackRegistry.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimCallbackRegistry.hpp" +#include "wpi/hal/simulation/SimDataValue.hpp" #include "wpi/util/spinlock.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/sim/mockdata/DutyCycleData.cpp b/hal/src/main/native/sim/mockdata/DutyCycleData.cpp index 557c7dbd1d..f7d203ac39 100644 --- a/hal/src/main/native/sim/mockdata/DutyCycleData.cpp +++ b/hal/src/main/native/sim/mockdata/DutyCycleData.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "../PortsInternal.h" -#include "DutyCycleDataInternal.h" +#include "../PortsInternal.hpp" +#include "DutyCycleDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/DutyCycleDataInternal.h b/hal/src/main/native/sim/mockdata/DutyCycleDataInternal.hpp similarity index 87% rename from hal/src/main/native/sim/mockdata/DutyCycleDataInternal.h rename to hal/src/main/native/sim/mockdata/DutyCycleDataInternal.hpp index 78b2a4b5ec..0f30fe4367 100644 --- a/hal/src/main/native/sim/mockdata/DutyCycleDataInternal.h +++ b/hal/src/main/native/sim/mockdata/DutyCycleDataInternal.hpp @@ -5,10 +5,8 @@ #pragma once #include -#include -#include "wpi/hal/simulation/DutyCycleData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" namespace wpi::hal { class DutyCycleData { diff --git a/hal/src/main/native/sim/mockdata/EncoderData.cpp b/hal/src/main/native/sim/mockdata/EncoderData.cpp index 2def1a58a1..47ac4a55ea 100644 --- a/hal/src/main/native/sim/mockdata/EncoderData.cpp +++ b/hal/src/main/native/sim/mockdata/EncoderData.cpp @@ -4,8 +4,8 @@ #include -#include "../PortsInternal.h" -#include "EncoderDataInternal.h" +#include "../PortsInternal.hpp" +#include "EncoderDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/EncoderDataInternal.h b/hal/src/main/native/sim/mockdata/EncoderDataInternal.hpp similarity index 94% rename from hal/src/main/native/sim/mockdata/EncoderDataInternal.h rename to hal/src/main/native/sim/mockdata/EncoderDataInternal.hpp index bdd3620605..79d5e27920 100644 --- a/hal/src/main/native/sim/mockdata/EncoderDataInternal.h +++ b/hal/src/main/native/sim/mockdata/EncoderDataInternal.hpp @@ -4,11 +4,12 @@ #pragma once +#include + #include #include -#include "wpi/hal/simulation/EncoderData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" namespace wpi::hal { class EncoderData { diff --git a/hal/src/main/native/sim/mockdata/I2CData.cpp b/hal/src/main/native/sim/mockdata/I2CData.cpp index 5009c76879..2be4bff662 100644 --- a/hal/src/main/native/sim/mockdata/I2CData.cpp +++ b/hal/src/main/native/sim/mockdata/I2CData.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "../PortsInternal.h" -#include "I2CDataInternal.h" +#include "../PortsInternal.hpp" +#include "I2CDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/I2CDataInternal.h b/hal/src/main/native/sim/mockdata/I2CDataInternal.hpp similarity index 86% rename from hal/src/main/native/sim/mockdata/I2CDataInternal.h rename to hal/src/main/native/sim/mockdata/I2CDataInternal.hpp index e5cc4e48f5..9d23833f7c 100644 --- a/hal/src/main/native/sim/mockdata/I2CDataInternal.h +++ b/hal/src/main/native/sim/mockdata/I2CDataInternal.hpp @@ -4,9 +4,8 @@ #pragma once -#include "wpi/hal/simulation/I2CData.h" -#include "wpi/hal/simulation/SimCallbackRegistry.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimCallbackRegistry.hpp" +#include "wpi/hal/simulation/SimDataValue.hpp" namespace wpi::hal { class I2CData { diff --git a/hal/src/main/native/sim/mockdata/PWMData.cpp b/hal/src/main/native/sim/mockdata/PWMData.cpp index 456334e30c..35b4395afd 100644 --- a/hal/src/main/native/sim/mockdata/PWMData.cpp +++ b/hal/src/main/native/sim/mockdata/PWMData.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "../PortsInternal.h" -#include "PWMDataInternal.h" +#include "../PortsInternal.hpp" +#include "PWMDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/PWMDataInternal.h b/hal/src/main/native/sim/mockdata/PWMDataInternal.hpp similarity index 90% rename from hal/src/main/native/sim/mockdata/PWMDataInternal.h rename to hal/src/main/native/sim/mockdata/PWMDataInternal.hpp index f1877f4d11..c84607bee8 100644 --- a/hal/src/main/native/sim/mockdata/PWMDataInternal.h +++ b/hal/src/main/native/sim/mockdata/PWMDataInternal.hpp @@ -4,8 +4,7 @@ #pragma once -#include "wpi/hal/simulation/PWMData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" namespace wpi::hal { class PWMData { diff --git a/hal/src/main/native/sim/mockdata/PowerDistributionData.cpp b/hal/src/main/native/sim/mockdata/PowerDistributionData.cpp index d8456fa669..c569f314f5 100644 --- a/hal/src/main/native/sim/mockdata/PowerDistributionData.cpp +++ b/hal/src/main/native/sim/mockdata/PowerDistributionData.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "../PortsInternal.h" -#include "PowerDistributionDataInternal.h" +#include "../PortsInternal.hpp" +#include "PowerDistributionDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/PowerDistributionDataInternal.h b/hal/src/main/native/sim/mockdata/PowerDistributionDataInternal.hpp similarity index 88% rename from hal/src/main/native/sim/mockdata/PowerDistributionDataInternal.h rename to hal/src/main/native/sim/mockdata/PowerDistributionDataInternal.hpp index 77fb40af8c..2a7e7f2416 100644 --- a/hal/src/main/native/sim/mockdata/PowerDistributionDataInternal.h +++ b/hal/src/main/native/sim/mockdata/PowerDistributionDataInternal.hpp @@ -4,9 +4,8 @@ #pragma once -#include "../PortsInternal.h" -#include "wpi/hal/simulation/PowerDistributionData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "../PortsInternal.hpp" +#include "wpi/hal/simulation/SimDataValue.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/sim/mockdata/REVPHData.cpp b/hal/src/main/native/sim/mockdata/REVPHData.cpp index 51cf274c25..b5c556b4af 100644 --- a/hal/src/main/native/sim/mockdata/REVPHData.cpp +++ b/hal/src/main/native/sim/mockdata/REVPHData.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "../PortsInternal.h" -#include "REVPHDataInternal.h" +#include "../PortsInternal.hpp" +#include "REVPHDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/REVPHDataInternal.h b/hal/src/main/native/sim/mockdata/REVPHDataInternal.hpp similarity index 93% rename from hal/src/main/native/sim/mockdata/REVPHDataInternal.h rename to hal/src/main/native/sim/mockdata/REVPHDataInternal.hpp index 028c2cf126..a50ad75c70 100644 --- a/hal/src/main/native/sim/mockdata/REVPHDataInternal.h +++ b/hal/src/main/native/sim/mockdata/REVPHDataInternal.hpp @@ -4,9 +4,9 @@ #pragma once -#include "../PortsInternal.h" -#include "wpi/hal/simulation/REVPHData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "../PortsInternal.hpp" +#include "wpi/hal/REVPH.h" +#include "wpi/hal/simulation/SimDataValue.hpp" namespace wpi::hal { class REVPHData { diff --git a/hal/src/main/native/sim/mockdata/Reset.cpp b/hal/src/main/native/sim/mockdata/Reset.cpp index 19efd65083..b8d9ac4b79 100644 --- a/hal/src/main/native/sim/mockdata/Reset.cpp +++ b/hal/src/main/native/sim/mockdata/Reset.cpp @@ -2,7 +2,7 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "../PortsInternal.h" +#include "../PortsInternal.hpp" #include "wpi/hal/simulation/AddressableLEDData.h" #include "wpi/hal/simulation/AlertData.h" #include "wpi/hal/simulation/AnalogInData.h" diff --git a/hal/src/main/native/sim/mockdata/RoboRioData.cpp b/hal/src/main/native/sim/mockdata/RoboRioData.cpp index 852410f673..7cd9200c9f 100644 --- a/hal/src/main/native/sim/mockdata/RoboRioData.cpp +++ b/hal/src/main/native/sim/mockdata/RoboRioData.cpp @@ -4,7 +4,7 @@ #include -#include "RoboRioDataInternal.h" +#include "RoboRioDataInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/RoboRioDataInternal.h b/hal/src/main/native/sim/mockdata/RoboRioDataInternal.hpp similarity index 97% rename from hal/src/main/native/sim/mockdata/RoboRioDataInternal.h rename to hal/src/main/native/sim/mockdata/RoboRioDataInternal.hpp index 7fc276569b..5928797d4c 100644 --- a/hal/src/main/native/sim/mockdata/RoboRioDataInternal.h +++ b/hal/src/main/native/sim/mockdata/RoboRioDataInternal.hpp @@ -4,11 +4,12 @@ #pragma once -#include +#include + #include #include "wpi/hal/simulation/RoboRioData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" #include "wpi/util/spinlock.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/sim/mockdata/SimDeviceData.cpp b/hal/src/main/native/sim/mockdata/SimDeviceData.cpp index 355a378fa7..7fcb76932f 100644 --- a/hal/src/main/native/sim/mockdata/SimDeviceData.cpp +++ b/hal/src/main/native/sim/mockdata/SimDeviceData.cpp @@ -8,7 +8,7 @@ #include #include -#include "SimDeviceDataInternal.h" +#include "SimDeviceDataInternal.hpp" #include "wpi/util/StringExtras.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/sim/mockdata/SimDeviceDataInternal.h b/hal/src/main/native/sim/mockdata/SimDeviceDataInternal.hpp similarity index 99% rename from hal/src/main/native/sim/mockdata/SimDeviceDataInternal.h rename to hal/src/main/native/sim/mockdata/SimDeviceDataInternal.hpp index e613f3a2ab..5a6ee59a5c 100644 --- a/hal/src/main/native/sim/mockdata/SimDeviceDataInternal.h +++ b/hal/src/main/native/sim/mockdata/SimDeviceDataInternal.hpp @@ -12,7 +12,7 @@ #include #include "wpi/hal/Value.h" -#include "wpi/hal/simulation/SimCallbackRegistry.h" +#include "wpi/hal/simulation/NotifyListener.hpp" #include "wpi/hal/simulation/SimDeviceData.h" #include "wpi/util/StringExtras.hpp" #include "wpi/util/StringMap.hpp" diff --git a/hal/src/main/native/systemcore/AddressableLED.cpp b/hal/src/main/native/systemcore/AddressableLED.cpp index 14df1cb181..036a3b7f57 100644 --- a/hal/src/main/native/systemcore/AddressableLED.cpp +++ b/hal/src/main/native/systemcore/AddressableLED.cpp @@ -8,20 +8,20 @@ #include #include -#include #include #include -#include "AddressableLEDSimd.h" -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "SmartIo.h" -#include "SystemServerInternal.h" +#include "AddressableLEDSimd.hpp" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "SmartIo.hpp" +#include "SystemServerInternal.hpp" #include "wpi/hal/AddressableLEDTypes.h" #include "wpi/hal/Errors.h" -#include "wpi/hal/cpp/fpga_clock.h" +#include "wpi/hal/cpp/fpga_clock.hpp" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/nt/NetworkTableInstance.hpp" #include "wpi/nt/RawTopic.hpp" diff --git a/hal/src/main/native/systemcore/AddressableLEDSimd.h b/hal/src/main/native/systemcore/AddressableLEDSimd.hpp similarity index 100% rename from hal/src/main/native/systemcore/AddressableLEDSimd.h rename to hal/src/main/native/systemcore/AddressableLEDSimd.hpp diff --git a/hal/src/main/native/systemcore/Alert.cpp b/hal/src/main/native/systemcore/Alert.cpp index a193efb779..af9446dc2c 100644 --- a/hal/src/main/native/systemcore/Alert.cpp +++ b/hal/src/main/native/systemcore/Alert.cpp @@ -9,11 +9,11 @@ #include #include -#include "HALInitializer.h" +#include "HALInitializer.hpp" #include "wpi/hal/Errors.h" #include "wpi/hal/HALBase.h" #include "wpi/hal/Types.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/hal/simulation/AlertData.h" #include "wpi/util/mutex.hpp" #include "wpi/util/string.h" diff --git a/hal/src/main/native/systemcore/AnalogInput.cpp b/hal/src/main/native/systemcore/AnalogInput.cpp index 7608a27175..de7efb98b6 100644 --- a/hal/src/main/native/systemcore/AnalogInput.cpp +++ b/hal/src/main/native/systemcore/AnalogInput.cpp @@ -7,14 +7,13 @@ #include #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "SmartIo.h" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "SmartIo.hpp" #include "wpi/hal/Errors.h" -#include "wpi/hal/cpp/fpga_clock.h" -#include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/util/mutex.hpp" +#include "wpi/hal/cpp/fpga_clock.hpp" +#include "wpi/hal/handles/HandlesInternal.hpp" namespace wpi::hal::init { void InitializeAnalogInput() {} diff --git a/hal/src/main/native/systemcore/CAN.cpp b/hal/src/main/native/systemcore/CAN.cpp index 5540dfbc06..55e0f59978 100644 --- a/hal/src/main/native/systemcore/CAN.cpp +++ b/hal/src/main/native/systemcore/CAN.cpp @@ -17,10 +17,10 @@ #include #include -#include "PortsInternal.h" +#include "PortsInternal.hpp" #include "wpi/hal/Errors.h" #include "wpi/hal/Threads.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/net/EventLoopRunner.hpp" #include "wpi/net/uv/Poll.hpp" #include "wpi/net/uv/Timer.hpp" diff --git a/hal/src/main/native/systemcore/CANAPI.cpp b/hal/src/main/native/systemcore/CANAPI.cpp index 1a4d37b9d2..c38c6e428d 100644 --- a/hal/src/main/native/systemcore/CANAPI.cpp +++ b/hal/src/main/native/systemcore/CANAPI.cpp @@ -7,11 +7,11 @@ #include #include -#include "HALInitializer.h" -#include "PortsInternal.h" +#include "HALInitializer.hpp" +#include "PortsInternal.hpp" #include "wpi/hal/CAN.h" #include "wpi/hal/Errors.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/util/DenseMap.hpp" #include "wpi/util/mutex.hpp" #include "wpi/util/timestamp.h" diff --git a/hal/src/main/native/systemcore/CANInternal.h b/hal/src/main/native/systemcore/CANInternal.hpp similarity index 100% rename from hal/src/main/native/systemcore/CANInternal.h rename to hal/src/main/native/systemcore/CANInternal.hpp diff --git a/hal/src/main/native/systemcore/CTREPCM.cpp b/hal/src/main/native/systemcore/CTREPCM.cpp index 9bb9bf8757..483333bf45 100644 --- a/hal/src/main/native/systemcore/CTREPCM.cpp +++ b/hal/src/main/native/systemcore/CTREPCM.cpp @@ -8,12 +8,12 @@ #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" #include "wpi/hal/CANAPI.h" #include "wpi/hal/Errors.h" -#include "wpi/hal/handles/IndexedHandleResource.h" +#include "wpi/hal/handles/IndexedHandleResource.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/systemcore/CTREPDP.cpp b/hal/src/main/native/systemcore/CTREPDP.cpp index dd55ab6a2c..2fae19a546 100644 --- a/hal/src/main/native/systemcore/CTREPDP.cpp +++ b/hal/src/main/native/systemcore/CTREPDP.cpp @@ -8,14 +8,13 @@ #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" #include "wpi/hal/CAN.h" #include "wpi/hal/CANAPI.h" #include "wpi/hal/Errors.h" -#include "wpi/hal/handles/IndexedHandleResource.h" -#include "wpi/util/mutex.hpp" +#include "wpi/hal/handles/IndexedHandleResource.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/systemcore/Constants.cpp b/hal/src/main/native/systemcore/Constants.cpp index 795544e637..e44fdad764 100644 --- a/hal/src/main/native/systemcore/Constants.cpp +++ b/hal/src/main/native/systemcore/Constants.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/Constants.h" -#include "ConstantsInternal.h" +#include "ConstantsInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/systemcore/ConstantsInternal.h b/hal/src/main/native/systemcore/ConstantsInternal.hpp similarity index 100% rename from hal/src/main/native/systemcore/ConstantsInternal.h rename to hal/src/main/native/systemcore/ConstantsInternal.hpp diff --git a/hal/src/main/native/systemcore/Counter.cpp b/hal/src/main/native/systemcore/Counter.cpp index 4ff00eefe0..ea8e2f5e93 100644 --- a/hal/src/main/native/systemcore/Counter.cpp +++ b/hal/src/main/native/systemcore/Counter.cpp @@ -5,19 +5,15 @@ #include "wpi/hal/Counter.h" #include -#include -#include #include #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "SmartIo.h" -#include "wpi/hal/HAL.h" -#include "wpi/hal/cpp/fpga_clock.h" -#include "wpi/hal/handles/LimitedHandleResource.h" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "SmartIo.hpp" +#include "wpi/hal/cpp/fpga_clock.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/systemcore/DIO.cpp b/hal/src/main/native/systemcore/DIO.cpp index 3a45faa61a..cb5bd89de7 100644 --- a/hal/src/main/native/systemcore/DIO.cpp +++ b/hal/src/main/native/systemcore/DIO.cpp @@ -8,14 +8,13 @@ #include #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "SmartIo.h" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "SmartIo.hpp" #include "wpi/hal/Errors.h" -#include "wpi/hal/cpp/fpga_clock.h" -#include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/handles/LimitedHandleResource.h" +#include "wpi/hal/cpp/fpga_clock.hpp" +#include "wpi/hal/handles/HandlesInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/systemcore/DutyCycle.cpp b/hal/src/main/native/systemcore/DutyCycle.cpp index 9534cc13a8..9212ac3ae7 100644 --- a/hal/src/main/native/systemcore/DutyCycle.cpp +++ b/hal/src/main/native/systemcore/DutyCycle.cpp @@ -5,17 +5,15 @@ #include "wpi/hal/DutyCycle.h" #include -#include #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "SmartIo.h" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "SmartIo.hpp" #include "wpi/hal/Errors.h" -#include "wpi/hal/cpp/fpga_clock.h" -#include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/handles/LimitedHandleResource.h" +#include "wpi/hal/cpp/fpga_clock.hpp" +#include "wpi/hal/handles/HandlesInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/systemcore/Encoder.cpp b/hal/src/main/native/systemcore/Encoder.cpp index 9959c11032..16bac36f51 100644 --- a/hal/src/main/native/systemcore/Encoder.cpp +++ b/hal/src/main/native/systemcore/Encoder.cpp @@ -4,16 +4,10 @@ #include "wpi/hal/Encoder.h" -#include - #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "wpi/hal/Counter.h" +#include "HALInitializer.hpp" #include "wpi/hal/Errors.h" -#include "wpi/hal/handles/LimitedClassedHandleResource.h" using namespace wpi::hal; diff --git a/hal/src/main/native/systemcore/FRCDriverStation.cpp b/hal/src/main/native/systemcore/FRCDriverStation.cpp index e10a410086..ba8d90d0c4 100644 --- a/hal/src/main/native/systemcore/FRCDriverStation.cpp +++ b/hal/src/main/native/systemcore/FRCDriverStation.cpp @@ -15,8 +15,8 @@ #include -#include "HALInitializer.h" -#include "SystemServerInternal.h" +#include "HALInitializer.hpp" +#include "SystemServerInternal.hpp" #include "mrc/NtNetComm.h" #include "wpi/hal/DashboardOpMode.hpp" #include "wpi/hal/DriverStation.h" diff --git a/hal/src/main/native/systemcore/HAL.cpp b/hal/src/main/native/systemcore/HAL.cpp index e1a96cf153..a3de238362 100644 --- a/hal/src/main/native/systemcore/HAL.cpp +++ b/hal/src/main/native/systemcore/HAL.cpp @@ -17,14 +17,14 @@ #include #include -#include "CANInternal.h" -#include "HALInitializer.h" -#include "HALInternal.h" -#include "SystemServerInternal.h" +#include "CANInternal.hpp" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "SystemServerInternal.hpp" #include "wpi/hal/DriverStation.h" #include "wpi/hal/Errors.h" #include "wpi/hal/Notifier.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/util/MemoryBuffer.hpp" #include "wpi/util/StringExtras.hpp" #include "wpi/util/fs.hpp" diff --git a/hal/src/main/native/systemcore/HALInitializer.cpp b/hal/src/main/native/systemcore/HALInitializer.cpp index 4312571b81..517b97e7cf 100644 --- a/hal/src/main/native/systemcore/HALInitializer.cpp +++ b/hal/src/main/native/systemcore/HALInitializer.cpp @@ -2,7 +2,7 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "HALInitializer.h" +#include "HALInitializer.hpp" #include "wpi/hal/HALBase.h" diff --git a/hal/src/main/native/systemcore/HALInitializer.h b/hal/src/main/native/systemcore/HALInitializer.hpp similarity index 100% rename from hal/src/main/native/systemcore/HALInitializer.h rename to hal/src/main/native/systemcore/HALInitializer.hpp diff --git a/hal/src/main/native/systemcore/HALInternal.h b/hal/src/main/native/systemcore/HALInternal.hpp similarity index 100% rename from hal/src/main/native/systemcore/HALInternal.h rename to hal/src/main/native/systemcore/HALInternal.hpp diff --git a/hal/src/main/native/systemcore/I2C.cpp b/hal/src/main/native/systemcore/I2C.cpp index a1732daf84..6b10841713 100644 --- a/hal/src/main/native/systemcore/I2C.cpp +++ b/hal/src/main/native/systemcore/I2C.cpp @@ -14,11 +14,10 @@ #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "wpi/hal/DIO.h" -#include "wpi/hal/HAL.h" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "wpi/hal/Errors.h" #include "wpi/util/mutex.hpp" #include "wpi/util/print.hpp" diff --git a/hal/src/main/native/systemcore/IMU.cpp b/hal/src/main/native/systemcore/IMU.cpp index 96abc1f541..8f1c89cc17 100644 --- a/hal/src/main/native/systemcore/IMU.cpp +++ b/hal/src/main/native/systemcore/IMU.cpp @@ -6,8 +6,8 @@ #include -#include "HALInitializer.h" -#include "SystemServerInternal.h" +#include "HALInitializer.hpp" +#include "SystemServerInternal.hpp" #include "wpi/hal/Errors.h" #include "wpi/nt/DoubleArrayTopic.hpp" #include "wpi/nt/DoubleTopic.hpp" diff --git a/hal/src/main/native/systemcore/Notifier.cpp b/hal/src/main/native/systemcore/Notifier.cpp index d798299720..be67ad16cc 100644 --- a/hal/src/main/native/systemcore/Notifier.cpp +++ b/hal/src/main/native/systemcore/Notifier.cpp @@ -12,12 +12,12 @@ #include #include -#include "HALInitializer.h" +#include "HALInitializer.hpp" #include "wpi/hal/Errors.h" #include "wpi/hal/HALBase.h" #include "wpi/hal/Threads.h" #include "wpi/hal/Types.h" -#include "wpi/hal/handles/UnlimitedHandleResource.h" +#include "wpi/hal/handles/UnlimitedHandleResource.hpp" #include "wpi/util/SafeThread.hpp" #include "wpi/util/Synchronization.h" #include "wpi/util/priority_queue.hpp" diff --git a/hal/src/main/native/systemcore/PWM.cpp b/hal/src/main/native/systemcore/PWM.cpp index 183d515e54..7182858050 100644 --- a/hal/src/main/native/systemcore/PWM.cpp +++ b/hal/src/main/native/systemcore/PWM.cpp @@ -4,21 +4,19 @@ #include "wpi/hal/PWM.h" -#include #include #include #include #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" -#include "SmartIo.h" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" +#include "SmartIo.hpp" #include "wpi/hal/Errors.h" -#include "wpi/hal/cpp/fpga_clock.h" -#include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/util/print.hpp" +#include "wpi/hal/cpp/fpga_clock.hpp" +#include "wpi/hal/handles/HandlesInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/systemcore/Ports.cpp b/hal/src/main/native/systemcore/Ports.cpp index 1fec512684..df6cb155c8 100644 --- a/hal/src/main/native/systemcore/Ports.cpp +++ b/hal/src/main/native/systemcore/Ports.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/Ports.h" -#include "PortsInternal.h" +#include "PortsInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/systemcore/PortsInternal.h b/hal/src/main/native/systemcore/PortsInternal.hpp similarity index 100% rename from hal/src/main/native/systemcore/PortsInternal.h rename to hal/src/main/native/systemcore/PortsInternal.hpp diff --git a/hal/src/main/native/systemcore/Power.cpp b/hal/src/main/native/systemcore/Power.cpp index 0006da40f3..a5b334d5e5 100644 --- a/hal/src/main/native/systemcore/Power.cpp +++ b/hal/src/main/native/systemcore/Power.cpp @@ -4,10 +4,8 @@ #include "wpi/hal/Power.h" -#include - -#include "HALInitializer.h" -#include "SystemServerInternal.h" +#include "HALInitializer.hpp" +#include "SystemServerInternal.hpp" #include "mrc/NtNetComm.h" #include "wpi/hal/Errors.h" #include "wpi/nt/DoubleTopic.hpp" diff --git a/hal/src/main/native/systemcore/PowerDistribution.cpp b/hal/src/main/native/systemcore/PowerDistribution.cpp index c9c6bf7778..a06f991286 100644 --- a/hal/src/main/native/systemcore/PowerDistribution.cpp +++ b/hal/src/main/native/systemcore/PowerDistribution.cpp @@ -8,12 +8,12 @@ #include #include "CTREPDP.h" -#include "HALInternal.h" -#include "PortsInternal.h" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" #include "REVPDH.h" #include "wpi/hal/Errors.h" #include "wpi/hal/HALBase.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/systemcore/REVPDH.cpp b/hal/src/main/native/systemcore/REVPDH.cpp index adfd9a918d..11f4370e94 100644 --- a/hal/src/main/native/systemcore/REVPDH.cpp +++ b/hal/src/main/native/systemcore/REVPDH.cpp @@ -10,16 +10,16 @@ #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" #include "rev/PDHFrames.h" #include "wpi/hal/CAN.h" #include "wpi/hal/CANAPI.h" #include "wpi/hal/CANAPITypes.h" #include "wpi/hal/Errors.h" -#include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/handles/IndexedHandleResource.h" +#include "wpi/hal/handles/HandlesInternal.hpp" +#include "wpi/hal/handles/IndexedHandleResource.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/systemcore/REVPH.cpp b/hal/src/main/native/systemcore/REVPH.cpp index 99f0e7e306..d65bfcc6b3 100644 --- a/hal/src/main/native/systemcore/REVPH.cpp +++ b/hal/src/main/native/systemcore/REVPH.cpp @@ -9,13 +9,13 @@ #include -#include "HALInitializer.h" -#include "HALInternal.h" -#include "PortsInternal.h" +#include "HALInitializer.hpp" +#include "HALInternal.hpp" +#include "PortsInternal.hpp" #include "rev/PHFrames.h" #include "wpi/hal/CANAPI.h" #include "wpi/hal/Errors.h" -#include "wpi/hal/handles/IndexedHandleResource.h" +#include "wpi/hal/handles/IndexedHandleResource.hpp" using namespace wpi::hal; diff --git a/hal/src/main/native/systemcore/SerialPort.cpp b/hal/src/main/native/systemcore/SerialPort.cpp index d54b5b049b..ec80897776 100644 --- a/hal/src/main/native/systemcore/SerialPort.cpp +++ b/hal/src/main/native/systemcore/SerialPort.cpp @@ -20,9 +20,7 @@ #include -#include "HALInternal.h" -#include "wpi/hal/handles/HandlesInternal.h" -#include "wpi/hal/handles/IndexedHandleResource.h" +#include "wpi/hal/Errors.h" namespace wpi::hal::init { void InitializeSerialPort() {} diff --git a/hal/src/main/native/systemcore/SimDevice.cpp b/hal/src/main/native/systemcore/SimDevice.cpp index 5300c705c5..973773a11a 100644 --- a/hal/src/main/native/systemcore/SimDevice.cpp +++ b/hal/src/main/native/systemcore/SimDevice.cpp @@ -2,7 +2,7 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "wpi/hal/SimDevice.h" +#include "wpi/hal/SimDevice.hpp" extern "C" { diff --git a/hal/src/main/native/systemcore/SmartIo.cpp b/hal/src/main/native/systemcore/SmartIo.cpp index 9f74eed150..bd42e16256 100644 --- a/hal/src/main/native/systemcore/SmartIo.cpp +++ b/hal/src/main/native/systemcore/SmartIo.cpp @@ -2,12 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include "SmartIo.h" +#include "SmartIo.hpp" -#include - -#include "HALInitializer.h" -#include "SystemServerInternal.h" +#include "HALInitializer.hpp" +#include "SystemServerInternal.hpp" #include "wpi/hal/AddressableLEDTypes.h" #include "wpi/hal/Errors.h" diff --git a/hal/src/main/native/systemcore/SmartIo.h b/hal/src/main/native/systemcore/SmartIo.hpp similarity index 93% rename from hal/src/main/native/systemcore/SmartIo.h rename to hal/src/main/native/systemcore/SmartIo.hpp index be09096b00..dc3a67d920 100644 --- a/hal/src/main/native/systemcore/SmartIo.h +++ b/hal/src/main/native/systemcore/SmartIo.hpp @@ -6,9 +6,8 @@ #include -#include "PortsInternal.h" -#include "wpi/hal/handles/DigitalHandleResource.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "PortsInternal.hpp" +#include "wpi/hal/handles/DigitalHandleResource.hpp" #include "wpi/nt/IntegerTopic.hpp" namespace wpi::hal { diff --git a/hal/src/main/native/systemcore/SystemServer.cpp b/hal/src/main/native/systemcore/SystemServer.cpp index 467517eb70..40613573be 100644 --- a/hal/src/main/native/systemcore/SystemServer.cpp +++ b/hal/src/main/native/systemcore/SystemServer.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/SystemServer.h" -#include "SystemServerInternal.h" +#include "SystemServerInternal.hpp" #include "mrc/NtNetComm.h" namespace wpi::hal { diff --git a/hal/src/main/native/systemcore/SystemServerInternal.h b/hal/src/main/native/systemcore/SystemServerInternal.hpp similarity index 100% rename from hal/src/main/native/systemcore/SystemServerInternal.h rename to hal/src/main/native/systemcore/SystemServerInternal.hpp diff --git a/hal/src/main/native/systemcore/UsageReporting.cpp b/hal/src/main/native/systemcore/UsageReporting.cpp index ba6fa97b86..f89083995a 100644 --- a/hal/src/main/native/systemcore/UsageReporting.cpp +++ b/hal/src/main/native/systemcore/UsageReporting.cpp @@ -8,7 +8,7 @@ #include -#include "SystemServerInternal.h" +#include "SystemServerInternal.hpp" #include "wpi/nt/NetworkTableInstance.hpp" #include "wpi/nt/StringTopic.hpp" #include "wpi/util/StringMap.hpp" diff --git a/hal/src/main/native/systemcore/mockdata/AddressableLEDData.cpp b/hal/src/main/native/systemcore/mockdata/AddressableLEDData.cpp index a7e8ac7244..c5dd49fde2 100644 --- a/hal/src/main/native/systemcore/mockdata/AddressableLEDData.cpp +++ b/hal/src/main/native/systemcore/mockdata/AddressableLEDData.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/simulation/AddressableLEDData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { diff --git a/hal/src/main/native/systemcore/mockdata/AnalogInData.cpp b/hal/src/main/native/systemcore/mockdata/AnalogInData.cpp index 8125a5bda6..57b69f670a 100644 --- a/hal/src/main/native/systemcore/mockdata/AnalogInData.cpp +++ b/hal/src/main/native/systemcore/mockdata/AnalogInData.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/simulation/AnalogInData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { void HALSIM_ResetAnalogInData(int32_t index) {} diff --git a/hal/src/main/native/systemcore/mockdata/CTREPCMData.cpp b/hal/src/main/native/systemcore/mockdata/CTREPCMData.cpp index 1380a22991..6bdc8d9336 100644 --- a/hal/src/main/native/systemcore/mockdata/CTREPCMData.cpp +++ b/hal/src/main/native/systemcore/mockdata/CTREPCMData.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/simulation/CTREPCMData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { void HALSIM_ResetCTREPCMData(int32_t index) {} diff --git a/hal/src/main/native/systemcore/mockdata/CanDataInternal.cpp b/hal/src/main/native/systemcore/mockdata/CanDataInternal.cpp index ba017848af..35df605e50 100644 --- a/hal/src/main/native/systemcore/mockdata/CanDataInternal.cpp +++ b/hal/src/main/native/systemcore/mockdata/CanDataInternal.cpp @@ -3,7 +3,7 @@ // the WPILib BSD license file in the root directory of this project. #include "wpi/hal/simulation/CanData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { diff --git a/hal/src/main/native/systemcore/mockdata/DIOData.cpp b/hal/src/main/native/systemcore/mockdata/DIOData.cpp index af3e84bb48..96df376b6c 100644 --- a/hal/src/main/native/systemcore/mockdata/DIOData.cpp +++ b/hal/src/main/native/systemcore/mockdata/DIOData.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/simulation/DIOData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { void HALSIM_ResetDIOData(int32_t index) {} diff --git a/hal/src/main/native/systemcore/mockdata/DigitalPWMData.cpp b/hal/src/main/native/systemcore/mockdata/DigitalPWMData.cpp index 933b31e812..83c7d01dfb 100644 --- a/hal/src/main/native/systemcore/mockdata/DigitalPWMData.cpp +++ b/hal/src/main/native/systemcore/mockdata/DigitalPWMData.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/simulation/DigitalPWMData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { int32_t HALSIM_FindDigitalPWMForChannel(int32_t channel) { diff --git a/hal/src/main/native/systemcore/mockdata/DriverStationData.cpp b/hal/src/main/native/systemcore/mockdata/DriverStationData.cpp index a9bbaf36e0..bbc85531c4 100644 --- a/hal/src/main/native/systemcore/mockdata/DriverStationData.cpp +++ b/hal/src/main/native/systemcore/mockdata/DriverStationData.cpp @@ -5,7 +5,7 @@ #include "wpi/hal/simulation/DriverStationData.h" #include "wpi/hal/DriverStationTypes.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { void HALSIM_ResetDriverStationData(void) {} diff --git a/hal/src/main/native/systemcore/mockdata/DutyCycleData.cpp b/hal/src/main/native/systemcore/mockdata/DutyCycleData.cpp index f2706e49a7..b540f751a9 100644 --- a/hal/src/main/native/systemcore/mockdata/DutyCycleData.cpp +++ b/hal/src/main/native/systemcore/mockdata/DutyCycleData.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/simulation/DutyCycleData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { diff --git a/hal/src/main/native/systemcore/mockdata/EncoderData.cpp b/hal/src/main/native/systemcore/mockdata/EncoderData.cpp index 0f1030561e..821106e740 100644 --- a/hal/src/main/native/systemcore/mockdata/EncoderData.cpp +++ b/hal/src/main/native/systemcore/mockdata/EncoderData.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/simulation/EncoderData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { int32_t HALSIM_FindEncoderForChannel(int32_t channel) { diff --git a/hal/src/main/native/systemcore/mockdata/I2CData.cpp b/hal/src/main/native/systemcore/mockdata/I2CData.cpp index 557cddd94a..2b8da3d2d4 100644 --- a/hal/src/main/native/systemcore/mockdata/I2CData.cpp +++ b/hal/src/main/native/systemcore/mockdata/I2CData.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/simulation/I2CData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { void HALSIM_ResetI2CData(int32_t index) {} diff --git a/hal/src/main/native/systemcore/mockdata/PWMData.cpp b/hal/src/main/native/systemcore/mockdata/PWMData.cpp index 808198feae..d75b6fc32a 100644 --- a/hal/src/main/native/systemcore/mockdata/PWMData.cpp +++ b/hal/src/main/native/systemcore/mockdata/PWMData.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/simulation/PWMData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { void HALSIM_ResetPWMData(int32_t index) {} diff --git a/hal/src/main/native/systemcore/mockdata/PowerDistributionData.cpp b/hal/src/main/native/systemcore/mockdata/PowerDistributionData.cpp index 6eb5b352cd..ee3b89c09a 100644 --- a/hal/src/main/native/systemcore/mockdata/PowerDistributionData.cpp +++ b/hal/src/main/native/systemcore/mockdata/PowerDistributionData.cpp @@ -4,8 +4,7 @@ #include "wpi/hal/simulation/PowerDistributionData.h" -#include "../PortsInternal.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { void HALSIM_ResetPowerDistributionData(int32_t index) {} diff --git a/hal/src/main/native/systemcore/mockdata/REVPHData.cpp b/hal/src/main/native/systemcore/mockdata/REVPHData.cpp index 37d7b1e969..c5ba808167 100644 --- a/hal/src/main/native/systemcore/mockdata/REVPHData.cpp +++ b/hal/src/main/native/systemcore/mockdata/REVPHData.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/simulation/REVPHData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { void HALSIM_ResetREVPHData(int32_t index) {} diff --git a/hal/src/main/native/systemcore/mockdata/RoboRioData.cpp b/hal/src/main/native/systemcore/mockdata/RoboRioData.cpp index a91ca86281..b156f518ee 100644 --- a/hal/src/main/native/systemcore/mockdata/RoboRioData.cpp +++ b/hal/src/main/native/systemcore/mockdata/RoboRioData.cpp @@ -4,7 +4,7 @@ #include "wpi/hal/simulation/RoboRioData.h" -#include "wpi/hal/simulation/SimDataValue.h" +#include "wpi/hal/simulation/SimDataValue.hpp" extern "C" { void HALSIM_ResetRoboRioData(void) {} diff --git a/hal/src/main/native/systemcore/mockdata/SimDeviceData.cpp b/hal/src/main/native/systemcore/mockdata/SimDeviceData.cpp index 890e66ddd7..c8a4a81268 100644 --- a/hal/src/main/native/systemcore/mockdata/SimDeviceData.cpp +++ b/hal/src/main/native/systemcore/mockdata/SimDeviceData.cpp @@ -4,8 +4,6 @@ #include "wpi/hal/simulation/SimDeviceData.h" -#include "wpi/hal/simulation/SimDataValue.h" - extern "C" { void HALSIM_SetSimDeviceEnabled(const char* prefix, HAL_Bool enabled) {} diff --git a/hal/src/main/python/hal/simulation/resethandles.cpp b/hal/src/main/python/hal/simulation/resethandles.cpp index a371718bb9..77222fd02a 100644 --- a/hal/src/main/python/hal/simulation/resethandles.cpp +++ b/hal/src/main/python/hal/simulation/resethandles.cpp @@ -1,8 +1,8 @@ #ifndef __FRC_SYSTEMCORE__ -#include "wpi/hal/Notifier.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/Notifier.hpp" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/hal/simulation/NotifierData.h" void HALSIM_ResetGlobalHandles() { diff --git a/hal/src/main/python/pyproject.toml b/hal/src/main/python/pyproject.toml index f46cb3a83b..cee7b2d4d3 100644 --- a/hal/src/main/python/pyproject.toml +++ b/hal/src/main/python/pyproject.toml @@ -63,15 +63,19 @@ depends = ["wpiutil", "ntcore"] [tool.semiwrap.extension_modules."hal._wpiHal".headers] # hal CANAPITypes = "wpi/hal/CANAPITypes.h" -DriverStation = "wpi/hal/DriverStation.h" -DriverStationTypes = "wpi/hal/DriverStationTypes.h" +DriverStation_c = "wpi/hal/DriverStation.h" +DriverStation = "wpi/hal/DriverStation.hpp" +DriverStationTypes_c = "wpi/hal/DriverStationTypes.h" +DriverStationTypes = "wpi/hal/DriverStationTypes.hpp" Extensions = "wpi/hal/Extensions.h" HALBase = "wpi/hal/HALBase.h" Main = "wpi/hal/Main.h" -Notifier = "wpi/hal/Notifier.h" -SimDevice = "wpi/hal/SimDevice.h" +Notifier_c = "wpi/hal/Notifier.h" +Notifier = "wpi/hal/Notifier.hpp" +SimDevice_c = "wpi/hal/SimDevice.h" +SimDevice = "wpi/hal/SimDevice.hpp" Threads = "wpi/hal/Threads.h" -UsageReporting = "wpi/hal/UsageReporting.h" +UsageReporting = "wpi/hal/UsageReporting.hpp" [tool.semiwrap.extension_modules."hal.simulation._simulation"] name = "hal_simulation" @@ -81,7 +85,8 @@ yaml_path = "semiwrap/simulation" [tool.semiwrap.extension_modules."hal.simulation._simulation".headers] DriverStationData = "wpi/hal/simulation/DriverStationData.h" -MockHooks = "wpi/hal/simulation/MockHooks.h" +MockHooks_c = "wpi/hal/simulation/MockHooks.h" +MockHooks = "wpi/hal/simulation/MockHooks.hpp" NotifierData = "wpi/hal/simulation/NotifierData.h" Reset = "wpi/hal/simulation/Reset.h" SimDeviceData = "wpi/hal/simulation/SimDeviceData.h" diff --git a/hal/src/main/python/semiwrap/DriverStation.yml b/hal/src/main/python/semiwrap/DriverStation.yml index 5fd9204096..f093a586a1 100644 --- a/hal/src/main/python/semiwrap/DriverStation.yml +++ b/hal/src/main/python/semiwrap/DriverStation.yml @@ -1,46 +1,3 @@ -strip_prefixes: -- HAL_ - functions: - HAL_SendError: - HAL_SetPrintErrorImpl: - ignore: true - HAL_SendConsoleLine: - HAL_GetControlWord: - HAL_GetAllianceStation: - HAL_GetJoystickAxes: - HAL_GetJoystickPOVs: - HAL_GetJoystickButtons: - HAL_GetAllJoystickData: - HAL_GetJoystickDescriptor: - HAL_GetJoystickGamepadType: - HAL_GetJoystickSupportedOutputs: - HAL_GetJoystickName: - param_override: - name: - ignore: true - cpp_code: | - [](int32_t joystickNum) { - WPI_String name; - HAL_GetJoystickName(&name, joystickNum); - std::string sname(wpi::util::to_string_view(&name)); - WPI_FreeString(&name); - return sname; - } - HAL_SetJoystickLeds: - HAL_SetJoystickRumble: - HAL_GetMatchTime: - HAL_GetOutputsEnabled: - HAL_GetMatchInfo: - HAL_RefreshDSData: - HAL_ProvideNewDataEventHandle: - HAL_RemoveNewDataEventHandle: - HAL_ObserveUserProgramStarting: - HAL_GetJoystickIsGamepad: - HAL_GetJoystickTouchpads: - HAL_GetUncachedControlWord: - HAL_SetOpModeOptions: - HAL_ObserveUserProgram: GetControlWord: GetUncachedControlWord: - HAL_GetGameData: diff --git a/hal/src/main/python/semiwrap/DriverStationTypes.yml b/hal/src/main/python/semiwrap/DriverStationTypes.yml index 330c245d1d..c1a145e952 100644 --- a/hal/src/main/python/semiwrap/DriverStationTypes.yml +++ b/hal/src/main/python/semiwrap/DriverStationTypes.yml @@ -5,67 +5,8 @@ extra_includes: - src/ds_types_fmt.h enums: - HAL_AllianceStationID: - value_prefix: HAL_AllianceStationID - HAL_JoystickPOV: - value_prefix: HAL_JoystickPOV - HAL_MatchType: - value_prefix: HAL_kMatchType - HAL_RobotMode: - rename: _RobotMode - value_prefix: HAL_ROBOTMODE RobotMode: classes: - HAL_ControlWord: - rename: _ControlWord - attributes: - value: - HAL_JoystickAxes: - attributes: - axes: - raw: - available: - HAL_JoystickPOVs: - attributes: - povs: - available: - HAL_JoystickButtons: - attributes: - buttons: - available: - HAL_JoystickDescriptor: - attributes: - supportedOutputs: - gamepadType: - name: - isGamepad: - HAL_MatchInfo: - attributes: - eventName: - matchType: - matchNumber: - replayNumber: - HAL_JoystickTouchpadFinger: - attributes: - down: - x: - y: - HAL_JoystickTouchpad: - attributes: - count: - fingers: - HAL_JoystickTouchpads: - attributes: - count: - touchpads: - HAL_OpModeOption: - attributes: - id: - name: - group: - description: - textColor: - backgroundColor: wpi::hal::ControlWord: methods: ControlWord: @@ -91,19 +32,3 @@ classes: IsTest: IsTestEnabled: GetValue: - HAL_GameData: - attributes: - gameData: -functions: - HAL_MakeControlWord: - HAL_ControlWord_GetOpModeHash: - HAL_ControlWord_GetOpModeId: - HAL_ControlWord_SetOpModeId: - HAL_ControlWord_GetRobotMode: - HAL_ControlWord_IsEnabled: - HAL_ControlWord_IsEStopped: - HAL_ControlWord_IsFMSAttached: - HAL_ControlWord_IsDSAttached: - HAL_MakeOpModeId: - HAL_OpMode_GetRobotMode: - HAL_OpMode_GetHash: diff --git a/hal/src/main/python/semiwrap/DriverStationTypes_c.yml b/hal/src/main/python/semiwrap/DriverStationTypes_c.yml new file mode 100644 index 0000000000..7189fc01de --- /dev/null +++ b/hal/src/main/python/semiwrap/DriverStationTypes_c.yml @@ -0,0 +1,83 @@ +strip_prefixes: +- HAL_ + +extra_includes: +- src/ds_types_fmt.h + +enums: + HAL_AllianceStationID: + value_prefix: HAL_AllianceStationID + HAL_JoystickPOV: + value_prefix: HAL_JoystickPOV + HAL_MatchType: + value_prefix: HAL_kMatchType + HAL_RobotMode: + rename: _RobotMode + value_prefix: HAL_ROBOTMODE +classes: + HAL_ControlWord: + rename: _ControlWord + attributes: + value: + HAL_JoystickAxes: + attributes: + axes: + raw: + available: + HAL_JoystickPOVs: + attributes: + povs: + available: + HAL_JoystickButtons: + attributes: + buttons: + available: + HAL_JoystickDescriptor: + attributes: + supportedOutputs: + gamepadType: + name: + isGamepad: + HAL_MatchInfo: + attributes: + eventName: + matchType: + matchNumber: + replayNumber: + HAL_JoystickTouchpadFinger: + attributes: + down: + x: + y: + HAL_JoystickTouchpad: + attributes: + count: + fingers: + HAL_JoystickTouchpads: + attributes: + count: + touchpads: + HAL_OpModeOption: + attributes: + id: + name: + group: + description: + textColor: + backgroundColor: + HAL_GameData: + attributes: + gameData: +functions: + HAL_MakeControlWord: + HAL_ControlWord_GetOpModeHash: + HAL_ControlWord_GetOpModeId: + HAL_ControlWord_SetOpModeId: + HAL_ControlWord_GetRobotMode: + HAL_ControlWord_IsEnabled: + HAL_ControlWord_IsEStopped: + HAL_ControlWord_IsFMSAttached: + HAL_ControlWord_IsDSAttached: + HAL_MakeOpModeId: + HAL_OpMode_GetRobotMode: + HAL_OpMode_GetHash: diff --git a/hal/src/main/python/semiwrap/DriverStation_c.yml b/hal/src/main/python/semiwrap/DriverStation_c.yml new file mode 100644 index 0000000000..2328fdbe21 --- /dev/null +++ b/hal/src/main/python/semiwrap/DriverStation_c.yml @@ -0,0 +1,46 @@ +strip_prefixes: +- HAL_ + +functions: + HAL_SendError: + HAL_SetPrintErrorImpl: + ignore: true + HAL_SendConsoleLine: + HAL_GetControlWord: + ignore: true + HAL_GetAllianceStation: + HAL_GetJoystickAxes: + HAL_GetJoystickPOVs: + HAL_GetJoystickButtons: + HAL_GetAllJoystickData: + HAL_GetJoystickDescriptor: + HAL_GetJoystickGamepadType: + HAL_GetJoystickSupportedOutputs: + HAL_GetJoystickName: + param_override: + name: + ignore: true + cpp_code: | + [](int32_t joystickNum) { + WPI_String name; + HAL_GetJoystickName(&name, joystickNum); + std::string sname(wpi::util::to_string_view(&name)); + WPI_FreeString(&name); + return sname; + } + HAL_SetJoystickLeds: + HAL_SetJoystickRumble: + HAL_GetMatchTime: + HAL_GetOutputsEnabled: + HAL_GetMatchInfo: + HAL_RefreshDSData: + HAL_ProvideNewDataEventHandle: + HAL_RemoveNewDataEventHandle: + HAL_ObserveUserProgramStarting: + HAL_GetJoystickIsGamepad: + HAL_GetJoystickTouchpads: + HAL_GetUncachedControlWord: + ignore: true + HAL_SetOpModeOptions: + HAL_ObserveUserProgram: + HAL_GetGameData: diff --git a/hal/src/main/python/semiwrap/Notifier.yml b/hal/src/main/python/semiwrap/Notifier.yml index 660eb3a73d..21f32f7179 100644 --- a/hal/src/main/python/semiwrap/Notifier.yml +++ b/hal/src/main/python/semiwrap/Notifier.yml @@ -2,15 +2,4 @@ strip_prefixes: - HAL_ functions: - HAL_CreateNotifier: HAL_SetNotifierName: - overloads: - HAL_NotifierHandle, const struct WPI_String*, int32_t*: - ignore: true - HAL_NotifierHandle, std::string_view, int32_t*: - HAL_DestroyNotifier: - HAL_SetNotifierAlarm: - HAL_CancelNotifierAlarm: - HAL_GetNotifierOverrun: - HAL_AcknowledgeNotifierAlarm: - HAL_SetNotifierThreadPriority: diff --git a/hal/src/main/python/semiwrap/Notifier_c.yml b/hal/src/main/python/semiwrap/Notifier_c.yml new file mode 100644 index 0000000000..6bb7b0273f --- /dev/null +++ b/hal/src/main/python/semiwrap/Notifier_c.yml @@ -0,0 +1,13 @@ +strip_prefixes: +- HAL_ + +functions: + HAL_CreateNotifier: + HAL_SetNotifierName: + ignore: true + HAL_DestroyNotifier: + HAL_SetNotifierAlarm: + HAL_CancelNotifierAlarm: + HAL_GetNotifierOverrun: + HAL_AcknowledgeNotifierAlarm: + HAL_SetNotifierThreadPriority: diff --git a/hal/src/main/python/semiwrap/SimDevice.yml b/hal/src/main/python/semiwrap/SimDevice.yml index d6e93d0c6e..5f8be03904 100644 --- a/hal/src/main/python/semiwrap/SimDevice.yml +++ b/hal/src/main/python/semiwrap/SimDevice.yml @@ -8,8 +8,6 @@ extra_includes: strip_prefixes: - HAL_ -enums: - HAL_SimValueDirection: classes: wpi::hal::SimValue: doc: | diff --git a/hal/src/main/python/semiwrap/SimDevice_c.yml b/hal/src/main/python/semiwrap/SimDevice_c.yml new file mode 100644 index 0000000000..75e62a1062 --- /dev/null +++ b/hal/src/main/python/semiwrap/SimDevice_c.yml @@ -0,0 +1,13 @@ +defaults: + ignore: true + report_ignored_missing: false + +extra_includes: +- wpi/hal/simulation/SimDeviceData.h + +strip_prefixes: +- HAL_ + +enums: + HAL_SimValueDirection: + diff --git a/hal/src/main/python/semiwrap/UsageReporting.yml b/hal/src/main/python/semiwrap/UsageReporting.yml index 9b461b6ba3..1d19011676 100644 --- a/hal/src/main/python/semiwrap/UsageReporting.yml +++ b/hal/src/main/python/semiwrap/UsageReporting.yml @@ -4,7 +4,5 @@ strip_prefixes: functions: HAL_ReportUsage: overloads: - const struct WPI_String*, const struct WPI_String*: - ignore: true std::string_view, std::string_view: std::string_view, int, std::string_view: diff --git a/hal/src/main/python/semiwrap/simulation/MockHooks.yml b/hal/src/main/python/semiwrap/simulation/MockHooks.yml index 47d45a8475..9e27b72ca8 100644 --- a/hal/src/main/python/semiwrap/simulation/MockHooks.yml +++ b/hal/src/main/python/semiwrap/simulation/MockHooks.yml @@ -2,63 +2,6 @@ extra_includes: - sim_cb.h - pybind11/functional.h -strip_prefixes: -- HALSIM_ - functions: - HALSIM_SetRuntimeType: - HALSIM_WaitForProgramStart: - ignore: true - HALSIM_SetProgramStarted: - HALSIM_GetProgramStarted: - HALSIM_SetProgramState: - HALSIM_GetProgramState: SetProgramState: GetProgramState: - HALSIM_RestartTiming: - HALSIM_PauseTiming: - HALSIM_ResumeTiming: - HALSIM_IsTimingPaused: - HALSIM_StepTiming: - HALSIM_StepTimingAsync: - - # following functions are ignored for raw function pointers - - HALSIM_SetSendError: - ignore: true - HALSIM_SetSendConsoleLine: - ignore: true - - HALSIM_RegisterSimPeriodicBeforeCallback: - param_override: - param: - ignore: true - cpp_code: | - [](std::function fn) -> std::unique_ptr { - auto cb = std::make_unique(fn, HALSIM_CancelSimPeriodicBeforeCallback); - auto uid = HALSIM_RegisterSimPeriodicBeforeCallback([](void *param) { - ((SimCB*)param)->m_fn(); - }, cb.get()); - cb->SetUID(uid); - return std::move(cb); - } - HALSIM_CancelSimPeriodicBeforeCallback: - ignore: true - - HALSIM_RegisterSimPeriodicAfterCallback: - param_override: - param: - ignore: true - cpp_code: | - [](std::function fn) -> std::unique_ptr { - auto cb = std::make_unique(fn, HALSIM_CancelSimPeriodicAfterCallback); - auto uid = HALSIM_RegisterSimPeriodicAfterCallback([](void *param) { - ((SimCB*)param)->m_fn(); - }, cb.get()); - cb->SetUID(uid); - return std::move(cb); - } - HALSIM_CancelSimPeriodicAfterCallback: - ignore: true - - HALSIM_CancelAllSimPeriodicCallbacks: diff --git a/hal/src/main/python/semiwrap/simulation/MockHooks_c.yml b/hal/src/main/python/semiwrap/simulation/MockHooks_c.yml new file mode 100644 index 0000000000..61cc1f4d63 --- /dev/null +++ b/hal/src/main/python/semiwrap/simulation/MockHooks_c.yml @@ -0,0 +1,62 @@ +extra_includes: +- sim_cb.h +- pybind11/functional.h + +strip_prefixes: +- HALSIM_ + +functions: + HALSIM_SetRuntimeType: + HALSIM_WaitForProgramStart: + ignore: true + HALSIM_SetProgramStarted: + HALSIM_GetProgramStarted: + HALSIM_SetProgramState: + HALSIM_GetProgramState: + HALSIM_RestartTiming: + HALSIM_PauseTiming: + HALSIM_ResumeTiming: + HALSIM_IsTimingPaused: + HALSIM_StepTiming: + HALSIM_StepTimingAsync: + + # following functions are ignored for raw function pointers + + HALSIM_SetSendError: + ignore: true + HALSIM_SetSendConsoleLine: + ignore: true + + HALSIM_RegisterSimPeriodicBeforeCallback: + param_override: + param: + ignore: true + cpp_code: | + [](std::function fn) -> std::unique_ptr { + auto cb = std::make_unique(fn, HALSIM_CancelSimPeriodicBeforeCallback); + auto uid = HALSIM_RegisterSimPeriodicBeforeCallback([](void *param) { + ((SimCB*)param)->m_fn(); + }, cb.get()); + cb->SetUID(uid); + return std::move(cb); + } + HALSIM_CancelSimPeriodicBeforeCallback: + ignore: true + + HALSIM_RegisterSimPeriodicAfterCallback: + param_override: + param: + ignore: true + cpp_code: | + [](std::function fn) -> std::unique_ptr { + auto cb = std::make_unique(fn, HALSIM_CancelSimPeriodicAfterCallback); + auto uid = HALSIM_RegisterSimPeriodicAfterCallback([](void *param) { + ((SimCB*)param)->m_fn(); + }, cb.get()); + cb->SetUID(uid); + return std::move(cb); + } + HALSIM_CancelSimPeriodicAfterCallback: + ignore: true + + HALSIM_CancelAllSimPeriodicCallbacks: diff --git a/hal/src/main/python/semiwrap/simulation/SimDeviceData.yml b/hal/src/main/python/semiwrap/simulation/SimDeviceData.yml index a20a28413d..3e8550e265 100644 --- a/hal/src/main/python/semiwrap/simulation/SimDeviceData.yml +++ b/hal/src/main/python/semiwrap/simulation/SimDeviceData.yml @@ -1,6 +1,7 @@ extra_includes: - sim_value_cb.h - pybind11/functional.h +- wpi/hal/SimDevice.hpp strip_prefixes: - HALSIM_ diff --git a/hal/src/test/native/cpp/handles/HandleTest.cpp b/hal/src/test/native/cpp/handles/HandleTest.cpp index b13f359e43..9f75059a3d 100644 --- a/hal/src/test/native/cpp/handles/HandleTest.cpp +++ b/hal/src/test/native/cpp/handles/HandleTest.cpp @@ -6,7 +6,7 @@ #include -#include "wpi/hal/handles/IndexedClassedHandleResource.h" +#include "wpi/hal/handles/IndexedClassedHandleResource.hpp" #define HAL_TestHandle HAL_Handle diff --git a/hal/src/test/native/cpp/mockdata/AnalogInDataTest.cpp b/hal/src/test/native/cpp/mockdata/AnalogInDataTest.cpp index 15e799c5c6..ccc5fc1a65 100644 --- a/hal/src/test/native/cpp/mockdata/AnalogInDataTest.cpp +++ b/hal/src/test/native/cpp/mockdata/AnalogInDataTest.cpp @@ -10,7 +10,7 @@ #include "wpi/hal/AnalogInput.h" #include "wpi/hal/HAL.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" namespace wpi::hal { diff --git a/hal/src/test/native/cpp/mockdata/DIODataTest.cpp b/hal/src/test/native/cpp/mockdata/DIODataTest.cpp index 4b4e7f2b81..542e140179 100644 --- a/hal/src/test/native/cpp/mockdata/DIODataTest.cpp +++ b/hal/src/test/native/cpp/mockdata/DIODataTest.cpp @@ -10,7 +10,7 @@ #include "wpi/hal/DIO.h" #include "wpi/hal/HAL.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" namespace wpi::hal { diff --git a/hal/src/test/native/cpp/mockdata/PCMDataTest.cpp b/hal/src/test/native/cpp/mockdata/PCMDataTest.cpp index 89c2045bf4..0a29359797 100644 --- a/hal/src/test/native/cpp/mockdata/PCMDataTest.cpp +++ b/hal/src/test/native/cpp/mockdata/PCMDataTest.cpp @@ -8,7 +8,7 @@ #include "wpi/hal/CTREPCM.h" #include "wpi/hal/HAL.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" #include "wpi/hal/simulation/CTREPCMData.h" namespace wpi::hal { diff --git a/hal/src/test/native/cpp/mockdata/PWMDataTest.cpp b/hal/src/test/native/cpp/mockdata/PWMDataTest.cpp index ec86d9fd9f..d5182dcb7a 100644 --- a/hal/src/test/native/cpp/mockdata/PWMDataTest.cpp +++ b/hal/src/test/native/cpp/mockdata/PWMDataTest.cpp @@ -10,7 +10,7 @@ #include "wpi/hal/HAL.h" #include "wpi/hal/PWM.h" -#include "wpi/hal/handles/HandlesInternal.h" +#include "wpi/hal/handles/HandlesInternal.hpp" namespace wpi::hal { diff --git a/romiVendordep/src/main/native/include/wpi/romi/RomiGyro.hpp b/romiVendordep/src/main/native/include/wpi/romi/RomiGyro.hpp index 3179b784a9..f179745105 100644 --- a/romiVendordep/src/main/native/include/wpi/romi/RomiGyro.hpp +++ b/romiVendordep/src/main/native/include/wpi/romi/RomiGyro.hpp @@ -4,7 +4,7 @@ #pragma once -#include "wpi/hal/SimDevice.h" +#include "wpi/hal/SimDevice.hpp" #include "wpi/units/angle.hpp" #include "wpi/units/angular_velocity.hpp" diff --git a/simulation/halsim_gui/src/main/native/cpp/DriverStationGui.cpp b/simulation/halsim_gui/src/main/native/cpp/DriverStationGui.cpp index 55d813a0d8..3c20051d6a 100644 --- a/simulation/halsim_gui/src/main/native/cpp/DriverStationGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/DriverStationGui.cpp @@ -25,9 +25,9 @@ #include "wpi/glass/support/NameSetting.hpp" #include "wpi/gui/wpigui.hpp" #include "wpi/hal/DashboardOpMode.hpp" -#include "wpi/hal/DriverStationTypes.h" +#include "wpi/hal/DriverStationTypes.hpp" #include "wpi/hal/simulation/DriverStationData.h" -#include "wpi/hal/simulation/MockHooks.h" +#include "wpi/hal/simulation/MockHooks.hpp" #include "wpi/halsim/gui/HALDataSource.hpp" #include "wpi/halsim/gui/HALSimGui.hpp" #include "wpi/util/SmallVector.hpp" diff --git a/simulation/halsim_gui/src/main/native/cpp/SimDeviceGui.cpp b/simulation/halsim_gui/src/main/native/cpp/SimDeviceGui.cpp index 9aa3a7605d..5b6e65e349 100644 --- a/simulation/halsim_gui/src/main/native/cpp/SimDeviceGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/SimDeviceGui.cpp @@ -12,7 +12,7 @@ #include #include "wpi/glass/other/DeviceTree.hpp" -#include "wpi/hal/SimDevice.h" +#include "wpi/hal/SimDevice.hpp" #include "wpi/hal/simulation/SimDeviceData.h" #include "wpi/halsim/gui/HALDataSource.hpp" #include "wpi/halsim/gui/HALSimGui.hpp" diff --git a/wpilibc/src/generate/main/native/cpp/driverstation/hid.cpp.jinja b/wpilibc/src/generate/main/native/cpp/driverstation/hid.cpp.jinja index a59dc80e9e..3c9faaba1c 100644 --- a/wpilibc/src/generate/main/native/cpp/driverstation/hid.cpp.jinja +++ b/wpilibc/src/generate/main/native/cpp/driverstation/hid.cpp.jinja @@ -8,7 +8,7 @@ {%- endmacro %} #include "wpi/driverstation/{{ ConsoleName }}Controller.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" #include "wpi/event/BooleanEvent.hpp" diff --git a/wpilibc/src/generate/main/native/cpp/hardware/motor/pwm_motor_controller.cpp.jinja b/wpilibc/src/generate/main/native/cpp/hardware/motor/pwm_motor_controller.cpp.jinja index d6e79633b4..5a57cdbd80 100644 --- a/wpilibc/src/generate/main/native/cpp/hardware/motor/pwm_motor_controller.cpp.jinja +++ b/wpilibc/src/generate/main/native/cpp/hardware/motor/pwm_motor_controller.cpp.jinja @@ -6,7 +6,7 @@ #include "wpi/hardware/motor/{{ name }}.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" using namespace wpi; diff --git a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS4Controller.cpp b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS4Controller.cpp index e9eb3c1b3f..cbdf8d93af 100644 --- a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS4Controller.cpp +++ b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS4Controller.cpp @@ -6,7 +6,7 @@ #include "wpi/driverstation/NiDsPS4Controller.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" #include "wpi/event/BooleanEvent.hpp" diff --git a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS5Controller.cpp b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS5Controller.cpp index 4221925d4a..b97dfc45ee 100644 --- a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS5Controller.cpp +++ b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS5Controller.cpp @@ -6,7 +6,7 @@ #include "wpi/driverstation/NiDsPS5Controller.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" #include "wpi/event/BooleanEvent.hpp" diff --git a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsStadiaController.cpp b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsStadiaController.cpp index 1dd6aa23cd..c288eba932 100644 --- a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsStadiaController.cpp +++ b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsStadiaController.cpp @@ -6,7 +6,7 @@ #include "wpi/driverstation/NiDsStadiaController.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" #include "wpi/event/BooleanEvent.hpp" diff --git a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsXboxController.cpp b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsXboxController.cpp index 91baffb900..3522824132 100644 --- a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsXboxController.cpp +++ b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsXboxController.cpp @@ -6,7 +6,7 @@ #include "wpi/driverstation/NiDsXboxController.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" #include "wpi/event/BooleanEvent.hpp" diff --git a/wpilibc/src/generated/main/native/cpp/hardware/motor/Koors40.cpp b/wpilibc/src/generated/main/native/cpp/hardware/motor/Koors40.cpp index 9c84583187..1e3f4f3496 100644 --- a/wpilibc/src/generated/main/native/cpp/hardware/motor/Koors40.cpp +++ b/wpilibc/src/generated/main/native/cpp/hardware/motor/Koors40.cpp @@ -6,7 +6,7 @@ #include "wpi/hardware/motor/Koors40.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" using namespace wpi; diff --git a/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMSparkFlex.cpp b/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMSparkFlex.cpp index ccac0bb37d..7314019003 100644 --- a/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMSparkFlex.cpp +++ b/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMSparkFlex.cpp @@ -6,7 +6,7 @@ #include "wpi/hardware/motor/PWMSparkFlex.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" using namespace wpi; diff --git a/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMSparkMax.cpp b/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMSparkMax.cpp index bf915255f1..8bd56e5008 100644 --- a/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMSparkMax.cpp +++ b/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMSparkMax.cpp @@ -6,7 +6,7 @@ #include "wpi/hardware/motor/PWMSparkMax.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" using namespace wpi; diff --git a/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMTalonFX.cpp b/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMTalonFX.cpp index 24d0fdcf42..dc4de3897d 100644 --- a/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMTalonFX.cpp +++ b/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMTalonFX.cpp @@ -6,7 +6,7 @@ #include "wpi/hardware/motor/PWMTalonFX.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" using namespace wpi; diff --git a/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMTalonSRX.cpp b/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMTalonSRX.cpp index 35bd165d58..6429bd5b2b 100644 --- a/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMTalonSRX.cpp +++ b/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMTalonSRX.cpp @@ -6,7 +6,7 @@ #include "wpi/hardware/motor/PWMTalonSRX.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" using namespace wpi; diff --git a/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMVenom.cpp b/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMVenom.cpp index 28b182a1b7..45935f6b74 100644 --- a/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMVenom.cpp +++ b/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMVenom.cpp @@ -6,7 +6,7 @@ #include "wpi/hardware/motor/PWMVenom.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" using namespace wpi; diff --git a/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMVictorSPX.cpp b/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMVictorSPX.cpp index 7585ae5d31..0365239b69 100644 --- a/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMVictorSPX.cpp +++ b/wpilibc/src/generated/main/native/cpp/hardware/motor/PWMVictorSPX.cpp @@ -6,7 +6,7 @@ #include "wpi/hardware/motor/PWMVictorSPX.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" using namespace wpi; diff --git a/wpilibc/src/generated/main/native/cpp/hardware/motor/Spark.cpp b/wpilibc/src/generated/main/native/cpp/hardware/motor/Spark.cpp index a77800b755..88d5cffd30 100644 --- a/wpilibc/src/generated/main/native/cpp/hardware/motor/Spark.cpp +++ b/wpilibc/src/generated/main/native/cpp/hardware/motor/Spark.cpp @@ -6,7 +6,7 @@ #include "wpi/hardware/motor/Spark.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" using namespace wpi; diff --git a/wpilibc/src/generated/main/native/cpp/hardware/motor/SparkMini.cpp b/wpilibc/src/generated/main/native/cpp/hardware/motor/SparkMini.cpp index 38ddcb3801..dfebebb06a 100644 --- a/wpilibc/src/generated/main/native/cpp/hardware/motor/SparkMini.cpp +++ b/wpilibc/src/generated/main/native/cpp/hardware/motor/SparkMini.cpp @@ -6,7 +6,7 @@ #include "wpi/hardware/motor/SparkMini.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" using namespace wpi; diff --git a/wpilibc/src/generated/main/native/cpp/hardware/motor/Talon.cpp b/wpilibc/src/generated/main/native/cpp/hardware/motor/Talon.cpp index bfc03a7a19..7e5f766f25 100644 --- a/wpilibc/src/generated/main/native/cpp/hardware/motor/Talon.cpp +++ b/wpilibc/src/generated/main/native/cpp/hardware/motor/Talon.cpp @@ -6,7 +6,7 @@ #include "wpi/hardware/motor/Talon.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" using namespace wpi; diff --git a/wpilibc/src/generated/main/native/cpp/hardware/motor/VictorSP.cpp b/wpilibc/src/generated/main/native/cpp/hardware/motor/VictorSP.cpp index c15abe7243..c4e4681eb1 100644 --- a/wpilibc/src/generated/main/native/cpp/hardware/motor/VictorSP.cpp +++ b/wpilibc/src/generated/main/native/cpp/hardware/motor/VictorSP.cpp @@ -6,7 +6,7 @@ #include "wpi/hardware/motor/VictorSP.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" using namespace wpi; diff --git a/wpilibc/src/main/native/cpp/counter/Tachometer.cpp b/wpilibc/src/main/native/cpp/counter/Tachometer.cpp index f41c2d1abe..d7e6c09dba 100644 --- a/wpilibc/src/main/native/cpp/counter/Tachometer.cpp +++ b/wpilibc/src/main/native/cpp/counter/Tachometer.cpp @@ -7,7 +7,7 @@ #include #include "wpi/hal/Counter.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" #include "wpi/util/StackTrace.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" diff --git a/wpilibc/src/main/native/cpp/counter/UpDownCounter.cpp b/wpilibc/src/main/native/cpp/counter/UpDownCounter.cpp index a3af24c72d..a733095738 100644 --- a/wpilibc/src/main/native/cpp/counter/UpDownCounter.cpp +++ b/wpilibc/src/main/native/cpp/counter/UpDownCounter.cpp @@ -4,11 +4,10 @@ #include "wpi/counter/UpDownCounter.hpp" -#include #include #include "wpi/hal/Counter.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" #include "wpi/util/StackTrace.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" diff --git a/wpilibc/src/main/native/cpp/drive/DifferentialDrive.cpp b/wpilibc/src/main/native/cpp/drive/DifferentialDrive.cpp index 0630209fdc..5ed3bf8a9e 100644 --- a/wpilibc/src/main/native/cpp/drive/DifferentialDrive.cpp +++ b/wpilibc/src/main/native/cpp/drive/DifferentialDrive.cpp @@ -9,7 +9,7 @@ #include #include -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/hardware/motor/MotorController.hpp" #include "wpi/math/util/MathUtil.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" diff --git a/wpilibc/src/main/native/cpp/drive/MecanumDrive.cpp b/wpilibc/src/main/native/cpp/drive/MecanumDrive.cpp index db0710fdb2..9333e9e57f 100644 --- a/wpilibc/src/main/native/cpp/drive/MecanumDrive.cpp +++ b/wpilibc/src/main/native/cpp/drive/MecanumDrive.cpp @@ -8,7 +8,7 @@ #include #include -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/hardware/motor/MotorController.hpp" #include "wpi/math/geometry/Translation2d.hpp" #include "wpi/math/util/MathUtil.hpp" diff --git a/wpilibc/src/main/native/cpp/driverstation/Gamepad.cpp b/wpilibc/src/main/native/cpp/driverstation/Gamepad.cpp index d4c2b6626b..d225f13645 100644 --- a/wpilibc/src/main/native/cpp/driverstation/Gamepad.cpp +++ b/wpilibc/src/main/native/cpp/driverstation/Gamepad.cpp @@ -5,7 +5,7 @@ #include "wpi/driverstation/Gamepad.hpp" #include "wpi/event/BooleanEvent.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" using namespace wpi; diff --git a/wpilibc/src/main/native/cpp/driverstation/Joystick.cpp b/wpilibc/src/main/native/cpp/driverstation/Joystick.cpp index 1c21c3c3f9..a96224caec 100644 --- a/wpilibc/src/main/native/cpp/driverstation/Joystick.cpp +++ b/wpilibc/src/main/native/cpp/driverstation/Joystick.cpp @@ -7,7 +7,7 @@ #include #include "wpi/event/BooleanEvent.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" using namespace wpi; diff --git a/wpilibc/src/main/native/cpp/framework/OpModeRobot.cpp b/wpilibc/src/main/native/cpp/framework/OpModeRobot.cpp index 6fff49cf3a..7cbb3e4566 100644 --- a/wpilibc/src/main/native/cpp/framework/OpModeRobot.cpp +++ b/wpilibc/src/main/native/cpp/framework/OpModeRobot.cpp @@ -16,7 +16,7 @@ #include "wpi/hal/DriverStation.h" #include "wpi/hal/DriverStationTypes.h" #include "wpi/hal/HALBase.h" -#include "wpi/hal/Notifier.h" +#include "wpi/hal/Notifier.hpp" #include "wpi/opmode/OpMode.hpp" #include "wpi/util/SafeThread.hpp" #include "wpi/util/Synchronization.h" diff --git a/wpilibc/src/main/native/cpp/framework/TimedRobot.cpp b/wpilibc/src/main/native/cpp/framework/TimedRobot.cpp index bc4429f89e..c5ca97188c 100644 --- a/wpilibc/src/main/native/cpp/framework/TimedRobot.cpp +++ b/wpilibc/src/main/native/cpp/framework/TimedRobot.cpp @@ -10,8 +10,8 @@ #include #include "wpi/hal/DriverStation.h" -#include "wpi/hal/Notifier.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/Notifier.hpp" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" using namespace wpi; diff --git a/wpilibc/src/main/native/cpp/hardware/accelerometer/ADXL345_I2C.cpp b/wpilibc/src/main/native/cpp/hardware/accelerometer/ADXL345_I2C.cpp index 65875661b2..cab4b92e92 100644 --- a/wpilibc/src/main/native/cpp/hardware/accelerometer/ADXL345_I2C.cpp +++ b/wpilibc/src/main/native/cpp/hardware/accelerometer/ADXL345_I2C.cpp @@ -4,7 +4,7 @@ #include "wpi/hardware/accelerometer/ADXL345_I2C.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/nt/DoubleTopic.hpp" #include "wpi/nt/NTSendableBuilder.hpp" #include "wpi/util/sendable/SendableRegistry.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/accelerometer/AnalogAccelerometer.cpp b/wpilibc/src/main/native/cpp/hardware/accelerometer/AnalogAccelerometer.cpp index 66742492a0..34eaeffb29 100644 --- a/wpilibc/src/main/native/cpp/hardware/accelerometer/AnalogAccelerometer.cpp +++ b/wpilibc/src/main/native/cpp/hardware/accelerometer/AnalogAccelerometer.cpp @@ -4,7 +4,7 @@ #include "wpi/hardware/accelerometer/AnalogAccelerometer.hpp" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" #include "wpi/util/NullDeleter.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/bus/CAN.cpp b/wpilibc/src/main/native/cpp/hardware/bus/CAN.cpp index 7acd84e65c..e92d779390 100644 --- a/wpilibc/src/main/native/cpp/hardware/bus/CAN.cpp +++ b/wpilibc/src/main/native/cpp/hardware/bus/CAN.cpp @@ -4,12 +4,10 @@ #include "wpi/hardware/bus/CAN.hpp" -#include - #include "wpi/hal/CAN.h" #include "wpi/hal/CANAPI.h" #include "wpi/hal/Errors.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" using namespace wpi; diff --git a/wpilibc/src/main/native/cpp/hardware/bus/I2C.cpp b/wpilibc/src/main/native/cpp/hardware/bus/I2C.cpp index 115de93780..5b71410df4 100644 --- a/wpilibc/src/main/native/cpp/hardware/bus/I2C.cpp +++ b/wpilibc/src/main/native/cpp/hardware/bus/I2C.cpp @@ -7,7 +7,7 @@ #include #include "wpi/hal/I2C.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" using namespace wpi; diff --git a/wpilibc/src/main/native/cpp/hardware/bus/SerialPort.cpp b/wpilibc/src/main/native/cpp/hardware/bus/SerialPort.cpp index 0229d71bf2..9a3093bdab 100644 --- a/wpilibc/src/main/native/cpp/hardware/bus/SerialPort.cpp +++ b/wpilibc/src/main/native/cpp/hardware/bus/SerialPort.cpp @@ -7,7 +7,7 @@ #include #include "wpi/hal/SerialPort.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" using namespace wpi; diff --git a/wpilibc/src/main/native/cpp/hardware/discrete/AnalogInput.cpp b/wpilibc/src/main/native/cpp/hardware/discrete/AnalogInput.cpp index 2d86526a4b..61b8705903 100644 --- a/wpilibc/src/main/native/cpp/hardware/discrete/AnalogInput.cpp +++ b/wpilibc/src/main/native/cpp/hardware/discrete/AnalogInput.cpp @@ -7,11 +7,8 @@ #include #include "wpi/hal/AnalogInput.h" -#include "wpi/hal/HALBase.h" -#include "wpi/hal/Ports.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" -#include "wpi/system/Timer.hpp" #include "wpi/util/SensorUtil.hpp" #include "wpi/util/StackTrace.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/discrete/DigitalInput.cpp b/wpilibc/src/main/native/cpp/hardware/discrete/DigitalInput.cpp index 04739bc8ec..4b4210a745 100644 --- a/wpilibc/src/main/native/cpp/hardware/discrete/DigitalInput.cpp +++ b/wpilibc/src/main/native/cpp/hardware/discrete/DigitalInput.cpp @@ -7,9 +7,7 @@ #include #include "wpi/hal/DIO.h" -#include "wpi/hal/HALBase.h" -#include "wpi/hal/Ports.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" #include "wpi/util/SensorUtil.hpp" #include "wpi/util/StackTrace.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/discrete/DigitalOutput.cpp b/wpilibc/src/main/native/cpp/hardware/discrete/DigitalOutput.cpp index 8b7615c5f7..bd5a0a9f9a 100644 --- a/wpilibc/src/main/native/cpp/hardware/discrete/DigitalOutput.cpp +++ b/wpilibc/src/main/native/cpp/hardware/discrete/DigitalOutput.cpp @@ -7,9 +7,7 @@ #include #include "wpi/hal/DIO.h" -#include "wpi/hal/HALBase.h" -#include "wpi/hal/Ports.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" #include "wpi/util/SensorUtil.hpp" #include "wpi/util/StackTrace.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/discrete/PWM.cpp b/wpilibc/src/main/native/cpp/hardware/discrete/PWM.cpp index b0a0c234e6..ef14596982 100644 --- a/wpilibc/src/main/native/cpp/hardware/discrete/PWM.cpp +++ b/wpilibc/src/main/native/cpp/hardware/discrete/PWM.cpp @@ -4,12 +4,8 @@ #include "wpi/hardware/discrete/PWM.hpp" -#include - -#include "wpi/hal/HALBase.h" #include "wpi/hal/PWM.h" -#include "wpi/hal/Ports.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" #include "wpi/util/SensorUtil.hpp" #include "wpi/util/StackTrace.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/expansionhub/ExpansionHub.cpp b/wpilibc/src/main/native/cpp/hardware/expansionhub/ExpansionHub.cpp index 6e49163af4..adf197636f 100644 --- a/wpilibc/src/main/native/cpp/hardware/expansionhub/ExpansionHub.cpp +++ b/wpilibc/src/main/native/cpp/hardware/expansionhub/ExpansionHub.cpp @@ -6,7 +6,7 @@ #include -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/hardware/expansionhub/ExpansionHubMotor.hpp" #include "wpi/hardware/expansionhub/ExpansionHubServo.hpp" #include "wpi/nt/BooleanTopic.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/led/AddressableLED.cpp b/wpilibc/src/main/native/cpp/hardware/led/AddressableLED.cpp index 3aec5cdc0c..278a55e48f 100644 --- a/wpilibc/src/main/native/cpp/hardware/led/AddressableLED.cpp +++ b/wpilibc/src/main/native/cpp/hardware/led/AddressableLED.cpp @@ -7,10 +7,7 @@ #include #include "wpi/hal/AddressableLED.h" -#include "wpi/hal/HALBase.h" -#include "wpi/hal/PWM.h" -#include "wpi/hal/Ports.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" #include "wpi/util/SensorUtil.hpp" #include "wpi/util/StackTrace.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/led/LEDPattern.cpp b/wpilibc/src/main/native/cpp/hardware/led/LEDPattern.cpp index 05bd5c698e..45a519ad93 100644 --- a/wpilibc/src/main/native/cpp/hardware/led/LEDPattern.cpp +++ b/wpilibc/src/main/native/cpp/hardware/led/LEDPattern.cpp @@ -11,7 +11,7 @@ #include #include -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/math/util/MathUtil.hpp" #include "wpi/util/MathExtras.hpp" #include "wpi/util/timestamp.h" diff --git a/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticHub.cpp b/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticHub.cpp index 1973238acf..9a4e715cd8 100644 --- a/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticHub.cpp +++ b/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticHub.cpp @@ -11,10 +11,9 @@ #include -#include "wpi/framework/RobotBase.hpp" #include "wpi/hal/Ports.h" #include "wpi/hal/REVPH.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/hardware/pneumatic/Compressor.hpp" #include "wpi/hardware/pneumatic/DoubleSolenoid.hpp" #include "wpi/hardware/pneumatic/Solenoid.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticsControlModule.cpp b/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticsControlModule.cpp index 94f56a10cc..7dc6412fd1 100644 --- a/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticsControlModule.cpp +++ b/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticsControlModule.cpp @@ -11,7 +11,7 @@ #include "wpi/hal/CTREPCM.h" #include "wpi/hal/Ports.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/hardware/pneumatic/Compressor.hpp" #include "wpi/hardware/pneumatic/DoubleSolenoid.hpp" #include "wpi/hardware/pneumatic/Solenoid.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/power/PowerDistribution.cpp b/wpilibc/src/main/native/cpp/hardware/power/PowerDistribution.cpp index 4f32f216cc..0295c87b4a 100644 --- a/wpilibc/src/main/native/cpp/hardware/power/PowerDistribution.cpp +++ b/wpilibc/src/main/native/cpp/hardware/power/PowerDistribution.cpp @@ -8,9 +8,8 @@ #include -#include "wpi/hal/Ports.h" #include "wpi/hal/PowerDistribution.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" #include "wpi/util/StackTrace.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/range/SharpIR.cpp b/wpilibc/src/main/native/cpp/hardware/range/SharpIR.cpp index cececa4e32..3aa048b2a9 100644 --- a/wpilibc/src/main/native/cpp/hardware/range/SharpIR.cpp +++ b/wpilibc/src/main/native/cpp/hardware/range/SharpIR.cpp @@ -6,7 +6,7 @@ #include -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/hardware/discrete/AnalogInput.hpp" #include "wpi/units/length.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/rotation/AnalogEncoder.cpp b/wpilibc/src/main/native/cpp/hardware/rotation/AnalogEncoder.cpp index 610d1d586c..7a930c275d 100644 --- a/wpilibc/src/main/native/cpp/hardware/rotation/AnalogEncoder.cpp +++ b/wpilibc/src/main/native/cpp/hardware/rotation/AnalogEncoder.cpp @@ -6,7 +6,7 @@ #include -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/hardware/discrete/AnalogInput.hpp" #include "wpi/math/util/MathUtil.hpp" #include "wpi/system/RobotController.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/rotation/DutyCycle.cpp b/wpilibc/src/main/native/cpp/hardware/rotation/DutyCycle.cpp index b1cad04020..bdb1b49d9c 100644 --- a/wpilibc/src/main/native/cpp/hardware/rotation/DutyCycle.cpp +++ b/wpilibc/src/main/native/cpp/hardware/rotation/DutyCycle.cpp @@ -5,13 +5,10 @@ #include "wpi/hardware/rotation/DutyCycle.hpp" #include -#include #include "wpi/hal/DutyCycle.h" -#include "wpi/hal/HALBase.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" -#include "wpi/util/NullDeleter.hpp" #include "wpi/util/SensorUtil.hpp" #include "wpi/util/StackTrace.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" diff --git a/wpilibc/src/main/native/cpp/hardware/rotation/Encoder.cpp b/wpilibc/src/main/native/cpp/hardware/rotation/Encoder.cpp index e2e182327c..246e89988b 100644 --- a/wpilibc/src/main/native/cpp/hardware/rotation/Encoder.cpp +++ b/wpilibc/src/main/native/cpp/hardware/rotation/Encoder.cpp @@ -4,14 +4,9 @@ #include "wpi/hardware/rotation/Encoder.hpp" -#include -#include - #include "wpi/hal/Encoder.h" -#include "wpi/hal/UsageReporting.h" -#include "wpi/hardware/discrete/DigitalInput.hpp" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/system/Errors.hpp" -#include "wpi/util/NullDeleter.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" #include "wpi/util/sendable/SendableRegistry.hpp" diff --git a/wpilibc/src/main/native/cpp/opmode/PeriodicOpMode.cpp b/wpilibc/src/main/native/cpp/opmode/PeriodicOpMode.cpp index d77b0f587b..e5348ecaef 100644 --- a/wpilibc/src/main/native/cpp/opmode/PeriodicOpMode.cpp +++ b/wpilibc/src/main/native/cpp/opmode/PeriodicOpMode.cpp @@ -8,7 +8,8 @@ #include "wpi/driverstation/DriverStation.hpp" #include "wpi/hal/DriverStation.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/Notifier.hpp" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/nt/NetworkTableInstance.hpp" #include "wpi/smartdashboard/SmartDashboard.hpp" #include "wpi/system/Errors.hpp" diff --git a/wpilibc/src/main/native/cpp/simulation/SimHooks.cpp b/wpilibc/src/main/native/cpp/simulation/SimHooks.cpp index fa6d46351b..803836558c 100644 --- a/wpilibc/src/main/native/cpp/simulation/SimHooks.cpp +++ b/wpilibc/src/main/native/cpp/simulation/SimHooks.cpp @@ -4,7 +4,7 @@ #include "wpi/simulation/SimHooks.hpp" -#include "wpi/hal/simulation/MockHooks.h" +#include "wpi/hal/simulation/MockHooks.hpp" namespace wpi::sim { diff --git a/wpilibc/src/main/native/cpp/smartdashboard/SmartDashboard.cpp b/wpilibc/src/main/native/cpp/smartdashboard/SmartDashboard.cpp index a84d7b04bf..63a2b433a2 100644 --- a/wpilibc/src/main/native/cpp/smartdashboard/SmartDashboard.cpp +++ b/wpilibc/src/main/native/cpp/smartdashboard/SmartDashboard.cpp @@ -9,7 +9,7 @@ #include #include -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/nt/NetworkTable.hpp" #include "wpi/nt/NetworkTableInstance.hpp" #include "wpi/smartdashboard/ListenerExecutor.hpp" diff --git a/wpilibc/src/main/native/cpp/system/Notifier.cpp b/wpilibc/src/main/native/cpp/system/Notifier.cpp index f2592f78a6..b4e4e0b44d 100644 --- a/wpilibc/src/main/native/cpp/system/Notifier.cpp +++ b/wpilibc/src/main/native/cpp/system/Notifier.cpp @@ -7,7 +7,7 @@ #include #include "wpi/hal/DriverStation.h" -#include "wpi/hal/Notifier.h" +#include "wpi/hal/Notifier.hpp" #include "wpi/hal/Threads.h" #include "wpi/system/Errors.hpp" #include "wpi/util/Synchronization.h" diff --git a/wpilibc/src/main/native/cpp/system/Watchdog.cpp b/wpilibc/src/main/native/cpp/system/Watchdog.cpp index 01492fec3a..46fd643a92 100644 --- a/wpilibc/src/main/native/cpp/system/Watchdog.cpp +++ b/wpilibc/src/main/native/cpp/system/Watchdog.cpp @@ -12,7 +12,7 @@ #include #include "wpi/hal/HALBase.h" -#include "wpi/hal/Notifier.h" +#include "wpi/hal/Notifier.hpp" #include "wpi/system/Errors.hpp" #include "wpi/system/Timer.hpp" #include "wpi/util/Synchronization.h" diff --git a/wpilibc/src/main/native/cpp/util/Preferences.cpp b/wpilibc/src/main/native/cpp/util/Preferences.cpp index 4122b8929e..e1350410d4 100644 --- a/wpilibc/src/main/native/cpp/util/Preferences.cpp +++ b/wpilibc/src/main/native/cpp/util/Preferences.cpp @@ -10,7 +10,7 @@ #include -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/nt/MultiSubscriber.hpp" #include "wpi/nt/NetworkTable.hpp" #include "wpi/nt/NetworkTableInstance.hpp" diff --git a/wpilibc/src/main/native/cppcs/RobotBase.cpp b/wpilibc/src/main/native/cppcs/RobotBase.cpp index 80b5a8eca0..ab96a24274 100644 --- a/wpilibc/src/main/native/cppcs/RobotBase.cpp +++ b/wpilibc/src/main/native/cppcs/RobotBase.cpp @@ -18,7 +18,7 @@ #include "wpi/cameraserver/CameraServerShared.hpp" #include "wpi/driverstation/DriverStation.hpp" #include "wpi/hal/HALBase.h" -#include "wpi/hal/UsageReporting.h" +#include "wpi/hal/UsageReporting.hpp" #include "wpi/math/util/MathShared.hpp" #include "wpi/nt/NetworkTable.hpp" #include "wpi/nt/NetworkTableInstance.hpp" diff --git a/wpilibc/src/main/native/include/wpi/counter/Tachometer.hpp b/wpilibc/src/main/native/include/wpi/counter/Tachometer.hpp index 4b321d67a8..36ab5047be 100644 --- a/wpilibc/src/main/native/include/wpi/counter/Tachometer.hpp +++ b/wpilibc/src/main/native/include/wpi/counter/Tachometer.hpp @@ -4,11 +4,9 @@ #pragma once -#include - #include "EdgeConfiguration.hpp" #include "wpi/hal/Counter.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/Types.hpp" #include "wpi/units/angular_velocity.hpp" #include "wpi/units/frequency.hpp" #include "wpi/units/time.hpp" diff --git a/wpilibc/src/main/native/include/wpi/counter/UpDownCounter.hpp b/wpilibc/src/main/native/include/wpi/counter/UpDownCounter.hpp index 4a2b1339bd..003d8acf79 100644 --- a/wpilibc/src/main/native/include/wpi/counter/UpDownCounter.hpp +++ b/wpilibc/src/main/native/include/wpi/counter/UpDownCounter.hpp @@ -4,11 +4,9 @@ #pragma once -#include - #include "EdgeConfiguration.hpp" #include "wpi/hal/Counter.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/Types.hpp" #include "wpi/util/sendable/Sendable.hpp" #include "wpi/util/sendable/SendableHelper.hpp" diff --git a/wpilibc/src/main/native/include/wpi/driverstation/Alert.hpp b/wpilibc/src/main/native/include/wpi/driverstation/Alert.hpp index b32aac2dad..3a56f7babc 100644 --- a/wpilibc/src/main/native/include/wpi/driverstation/Alert.hpp +++ b/wpilibc/src/main/native/include/wpi/driverstation/Alert.hpp @@ -8,7 +8,7 @@ #include #include "wpi/hal/Alert.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/Types.hpp" namespace wpi { diff --git a/wpilibc/src/main/native/include/wpi/driverstation/DriverStation.hpp b/wpilibc/src/main/native/include/wpi/driverstation/DriverStation.hpp index 309e7a3283..5636178740 100644 --- a/wpilibc/src/main/native/include/wpi/driverstation/DriverStation.hpp +++ b/wpilibc/src/main/native/include/wpi/driverstation/DriverStation.hpp @@ -8,8 +8,8 @@ #include #include -#include "wpi/hal/DriverStation.h" -#include "wpi/hal/DriverStationTypes.h" +#include "wpi/hal/DriverStation.hpp" +#include "wpi/hal/DriverStationTypes.hpp" #include "wpi/math/geometry/Rotation2d.hpp" #include "wpi/units/time.hpp" #include "wpi/util/Synchronization.h" diff --git a/wpilibc/src/main/native/include/wpi/framework/OpModeRobot.hpp b/wpilibc/src/main/native/include/wpi/framework/OpModeRobot.hpp index a99ddc6021..f7ac88d900 100644 --- a/wpilibc/src/main/native/include/wpi/framework/OpModeRobot.hpp +++ b/wpilibc/src/main/native/include/wpi/framework/OpModeRobot.hpp @@ -11,8 +11,9 @@ #include #include "wpi/framework/RobotBase.hpp" -#include "wpi/hal/DriverStationTypes.h" +#include "wpi/hal/DriverStationTypes.hpp" #include "wpi/hal/Notifier.h" +#include "wpi/hal/Types.hpp" #include "wpi/opmode/OpMode.hpp" #include "wpi/util/DenseMap.hpp" #include "wpi/util/mutex.hpp" diff --git a/wpilibc/src/main/native/include/wpi/framework/TimedRobot.hpp b/wpilibc/src/main/native/include/wpi/framework/TimedRobot.hpp index 55dca9c5d2..6bc34ffc23 100644 --- a/wpilibc/src/main/native/include/wpi/framework/TimedRobot.hpp +++ b/wpilibc/src/main/native/include/wpi/framework/TimedRobot.hpp @@ -11,10 +11,9 @@ #include "wpi/framework/IterativeRobotBase.hpp" #include "wpi/hal/Notifier.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/Types.hpp" #include "wpi/system/RobotController.hpp" #include "wpi/units/frequency.hpp" -#include "wpi/units/math.hpp" #include "wpi/units/time.hpp" #include "wpi/util/priority_queue.hpp" diff --git a/wpilibc/src/main/native/include/wpi/hardware/accelerometer/ADXL345_I2C.hpp b/wpilibc/src/main/native/include/wpi/hardware/accelerometer/ADXL345_I2C.hpp index 197b5872ec..6e452282b2 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/accelerometer/ADXL345_I2C.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/accelerometer/ADXL345_I2C.hpp @@ -4,7 +4,7 @@ #pragma once -#include "wpi/hal/SimDevice.h" +#include "wpi/hal/SimDevice.hpp" #include "wpi/hardware/bus/I2C.hpp" #include "wpi/nt/NTSendable.hpp" #include "wpi/util/sendable/SendableHelper.hpp" diff --git a/wpilibc/src/main/native/include/wpi/hardware/bus/CAN.hpp b/wpilibc/src/main/native/include/wpi/hardware/bus/CAN.hpp index f8723f8585..2fc0ce79ed 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/bus/CAN.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/bus/CAN.hpp @@ -7,6 +7,7 @@ #include #include "wpi/hal/CANAPI.h" +#include "wpi/hal/Types.hpp" namespace wpi { diff --git a/wpilibc/src/main/native/include/wpi/hardware/bus/I2C.hpp b/wpilibc/src/main/native/include/wpi/hardware/bus/I2C.hpp index 0a5ce53389..7826cc39df 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/bus/I2C.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/bus/I2C.hpp @@ -8,6 +8,7 @@ #include "wpi/hal/I2C.h" #include "wpi/hal/I2CTypes.h" +#include "wpi/hal/Types.hpp" namespace wpi { diff --git a/wpilibc/src/main/native/include/wpi/hardware/bus/SerialPort.hpp b/wpilibc/src/main/native/include/wpi/hardware/bus/SerialPort.hpp index e19b318b37..28432d768a 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/bus/SerialPort.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/bus/SerialPort.hpp @@ -4,11 +4,10 @@ #pragma once -#include #include #include "wpi/hal/SerialPort.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/Types.hpp" #include "wpi/units/time.hpp" namespace wpi { diff --git a/wpilibc/src/main/native/include/wpi/hardware/discrete/AnalogInput.hpp b/wpilibc/src/main/native/include/wpi/hardware/discrete/AnalogInput.hpp index aa48471641..8fdbffa02e 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/discrete/AnalogInput.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/discrete/AnalogInput.hpp @@ -7,7 +7,7 @@ #include #include "wpi/hal/AnalogInput.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/Types.hpp" #include "wpi/util/sendable/Sendable.hpp" #include "wpi/util/sendable/SendableHelper.hpp" diff --git a/wpilibc/src/main/native/include/wpi/hardware/discrete/DigitalInput.hpp b/wpilibc/src/main/native/include/wpi/hardware/discrete/DigitalInput.hpp index fef8a3a7dd..5008c4404d 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/discrete/DigitalInput.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/discrete/DigitalInput.hpp @@ -5,6 +5,7 @@ #pragma once #include "wpi/hal/DIO.h" +#include "wpi/hal/Types.hpp" #include "wpi/util/sendable/Sendable.hpp" #include "wpi/util/sendable/SendableHelper.hpp" diff --git a/wpilibc/src/main/native/include/wpi/hardware/discrete/DigitalOutput.hpp b/wpilibc/src/main/native/include/wpi/hardware/discrete/DigitalOutput.hpp index 3377855b18..7ce1973000 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/discrete/DigitalOutput.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/discrete/DigitalOutput.hpp @@ -5,7 +5,7 @@ #pragma once #include "wpi/hal/DIO.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/Types.hpp" #include "wpi/units/time.hpp" #include "wpi/util/sendable/Sendable.hpp" #include "wpi/util/sendable/SendableHelper.hpp" diff --git a/wpilibc/src/main/native/include/wpi/hardware/discrete/PWM.hpp b/wpilibc/src/main/native/include/wpi/hardware/discrete/PWM.hpp index ec14892fda..365195959b 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/discrete/PWM.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/discrete/PWM.hpp @@ -7,7 +7,7 @@ #include #include "wpi/hal/PWM.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/Types.hpp" #include "wpi/units/time.hpp" #include "wpi/util/sendable/Sendable.hpp" #include "wpi/util/sendable/SendableHelper.hpp" diff --git a/wpilibc/src/main/native/include/wpi/hardware/led/AddressableLED.hpp b/wpilibc/src/main/native/include/wpi/hardware/led/AddressableLED.hpp index 8a08741e65..b67bc5cbd3 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/led/AddressableLED.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/led/AddressableLED.hpp @@ -9,8 +9,7 @@ #include "wpi/hal/AddressableLED.h" #include "wpi/hal/AddressableLEDTypes.h" -#include "wpi/hal/Types.h" -#include "wpi/units/time.hpp" +#include "wpi/hal/Types.hpp" #include "wpi/util/Color.hpp" #include "wpi/util/Color8Bit.hpp" diff --git a/wpilibc/src/main/native/include/wpi/hardware/motor/PWMMotorController.hpp b/wpilibc/src/main/native/include/wpi/hardware/motor/PWMMotorController.hpp index a8961125d5..aa58b1f95a 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/motor/PWMMotorController.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/motor/PWMMotorController.hpp @@ -12,7 +12,7 @@ #include #include -#include "wpi/hal/SimDevice.h" +#include "wpi/hal/SimDevice.hpp" #include "wpi/hardware/discrete/PWM.hpp" #include "wpi/hardware/motor/MotorController.hpp" #include "wpi/hardware/motor/MotorSafety.hpp" diff --git a/wpilibc/src/main/native/include/wpi/hardware/power/PowerDistribution.hpp b/wpilibc/src/main/native/include/wpi/hardware/power/PowerDistribution.hpp index a1af45fc84..b5abe9efaa 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/power/PowerDistribution.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/power/PowerDistribution.hpp @@ -7,7 +7,7 @@ #include #include "wpi/hal/PowerDistribution.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/Types.hpp" #include "wpi/util/sendable/Sendable.hpp" #include "wpi/util/sendable/SendableHelper.hpp" diff --git a/wpilibc/src/main/native/include/wpi/hardware/range/SharpIR.hpp b/wpilibc/src/main/native/include/wpi/hardware/range/SharpIR.hpp index 5f550bf3d6..3aa24b6bbf 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/range/SharpIR.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/range/SharpIR.hpp @@ -4,7 +4,7 @@ #pragma once -#include "wpi/hal/SimDevice.h" +#include "wpi/hal/SimDevice.hpp" #include "wpi/hardware/discrete/AnalogInput.hpp" #include "wpi/units/length.hpp" #include "wpi/util/sendable/Sendable.hpp" diff --git a/wpilibc/src/main/native/include/wpi/hardware/rotation/AnalogEncoder.hpp b/wpilibc/src/main/native/include/wpi/hardware/rotation/AnalogEncoder.hpp index 4ced3908d3..a7bd3e275b 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/rotation/AnalogEncoder.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/rotation/AnalogEncoder.hpp @@ -6,8 +6,7 @@ #include -#include "wpi/hal/SimDevice.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/SimDevice.hpp" #include "wpi/util/sendable/Sendable.hpp" #include "wpi/util/sendable/SendableHelper.hpp" diff --git a/wpilibc/src/main/native/include/wpi/hardware/rotation/DutyCycle.hpp b/wpilibc/src/main/native/include/wpi/hardware/rotation/DutyCycle.hpp index da1823b673..57841a7b98 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/rotation/DutyCycle.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/rotation/DutyCycle.hpp @@ -4,10 +4,8 @@ #pragma once -#include - #include "wpi/hal/DutyCycle.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/Types.hpp" #include "wpi/units/frequency.hpp" #include "wpi/units/time.hpp" #include "wpi/util/sendable/Sendable.hpp" diff --git a/wpilibc/src/main/native/include/wpi/hardware/rotation/DutyCycleEncoder.hpp b/wpilibc/src/main/native/include/wpi/hardware/rotation/DutyCycleEncoder.hpp index 2a23f86411..4550618632 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/rotation/DutyCycleEncoder.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/rotation/DutyCycleEncoder.hpp @@ -6,8 +6,7 @@ #include -#include "wpi/hal/SimDevice.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/SimDevice.hpp" #include "wpi/units/frequency.hpp" #include "wpi/units/time.hpp" #include "wpi/util/sendable/Sendable.hpp" diff --git a/wpilibc/src/main/native/include/wpi/hardware/rotation/Encoder.hpp b/wpilibc/src/main/native/include/wpi/hardware/rotation/Encoder.hpp index 27f91cdf52..e8f55f15f4 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/rotation/Encoder.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/rotation/Encoder.hpp @@ -4,10 +4,8 @@ #pragma once -#include - #include "wpi/hal/Encoder.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/Types.hpp" #include "wpi/hardware/discrete/CounterBase.hpp" #include "wpi/util/sendable/Sendable.hpp" #include "wpi/util/sendable/SendableHelper.hpp" diff --git a/wpilibc/src/main/native/include/wpi/internal/DriverStationModeThread.hpp b/wpilibc/src/main/native/include/wpi/internal/DriverStationModeThread.hpp index f21b92187e..438fa8aba7 100644 --- a/wpilibc/src/main/native/include/wpi/internal/DriverStationModeThread.hpp +++ b/wpilibc/src/main/native/include/wpi/internal/DriverStationModeThread.hpp @@ -7,7 +7,7 @@ #include #include -#include "wpi/hal/DriverStationTypes.h" +#include "wpi/hal/DriverStationTypes.hpp" #include "wpi/util/Synchronization.h" namespace wpi::internal { diff --git a/wpilibc/src/main/native/include/wpi/opmode/PeriodicOpMode.hpp b/wpilibc/src/main/native/include/wpi/opmode/PeriodicOpMode.hpp index 46d0513a0e..41b262d189 100644 --- a/wpilibc/src/main/native/include/wpi/opmode/PeriodicOpMode.hpp +++ b/wpilibc/src/main/native/include/wpi/opmode/PeriodicOpMode.hpp @@ -11,7 +11,7 @@ #include #include "wpi/hal/Notifier.h" -#include "wpi/hal/Types.h" +#include "wpi/hal/Types.hpp" #include "wpi/opmode/OpMode.hpp" #include "wpi/system/Watchdog.hpp" #include "wpi/units/time.hpp" diff --git a/wpilibc/src/main/native/include/wpi/simulation/ADXL345Sim.hpp b/wpilibc/src/main/native/include/wpi/simulation/ADXL345Sim.hpp index 1a6f8beb0d..b46d339874 100644 --- a/wpilibc/src/main/native/include/wpi/simulation/ADXL345Sim.hpp +++ b/wpilibc/src/main/native/include/wpi/simulation/ADXL345Sim.hpp @@ -4,7 +4,7 @@ #pragma once -#include "wpi/hal/SimDevice.h" +#include "wpi/hal/SimDevice.hpp" namespace wpi { diff --git a/wpilibc/src/main/native/include/wpi/simulation/AnalogEncoderSim.hpp b/wpilibc/src/main/native/include/wpi/simulation/AnalogEncoderSim.hpp index 96565d6772..f6f6122eb0 100644 --- a/wpilibc/src/main/native/include/wpi/simulation/AnalogEncoderSim.hpp +++ b/wpilibc/src/main/native/include/wpi/simulation/AnalogEncoderSim.hpp @@ -4,9 +4,7 @@ #pragma once -#include "wpi/hal/SimDevice.h" -#include "wpi/math/geometry/Rotation2d.hpp" -#include "wpi/units/angle.hpp" +#include "wpi/hal/SimDevice.hpp" namespace wpi { diff --git a/wpilibc/src/main/native/include/wpi/simulation/DutyCycleEncoderSim.hpp b/wpilibc/src/main/native/include/wpi/simulation/DutyCycleEncoderSim.hpp index 389a80935c..1023e9c5c0 100644 --- a/wpilibc/src/main/native/include/wpi/simulation/DutyCycleEncoderSim.hpp +++ b/wpilibc/src/main/native/include/wpi/simulation/DutyCycleEncoderSim.hpp @@ -4,8 +4,7 @@ #pragma once -#include "wpi/hal/SimDevice.h" -#include "wpi/units/angle.hpp" +#include "wpi/hal/SimDevice.hpp" namespace wpi { diff --git a/wpilibc/src/main/native/include/wpi/simulation/SimDeviceSim.hpp b/wpilibc/src/main/native/include/wpi/simulation/SimDeviceSim.hpp index 0a54f25aa8..db96977dd6 100644 --- a/wpilibc/src/main/native/include/wpi/simulation/SimDeviceSim.hpp +++ b/wpilibc/src/main/native/include/wpi/simulation/SimDeviceSim.hpp @@ -8,7 +8,7 @@ #include #include -#include "wpi/hal/SimDevice.h" +#include "wpi/hal/SimDevice.hpp" #include "wpi/hal/simulation/SimDeviceData.h" namespace wpi::sim { diff --git a/wpilibc/src/main/native/include/wpi/simulation/SimHooks.hpp b/wpilibc/src/main/native/include/wpi/simulation/SimHooks.hpp index c36e66ff2e..263370cc25 100644 --- a/wpilibc/src/main/native/include/wpi/simulation/SimHooks.hpp +++ b/wpilibc/src/main/native/include/wpi/simulation/SimHooks.hpp @@ -6,7 +6,7 @@ #include -#include "wpi/hal/DriverStationTypes.h" +#include "wpi/hal/DriverStationTypes.hpp" #include "wpi/hal/HALBase.h" #include "wpi/units/time.hpp" diff --git a/wpilibc/src/main/native/include/wpi/system/Tracer.hpp b/wpilibc/src/main/native/include/wpi/system/Tracer.hpp index d452a3afc9..3839ae7e8d 100644 --- a/wpilibc/src/main/native/include/wpi/system/Tracer.hpp +++ b/wpilibc/src/main/native/include/wpi/system/Tracer.hpp @@ -7,7 +7,7 @@ #include #include -#include "wpi/hal/cpp/fpga_clock.h" +#include "wpi/hal/cpp/fpga_clock.hpp" #include "wpi/util/StringMap.hpp" namespace wpi::util { diff --git a/wpilibc/src/main/python/wpilib/src/rpy/Notifier.cpp b/wpilibc/src/main/python/wpilib/src/rpy/Notifier.cpp index 7f208b8219..a1a61f35a5 100644 --- a/wpilibc/src/main/python/wpilib/src/rpy/Notifier.cpp +++ b/wpilibc/src/main/python/wpilib/src/rpy/Notifier.cpp @@ -8,7 +8,7 @@ #include -#include "wpi/hal/Notifier.h" +#include "wpi/hal/Notifier.hpp" #include "wpi/hal/Threads.h" #include "wpi/system/Errors.hpp" #include "wpi/system/Timer.hpp" diff --git a/xrpVendordep/src/main/native/include/wpi/xrp/XRPGyro.hpp b/xrpVendordep/src/main/native/include/wpi/xrp/XRPGyro.hpp index 18b3770adb..a7de932fb6 100644 --- a/xrpVendordep/src/main/native/include/wpi/xrp/XRPGyro.hpp +++ b/xrpVendordep/src/main/native/include/wpi/xrp/XRPGyro.hpp @@ -4,7 +4,7 @@ #pragma once -#include "wpi/hal/SimDevice.h" +#include "wpi/hal/SimDevice.hpp" #include "wpi/math/geometry/Rotation2d.hpp" #include "wpi/units/angle.hpp" #include "wpi/units/angular_velocity.hpp" diff --git a/xrpVendordep/src/main/native/include/wpi/xrp/XRPMotor.hpp b/xrpVendordep/src/main/native/include/wpi/xrp/XRPMotor.hpp index 3ac3aec220..c40bc643e1 100644 --- a/xrpVendordep/src/main/native/include/wpi/xrp/XRPMotor.hpp +++ b/xrpVendordep/src/main/native/include/wpi/xrp/XRPMotor.hpp @@ -8,7 +8,7 @@ #include #include -#include "wpi/hal/SimDevice.h" +#include "wpi/hal/SimDevice.hpp" #include "wpi/hardware/motor/MotorController.hpp" #include "wpi/hardware/motor/MotorSafety.hpp" #include "wpi/util/deprecated.hpp" diff --git a/xrpVendordep/src/main/native/include/wpi/xrp/XRPServo.hpp b/xrpVendordep/src/main/native/include/wpi/xrp/XRPServo.hpp index c1a710c046..3c7e21dbcf 100644 --- a/xrpVendordep/src/main/native/include/wpi/xrp/XRPServo.hpp +++ b/xrpVendordep/src/main/native/include/wpi/xrp/XRPServo.hpp @@ -8,7 +8,7 @@ #include #include -#include "wpi/hal/SimDevice.h" +#include "wpi/hal/SimDevice.hpp" #include "wpi/units/angle.hpp" namespace wpi::xrp {