mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -17,21 +17,21 @@
|
||||
#include "wpi/hal/handles/HandlesInternal.h"
|
||||
#include "wpi/hal/handles/LimitedHandleResource.h"
|
||||
|
||||
using namespace hal;
|
||||
using namespace wpi::hal;
|
||||
|
||||
namespace hal::init {
|
||||
namespace wpi::hal::init {
|
||||
void InitializeDutyCycle() {}
|
||||
} // namespace hal::init
|
||||
} // namespace wpi::hal::init
|
||||
|
||||
extern "C" {
|
||||
HAL_DutyCycleHandle HAL_InitializeDutyCycle(int32_t channel,
|
||||
const char* allocationLocation,
|
||||
int32_t* status) {
|
||||
hal::init::CheckInit();
|
||||
wpi::hal::init::CheckInit();
|
||||
|
||||
if (channel < 0 || channel >= kNumSmartIo) {
|
||||
*status = RESOURCE_OUT_OF_RANGE;
|
||||
hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for DutyCycle", 0,
|
||||
wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for DutyCycle", 0,
|
||||
kNumSmartIo, channel);
|
||||
return HAL_kInvalidHandle;
|
||||
}
|
||||
@@ -43,10 +43,10 @@ HAL_DutyCycleHandle HAL_InitializeDutyCycle(int32_t channel,
|
||||
|
||||
if (*status != 0) {
|
||||
if (port) {
|
||||
hal::SetLastErrorPreviouslyAllocated(status, "SmartIo", channel,
|
||||
wpi::hal::SetLastErrorPreviouslyAllocated(status, "SmartIo", channel,
|
||||
port->previousAllocation);
|
||||
} else {
|
||||
hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for DutyCycle", 0,
|
||||
wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for DutyCycle", 0,
|
||||
kNumSmartIo, channel);
|
||||
}
|
||||
return HAL_kInvalidHandle; // failed to allocate. Pass error back.
|
||||
@@ -73,9 +73,9 @@ void HAL_FreeDutyCycle(HAL_DutyCycleHandle dutyCycleHandle) {
|
||||
smartIoHandles->Free(dutyCycleHandle, HAL_HandleEnum::DutyCycle);
|
||||
|
||||
// Wait for no other object to hold this handle.
|
||||
auto start = hal::fpga_clock::now();
|
||||
auto start = wpi::hal::fpga_clock::now();
|
||||
while (port.use_count() != 1) {
|
||||
auto current = hal::fpga_clock::now();
|
||||
auto current = wpi::hal::fpga_clock::now();
|
||||
if (start + std::chrono::seconds(1) < current) {
|
||||
std::puts("DIO handle free timeout");
|
||||
std::fflush(stdout);
|
||||
|
||||
Reference in New Issue
Block a user