[hal] Use new HMB api for addressable LED (#4479)

Theres is now a built in HMB api, but you have to dlopen it to access it. Moved our existing infrastructure for this to its own class, added the new functions, then updated interrupts and LEDs to use it.
This commit is contained in:
Thad House
2022-10-24 18:26:07 -07:00
committed by GitHub
parent ba850bac3b
commit ad53fb19b4
6 changed files with 133 additions and 107 deletions

View File

@@ -21,6 +21,7 @@
#include <wpi/mutex.h>
#include <wpi/timestamp.h>
#include "FPGACalls.h"
#include "HALInitializer.h"
#include "HALInternal.h"
#include "hal/ChipObject.h"
@@ -394,6 +395,11 @@ HAL_Bool HAL_Initialize(int32_t timeout, int32_t mode) {
return true;
}
int fpgaInit = hal::init::InitializeFPGA();
if (fpgaInit != HAL_SUCCESS) {
return false;
}
hal::init::InitializeHAL();
hal::init::HAL_IsInitialized.store(true);
@@ -426,11 +432,7 @@ HAL_Bool HAL_Initialize(int32_t timeout, int32_t mode) {
return false;
}
status = InterruptManager::Initialize(global->getSystemInterface());
if (status != 0) {
return false;
}
InterruptManager::Initialize(global->getSystemInterface());
hal::InitializeDriverStation();