mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Use new CAN API for PDP (#1081)
This commit is contained in:
committed by
Peter Johnson
parent
f6e4df6a18
commit
056e68f2ae
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <wpi/DenseMap.h>
|
||||
|
||||
#include "CANAPIInternal.h"
|
||||
#include "HAL/CAN.h"
|
||||
#include "HAL/Errors.h"
|
||||
#include "HAL/HAL.h"
|
||||
@@ -57,6 +58,16 @@ void InitializeCANAPI() {
|
||||
canHandles = &cH;
|
||||
}
|
||||
} // namespace init
|
||||
namespace can {
|
||||
int32_t GetCANModuleFromHandle(HAL_CANHandle handle, int32_t* status) {
|
||||
auto can = canHandles->Get(handle);
|
||||
if (!can) {
|
||||
*status = HAL_HANDLE_ERROR;
|
||||
return -1;
|
||||
}
|
||||
return can->deviceId;
|
||||
}
|
||||
} // namespace can
|
||||
} // namespace hal
|
||||
|
||||
static int32_t CreateCANId(CANStorage* storage, int32_t apiId) {
|
||||
|
||||
Reference in New Issue
Block a user