[hal, wpilib] Remove built in accelerometer (#7702)

This commit is contained in:
Thad House
2025-01-17 14:06:09 -08:00
committed by GitHub
parent 1600e773f4
commit 5a6c895b87
48 changed files with 0 additions and 2304 deletions

View File

@@ -1,58 +0,0 @@
// 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.
#include "hal/Accelerometer.h"
#include <stdint.h>
#include <cassert>
#include <cstdio>
#include <memory>
#include "HALInitializer.h"
#include "hal/HAL.h"
using namespace hal;
namespace hal::init {
void InitializeAccelerometer() {}
} // namespace hal::init
namespace hal {
/**
* Initialize the accelerometer.
*/
static void initializeAccelerometer() {
hal::init::CheckInit();
}
} // namespace hal
extern "C" {
void HAL_SetAccelerometerActive(HAL_Bool active) {
initializeAccelerometer();
}
void HAL_SetAccelerometerRange(HAL_AccelerometerRange range) {
initializeAccelerometer();
}
double HAL_GetAccelerometerX(void) {
initializeAccelerometer();
return 0.0;
}
double HAL_GetAccelerometerY(void) {
initializeAccelerometer();
return 0.0;
}
double HAL_GetAccelerometerZ(void) {
initializeAccelerometer();
return 0.0;
}
} // extern "C"

View File

@@ -49,7 +49,6 @@ void InitializeHAL() {
InitializeCTREPCM();
InitializeREVPH();
InitializeAddressableLED();
InitializeAccelerometer();
InitializeAnalogInput();
InitializeAnalogTrigger();
InitializeCAN();

View File

@@ -18,7 +18,6 @@ inline void CheckInit() {
extern void InitializeCTREPCM();
extern void InitializeREVPH();
extern void InitializeAccelerometer();
extern void InitializeAddressableLED();
extern void InitializeAnalogInput();
extern void InitializeAnalogInternal();

View File

@@ -1,25 +0,0 @@
// 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.
#include "hal/simulation/AccelerometerData.h"
#include "hal/simulation/SimDataValue.h"
extern "C" {
void HALSIM_ResetAccelerometerData(int32_t index) {}
#define DEFINE_CAPI(TYPE, CAPINAME, RETURN) \
HAL_SIMDATAVALUE_STUB_CAPI(TYPE, HALSIM, Accelerometer##CAPINAME, RETURN)
DEFINE_CAPI(HAL_Bool, Active, false)
DEFINE_CAPI(HAL_AccelerometerRange, Range, HAL_AccelerometerRange_k2G)
DEFINE_CAPI(double, X, 0)
DEFINE_CAPI(double, Y, 0)
DEFINE_CAPI(double, Z, 0)
void HALSIM_RegisterAccelerometerAllCallbacks(int32_t index,
HAL_NotifyCallback callback,
void* param,
HAL_Bool initialNotify) {}
} // extern "C"