mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
SCRIPT: wpiformat
This commit is contained in:
committed by
Peter Johnson
parent
c48b722dac
commit
1e7604f81c
@@ -3,10 +3,10 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include "wpi/util/SmallString.hpp"
|
||||
|
||||
#include "wpi/hal/Errors.h"
|
||||
#include "wpi/hal/HALBase.h"
|
||||
#include "wpi/util/SmallString.hpp"
|
||||
|
||||
namespace {
|
||||
struct LastErrorStorage {
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
#include <cstdio>
|
||||
#include <limits>
|
||||
|
||||
#include "wpi/util/print.hpp"
|
||||
|
||||
#include "wpi/hal/HALBase.h"
|
||||
#include "wpi/util/print.hpp"
|
||||
|
||||
namespace hal {
|
||||
const fpga_clock::time_point fpga_clock::min_time =
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "org_wpilib_hardware_hal_AddressableLEDJNI.h"
|
||||
#include "wpi/hal/AddressableLED.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
using namespace wpi::java;
|
||||
|
||||
@@ -6,13 +6,12 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#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/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -6,13 +6,12 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "org_wpilib_hardware_hal_CANAPIJNI.h"
|
||||
#include "wpi/hal/CAN.h"
|
||||
#include "wpi/hal/CANAPI.h"
|
||||
#include "wpi/hal/Errors.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
using namespace wpi::java;
|
||||
|
||||
@@ -6,12 +6,11 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "org_wpilib_hardware_hal_can_CANJNI.h"
|
||||
#include "wpi/hal/CAN.h"
|
||||
#include "wpi/hal/Errors.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
using namespace wpi::java;
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#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/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -6,12 +6,11 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "org_wpilib_hardware_hal_CounterJNI.h"
|
||||
#include "wpi/hal/Counter.h"
|
||||
#include "wpi/hal/Errors.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -6,14 +6,13 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#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/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -7,15 +7,16 @@
|
||||
#include <cassert>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "org_wpilib_hardware_hal_DriverStationJNI.h"
|
||||
#include "wpi/hal/DriverStation.h"
|
||||
#include "wpi/hal/HALBase.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
static_assert(org_wpilib_hardware_hal_DriverStationJNI_kUnknownAllianceStation ==
|
||||
HAL_AllianceStationID_kUnknown);
|
||||
static_assert(
|
||||
org_wpilib_hardware_hal_DriverStationJNI_kUnknownAllianceStation ==
|
||||
HAL_AllianceStationID_kUnknown);
|
||||
static_assert(org_wpilib_hardware_hal_DriverStationJNI_kRed1AllianceStation ==
|
||||
HAL_AllianceStationID_kRed1);
|
||||
static_assert(org_wpilib_hardware_hal_DriverStationJNI_kRed2AllianceStation ==
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "org_wpilib_hardware_hal_DutyCycleJNI.h"
|
||||
#include "wpi/hal/DutyCycle.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
#include <cstring>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "org_wpilib_hardware_hal_HAL.h"
|
||||
#include "wpi/hal/DriverStation.h"
|
||||
#include "wpi/hal/Main.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
using namespace wpi::java;
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
#include <string>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "org_wpilib_hardware_hal_HALUtil.h"
|
||||
#include "wpi/hal/CAN.h"
|
||||
#include "wpi/hal/DriverStation.h"
|
||||
#include "wpi/hal/Errors.h"
|
||||
#include "wpi/hal/HAL.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace wpi::java;
|
||||
|
||||
@@ -30,7 +30,8 @@ using namespace wpi::java;
|
||||
#define kRIOStatusFeatureNotSupported (kRioStatusOffset - 193)
|
||||
#define kRIOStatusResourceNotInitialized -52010
|
||||
|
||||
static_assert(org_wpilib_hardware_hal_HALUtil_RUNTIME_ROBORIO == HAL_Runtime_RoboRIO);
|
||||
static_assert(org_wpilib_hardware_hal_HALUtil_RUNTIME_ROBORIO ==
|
||||
HAL_Runtime_RoboRIO);
|
||||
static_assert(org_wpilib_hardware_hal_HALUtil_RUNTIME_ROBORIO2 ==
|
||||
HAL_Runtime_RoboRIO2);
|
||||
static_assert(org_wpilib_hardware_hal_HALUtil_RUNTIME_SIMULATION ==
|
||||
@@ -73,7 +74,8 @@ static const JExceptionInit exceptions[] = {
|
||||
{"org/wpilib/hardware/hal/util/BoundaryException", &boundaryExCls},
|
||||
{"org/wpilib/hardware/hal/util/AllocationException", &allocationExCls},
|
||||
{"org/wpilib/hardware/hal/util/HalHandleException", &halHandleExCls},
|
||||
{"org/wpilib/hardware/hal/util/UncleanStatusException", &uncleanStatusExCls},
|
||||
{"org/wpilib/hardware/hal/util/UncleanStatusException",
|
||||
&uncleanStatusExCls},
|
||||
{"java/lang/NullPointerException", &nullPointerEx}};
|
||||
|
||||
namespace hal {
|
||||
|
||||
@@ -6,11 +6,10 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "org_wpilib_hardware_hal_I2CJNI.h"
|
||||
#include "wpi/hal/I2C.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
using namespace wpi::java;
|
||||
|
||||
@@ -7,11 +7,10 @@
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "org_wpilib_hardware_hal_NotifierJNI.h"
|
||||
#include "wpi/hal/Notifier.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -6,14 +6,13 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#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/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "org_wpilib_hardware_hal_PowerDistributionJNI.h"
|
||||
#include "wpi/hal/Ports.h"
|
||||
#include "wpi/hal/PowerDistribution.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#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/util/jni_util.hpp"
|
||||
|
||||
static_assert(
|
||||
org_wpilib_hardware_hal_REVPHJNI_COMPRESSOR_CONFIG_TYPE_DISABLED ==
|
||||
|
||||
@@ -6,11 +6,10 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "org_wpilib_hardware_hal_SerialPortJNI.h"
|
||||
#include "wpi/hal/SerialPort.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
using namespace wpi::java;
|
||||
|
||||
@@ -7,11 +7,10 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "org_wpilib_hardware_hal_SimDeviceJNI.h"
|
||||
#include "wpi/hal/SimDevice.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace wpi::java;
|
||||
|
||||
|
||||
@@ -6,11 +6,10 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
#include "wpi/util/string.h"
|
||||
|
||||
#include "org_wpilib_hardware_hal_UsageReportingJNI.h"
|
||||
#include "wpi/hal/UsageReporting.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
#include "wpi/util/string.h"
|
||||
|
||||
using namespace wpi::java;
|
||||
|
||||
|
||||
@@ -9,11 +9,10 @@
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "SimulatorJNI.h"
|
||||
#include "wpi/hal/Types.h"
|
||||
#include "wpi/hal/handles/UnlimitedHandleResource.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
using namespace hal::sim;
|
||||
|
||||
@@ -6,13 +6,12 @@
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "SimulatorJNI.h"
|
||||
#include "wpi/hal/Types.h"
|
||||
#include "wpi/hal/Value.h"
|
||||
#include "wpi/hal/handles/UnlimitedHandleResource.h"
|
||||
#include "wpi/hal/simulation/NotifyListener.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
namespace hal::sim {
|
||||
class BufferCallbackStore {
|
||||
|
||||
@@ -9,12 +9,11 @@
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "SimulatorJNI.h"
|
||||
#include "wpi/hal/Types.h"
|
||||
#include "wpi/hal/Value.h"
|
||||
#include "wpi/hal/handles/UnlimitedHandleResource.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
using namespace hal::sim;
|
||||
|
||||
@@ -6,13 +6,12 @@
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "SimulatorJNI.h"
|
||||
#include "wpi/hal/Types.h"
|
||||
#include "wpi/hal/Value.h"
|
||||
#include "wpi/hal/handles/UnlimitedHandleResource.h"
|
||||
#include "wpi/hal/simulation/NotifyListener.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
namespace hal::sim {
|
||||
class CallbackStore {
|
||||
|
||||
@@ -9,11 +9,10 @@
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "SimulatorJNI.h"
|
||||
#include "wpi/hal/Types.h"
|
||||
#include "wpi/hal/handles/UnlimitedHandleResource.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
using namespace hal::sim;
|
||||
|
||||
@@ -6,13 +6,12 @@
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "SimulatorJNI.h"
|
||||
#include "wpi/hal/Types.h"
|
||||
#include "wpi/hal/Value.h"
|
||||
#include "wpi/hal/handles/UnlimitedHandleResource.h"
|
||||
#include "wpi/hal/simulation/NotifyListener.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
namespace hal::sim {
|
||||
class ConstBufferCallbackStore {
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include "wpi/util/StringExtras.hpp"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "CallbackStore.h"
|
||||
#include "org_wpilib_hardware_hal_simulation_DriverStationDataJNI.h"
|
||||
#include "wpi/hal/simulation/DriverStationData.h"
|
||||
#include "wpi/hal/simulation/MockHooks.h"
|
||||
#include "wpi/util/StringExtras.hpp"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
using namespace wpi::java;
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "CallbackStore.h"
|
||||
#include "org_wpilib_hardware_hal_simulation_RoboRioDataJNI.h"
|
||||
#include "wpi/hal/simulation/RoboRioData.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
using namespace wpi::java;
|
||||
|
||||
@@ -12,12 +12,11 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "SimulatorJNI.h"
|
||||
#include "org_wpilib_hardware_hal_simulation_SimDeviceDataJNI.h"
|
||||
#include "wpi/hal/handles/UnlimitedHandleResource.h"
|
||||
#include "wpi/hal/simulation/SimDeviceData.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace hal;
|
||||
using namespace wpi::java;
|
||||
@@ -317,8 +316,8 @@ bool InitializeSimDeviceDataJNI(JNIEnv* env) {
|
||||
return false;
|
||||
}
|
||||
|
||||
simValueInfoCls =
|
||||
JClass(env, "org/wpilib/hardware/hal/simulation/SimDeviceDataJNI$SimValueInfo");
|
||||
simValueInfoCls = JClass(
|
||||
env, "org/wpilib/hardware/hal/simulation/SimDeviceDataJNI$SimValueInfo");
|
||||
if (!simValueInfoCls) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
#include "SimulatorJNI.h"
|
||||
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
#include "BufferCallbackStore.h"
|
||||
#include "CallbackStore.h"
|
||||
#include "ConstBufferCallbackStore.h"
|
||||
@@ -14,6 +12,7 @@
|
||||
#include "wpi/hal/HAL.h"
|
||||
#include "wpi/hal/handles/HandlesInternal.h"
|
||||
#include "wpi/hal/simulation/MockHooks.h"
|
||||
#include "wpi/util/jni_util.hpp"
|
||||
|
||||
using namespace wpi::java;
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "wpi/hal/Types.h"
|
||||
#include "jni.h"
|
||||
#include "wpi/hal/Types.h"
|
||||
|
||||
using SIM_JniHandle = HAL_Handle; // NOLINT
|
||||
|
||||
|
||||
@@ -2,9 +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 "wpi/util/protobuf/ProtobufCallbacks.hpp"
|
||||
|
||||
#include "wpi/hal/proto/ControlData.h"
|
||||
#include "wpi/util/protobuf/ProtobufCallbacks.hpp"
|
||||
|
||||
static_assert(sizeof(mrc::ControlFlags) == sizeof(uint32_t));
|
||||
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "wpi/util/protobuf/ProtobufCallbacks.hpp"
|
||||
|
||||
#include "wpi/hal/proto/ErrorInfo.h"
|
||||
#include "wpi/util/protobuf/ProtobufCallbacks.hpp"
|
||||
|
||||
std::optional<mrc::ErrorInfo> wpi::Protobuf<mrc::ErrorInfo>::Unpack(
|
||||
InputStream& Stream) {
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "wpi/util/protobuf/ProtobufCallbacks.hpp"
|
||||
|
||||
#include "wpi/hal/proto/JoystickDescriptor.h"
|
||||
#include "wpi/util/protobuf/ProtobufCallbacks.hpp"
|
||||
|
||||
std::optional<mrc::JoystickDescriptor>
|
||||
wpi::Protobuf<mrc::JoystickDescriptor>::Unpack(InputStream& Stream) {
|
||||
|
||||
@@ -2,9 +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 "wpi/util/protobuf/ProtobufCallbacks.hpp"
|
||||
|
||||
#include "wpi/hal/proto/JoystickRumbleData.h"
|
||||
#include "wpi/util/protobuf/ProtobufCallbacks.hpp"
|
||||
|
||||
std::optional<mrc::JoystickRumbleData>
|
||||
wpi::Protobuf<mrc::JoystickRumbleData>::Unpack(InputStream& Stream) {
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "wpi/util/protobuf/ProtobufCallbacks.hpp"
|
||||
|
||||
#include "wpi/hal/proto/MatchInfo.h"
|
||||
#include "wpi/util/protobuf/ProtobufCallbacks.hpp"
|
||||
|
||||
std::optional<mrc::MatchInfo> wpi::Protobuf<mrc::MatchInfo>::Unpack(
|
||||
InputStream& Stream) {
|
||||
|
||||
@@ -6,9 +6,8 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "wpi/util/protobuf/ProtobufCallbacks.hpp"
|
||||
|
||||
#include "wpi/hal/proto/OpMode.h"
|
||||
#include "wpi/util/protobuf/ProtobufCallbacks.hpp"
|
||||
|
||||
std::optional<mrc::OpMode> wpi::Protobuf<mrc::OpMode>::Unpack(
|
||||
InputStream& Stream) {
|
||||
|
||||
Reference in New Issue
Block a user