mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Changes HAL Port from a pointer to a handle (#93)
HAL Port is using a special handle, where the module and pin are bit shifted straight into the handle. This is one of the few special cases we have, but for the way port is used it is much cleaner and uses much less memory. Plus it is generic and not specific to one type.
This commit is contained in:
committed by
Peter Johnson
parent
5a82f73d9b
commit
fc515f4572
@@ -7,7 +7,6 @@
|
||||
|
||||
#include "AnalogInput.h"
|
||||
#include "HAL/HAL.h"
|
||||
#include "HAL/Port.h"
|
||||
#include "LiveWindow/LiveWindow.h"
|
||||
#include "Resource.h"
|
||||
#include "Timer.h"
|
||||
@@ -45,7 +44,7 @@ AnalogInput::AnalogInput(uint32_t channel) {
|
||||
|
||||
m_channel = channel;
|
||||
|
||||
void* port = getPort(channel);
|
||||
HalPortHandle port = getPort(channel);
|
||||
int32_t status = 0;
|
||||
m_port = initializeAnalogInputPort(port, &status);
|
||||
wpi_setErrorWithContext(status, getHALErrorMessage(status));
|
||||
|
||||
Reference in New Issue
Block a user