mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Rename FRC to WPILib (#8637)
This commit is contained in:
2
hal/robotpy_pybind_build_info.bzl
generated
2
hal/robotpy_pybind_build_info.bzl
generated
@@ -422,7 +422,7 @@ def define_pybind_library(name, pkgcfgs = []):
|
||||
"//wpiutil:robotpy-wpiutil",
|
||||
],
|
||||
strip_path_prefixes = ["hal/src/main/python", "hal"],
|
||||
summary = "Binary wrapper for FRC HAL",
|
||||
summary = "Binary wrapper for WPILib HAL",
|
||||
project_urls = {"Source code": "https://github.com/robotpy/mostrobotpy"},
|
||||
author_email = "RobotPy Development Team <robotpy@googlegroups.com>",
|
||||
requires = ["pyntcore==0.0.0", "robotpy-native-wpihal==0.0.0", "robotpy-wpiutil==0.0.0"],
|
||||
|
||||
@@ -13,7 +13,7 @@ package org.wpilib.hardware.hal;
|
||||
@SuppressWarnings("PMD.MissingStaticMethodInNonInstantiatableClass")
|
||||
public final class CANAPITypes {
|
||||
/**
|
||||
* FRC CAN device type.
|
||||
* FIRST CAN device type.
|
||||
*
|
||||
* <p>This enum represents different types of CAN devices. Teams are encouraged to use the
|
||||
* kMiscellaneous for custom or miscellaneous devices.
|
||||
@@ -64,7 +64,7 @@ public final class CANAPITypes {
|
||||
}
|
||||
|
||||
/**
|
||||
* FRC CAN manufacturer ID.
|
||||
* FIRST CAN manufacturer ID.
|
||||
*
|
||||
* <p>This enum represents different manufacturer IDs for CAN devices. Teams are encouraged to use
|
||||
* the kTeamUse manufacturer ID for custom or team-specific devices.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __FRC_SYSTEMCORE__
|
||||
#ifdef __FIRST_SYSTEMCORE__
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
@@ -95,7 +95,7 @@ JNIEXPORT void JNICALL
|
||||
Java_org_wpilib_hardware_hal_HAL_terminate
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
#ifdef __FRC_SYSTEMCORE__
|
||||
#ifdef __FIRST_SYSTEMCORE__
|
||||
::raise(SIGKILL);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -40,11 +40,6 @@
|
||||
#define HAL_WARN_CANSessionMux_SocketBufferFull_MESSAGE \
|
||||
"CAN: Socket Buffer full. Generally caused by sending too many packets."
|
||||
|
||||
#define ERR_FRCSystem_NetCommNotResponding_MESSAGE \
|
||||
"FRCSystem: NetComm not responding"
|
||||
#define ERR_FRCSystem_NoDSConnection_MESSAGE \
|
||||
"FRCSystem: No driver station connected"
|
||||
|
||||
#define HAL_SUCCESS 0
|
||||
|
||||
#define SAMPLE_RATE_TOO_HIGH 1001
|
||||
|
||||
@@ -137,7 +137,7 @@ inline int16_t getHandleTypedIndex(HAL_Handle handle, HAL_HandleEnum enumType,
|
||||
if (!isHandleType(handle, enumType)) {
|
||||
return InvalidHandleIndex;
|
||||
}
|
||||
#if !defined(__FRC_SYSTEMCORE__)
|
||||
#if !defined(__FIRST_SYSTEMCORE__)
|
||||
if (!isHandleCorrectVersion(handle, version)) {
|
||||
return InvalidHandleIndex;
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ static_assert(std::is_standard_layout_v<JoystickDataCache>);
|
||||
|
||||
static std::atomic_bool gShutdown{false};
|
||||
|
||||
struct FRCDriverStation {
|
||||
~FRCDriverStation() { gShutdown = true; }
|
||||
struct FIRSTDriverStation {
|
||||
~FIRSTDriverStation() { gShutdown = true; }
|
||||
wpi::util::EventVector newDataEvents;
|
||||
wpi::util::mutex cacheMutex;
|
||||
wpi::util::mutex tcpCacheMutex;
|
||||
@@ -114,11 +114,11 @@ void TcpCache::Update() {
|
||||
}
|
||||
}
|
||||
|
||||
static ::FRCDriverStation* driverStation;
|
||||
static ::FIRSTDriverStation* driverStation;
|
||||
|
||||
namespace wpi::hal::init {
|
||||
void InitializeDriverStation() {
|
||||
static FRCDriverStation ds;
|
||||
static FIRSTDriverStation ds;
|
||||
driverStation = &ds;
|
||||
}
|
||||
} // namespace wpi::hal::init
|
||||
|
||||
@@ -200,13 +200,13 @@ struct SystemServerDriverStation {
|
||||
~SystemServerDriverStation() { ntInst.RemoveListener(controlDataListener); }
|
||||
};
|
||||
|
||||
struct FRCDriverStation {
|
||||
struct FIRSTDriverStation {
|
||||
wpi::util::EventVector newDataEvents;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
static ::SystemServerDriverStation* systemServerDs;
|
||||
static ::FRCDriverStation* driverStation;
|
||||
static ::FIRSTDriverStation* driverStation;
|
||||
|
||||
void SystemServerDriverStation::HandleListener(const wpi::nt::Event& event) {
|
||||
auto valueEvent = event.GetValueEventData();
|
||||
@@ -378,10 +378,10 @@ void TcpCache::Update() {
|
||||
}
|
||||
|
||||
namespace wpi::hal::init {
|
||||
void InitializeFRCDriverStation() {
|
||||
void InitializeFIRSTDriverStation() {
|
||||
InitializeDashboardOpMode();
|
||||
newestControlWord.value = 0;
|
||||
static FRCDriverStation ds;
|
||||
static FIRSTDriverStation ds;
|
||||
driverStation = &ds;
|
||||
}
|
||||
} // namespace wpi::hal::init
|
||||
@@ -47,7 +47,7 @@ void InitializeHAL() {
|
||||
InitializeDIO();
|
||||
InitializeDutyCycle();
|
||||
InitializeEncoder();
|
||||
InitializeFRCDriverStation();
|
||||
InitializeFIRSTDriverStation();
|
||||
InitializeI2C();
|
||||
InitializeIMU();
|
||||
InitializeMain();
|
||||
|
||||
@@ -29,7 +29,7 @@ extern void InitializeDigitalInternal();
|
||||
extern void InitializeDIO();
|
||||
extern void InitializeDutyCycle();
|
||||
extern void InitializeEncoder();
|
||||
extern void InitializeFRCDriverStation();
|
||||
extern void InitializeFIRSTDriverStation();
|
||||
extern void InitializeHAL();
|
||||
extern void InitializeI2C();
|
||||
extern void InitializeIMU();
|
||||
|
||||
@@ -22,9 +22,9 @@ SEMIWRAP_PYBIND11_MODULE(m) {
|
||||
m.def(
|
||||
"resetGlobalHandles",
|
||||
[]() {
|
||||
#ifndef __FRC_SYSTEMCORE__
|
||||
#ifndef __FIRST_SYSTEMCORE__
|
||||
HALSIM_ResetGlobalHandles();
|
||||
#endif
|
||||
},
|
||||
release_gil());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
|
||||
#ifndef __FRC_SYSTEMCORE__
|
||||
#ifndef __FIRST_SYSTEMCORE__
|
||||
#include "wpi/hal/Notifier.hpp"
|
||||
#include "wpi/hal/handles/HandlesInternal.hpp"
|
||||
#include "wpi/hal/simulation/NotifierData.h"
|
||||
|
||||
@@ -60,7 +60,7 @@ SEMIWRAP_PYBIND11_MODULE(m) {
|
||||
|
||||
initWrapper(m);
|
||||
|
||||
#ifdef __FRC_SYSTEMCORE__
|
||||
#ifdef __FIRST_SYSTEMCORE__
|
||||
m.attr("__halplatform__") = "Systemcore";
|
||||
m.attr("__hal_simulation__") = false;
|
||||
#else
|
||||
|
||||
@@ -12,7 +12,7 @@ requires = [
|
||||
[project]
|
||||
name = "robotpy-hal"
|
||||
version = "0.0.0"
|
||||
description = "Binary wrapper for FRC HAL"
|
||||
description = "Binary wrapper for WPILib HAL"
|
||||
authors = [
|
||||
{name = "RobotPy Development Team", email = "robotpy@googlegroups.com"},
|
||||
]
|
||||
|
||||
@@ -3,14 +3,14 @@ strip_prefixes:
|
||||
|
||||
functions:
|
||||
HAL_LoadOneExtension:
|
||||
ifndef: __FRC_SYSTEMCORE__
|
||||
ifndef: __FIRST_SYSTEMCORE__
|
||||
HAL_LoadExtensions:
|
||||
ifndef: __FRC_SYSTEMCORE__
|
||||
ifndef: __FIRST_SYSTEMCORE__
|
||||
HAL_RegisterExtension:
|
||||
ignore: true
|
||||
HAL_RegisterExtensionListener:
|
||||
ignore: true
|
||||
HAL_SetShowExtensionsNotFoundMessages:
|
||||
ifndef: __FRC_SYSTEMCORE__
|
||||
ifndef: __FIRST_SYSTEMCORE__
|
||||
HAL_OnShutdown:
|
||||
ignore: true
|
||||
|
||||
@@ -200,7 +200,7 @@ inline_code: |2
|
||||
return py::int_(value.data.v_int);
|
||||
case HAL_LONG:
|
||||
return py::int_(value.data.v_long);
|
||||
default:
|
||||
default:
|
||||
return py::none();
|
||||
}
|
||||
})
|
||||
@@ -260,7 +260,7 @@ inline_code: |2
|
||||
return (bool)self;
|
||||
})
|
||||
.def_property_readonly("name", [](const wpi::hal::SimDevice &self) -> py::str {
|
||||
#ifdef __FRC_SYSTEMCORE__
|
||||
#ifdef __FIRST_SYSTEMCORE__
|
||||
return "<invalid>";
|
||||
#else
|
||||
if (!self) {
|
||||
@@ -276,7 +276,7 @@ inline_code: |2
|
||||
#endif
|
||||
})
|
||||
.def("__repr__", [](const wpi::hal::SimDevice &self) -> py::str {
|
||||
#ifdef __FRC_SYSTEMCORE__
|
||||
#ifdef __FIRST_SYSTEMCORE__
|
||||
return "<SimDevice (invalid)>";
|
||||
#else
|
||||
if (!self) {
|
||||
@@ -309,7 +309,7 @@ inline_code: |2
|
||||
cls_SimEnum
|
||||
.def_property("value", &SimEnum::Get, &SimEnum::Set)
|
||||
.def("__repr__", [](const SimEnum &self) -> py::str {
|
||||
#ifdef __FRC_SYSTEMCORE__
|
||||
#ifdef __FIRST_SYSTEMCORE__
|
||||
return "<SimEnum (invalid)>";
|
||||
#else
|
||||
if (self) {
|
||||
|
||||
Reference in New Issue
Block a user