diff --git a/hal/src/main/native/athena/AddressableLED.cpp b/hal/src/main/native/athena/AddressableLED.cpp index 9ecc4c4b84..64b64570b0 100644 --- a/hal/src/main/native/athena/AddressableLED.cpp +++ b/hal/src/main/native/athena/AddressableLED.cpp @@ -9,6 +9,8 @@ #include +#include + #include "ConstantsInternal.h" #include "DigitalInternal.h" #include "HALInitializer.h" @@ -19,14 +21,6 @@ using namespace hal; -extern "C" { -NiFpga_Status NiFpga_ClientFunctionCall(NiFpga_Session session, uint32_t group, - uint32_t functionId, - const void* inBuffer, - size_t inBufferSize, void* outBuffer, - size_t outBufferSize); -} // extern "C" - namespace { struct AddressableLED { std::unique_ptr led; @@ -52,43 +46,6 @@ void InitializeAddressableLED() { } // namespace init } // namespace hal -// Shim for broken ChipObject function -static const uint32_t clientFeature_hostMemoryBuffer = 0; -static const uint32_t hostMemoryBufferFunction_open = 2; - -// Input arguments for HMB open -struct AtomicHMBOpenInputs { - const char* memoryName; -}; - -// Output arguments for HMB open -struct AtomicHMBOpenOutputs { - size_t size; - void* virtualAddress; -}; - -static NiFpga_Status OpenHostMemoryBuffer(NiFpga_Session session, - const char* memoryName, - void** virtualAddress, size_t* size) { - struct AtomicHMBOpenOutputs outputs; - - struct AtomicHMBOpenInputs inputs; - inputs.memoryName = memoryName; - - NiFpga_Status retval = NiFpga_ClientFunctionCall( - session, clientFeature_hostMemoryBuffer, hostMemoryBufferFunction_open, - &inputs, sizeof(struct AtomicHMBOpenInputs), &outputs, - sizeof(struct AtomicHMBOpenOutputs)); - if (NiFpga_IsError(retval)) { - return retval; - } - *virtualAddress = outputs.virtualAddress; - if (size != NULL) { - *size = outputs.size; - } - return retval; -} - extern "C" { HAL_AddressableLEDHandle HAL_InitializeAddressableLED( @@ -146,8 +103,8 @@ HAL_AddressableLEDHandle HAL_InitializeAddressableLED( uint32_t session = led->led->getSystemInterface()->getHandle(); - *status = OpenHostMemoryBuffer(session, "HMB_0_LED", &led->ledBuffer, - &led->ledBufferSize); + *status = NiFpga_OpenHostMemoryBuffer(session, "HMB_0_LED", &led->ledBuffer, + &led->ledBufferSize); if (*status != 0) { addressableLEDHandles->Free(handle); diff --git a/hal/src/main/native/include/hal/ChipObject.h b/hal/src/main/native/include/hal/ChipObject.h index 9b321c2028..d891cedb3b 100644 --- a/hal/src/main/native/include/hal/ChipObject.h +++ b/hal/src/main/native/include/hal/ChipObject.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/shared/config.gradle b/shared/config.gradle index 8ee810b062..7952018ffb 100644 --- a/shared/config.gradle +++ b/shared/config.gradle @@ -8,7 +8,7 @@ nativeUtils { wpi { configureDependencies { wpiVersion = "-1" - niLibVersion = "2020.9.1" + niLibVersion = "2020.10.1" opencvVersion = "3.4.7-2" googleTestVersion = "1.9.0-4-437e100-1" imguiVersion = "1.72b-2"