mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11: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
@@ -19,6 +19,7 @@
|
||||
#include "DIO.h"
|
||||
#include "Encoder.h"
|
||||
#include "Errors.h"
|
||||
#include "Handles.h"
|
||||
#include "I2C.h"
|
||||
#include "Interrupts.h"
|
||||
#include "Notifier.h"
|
||||
@@ -211,9 +212,9 @@ extern const uint32_t solenoid_kNumDO7_0Elements;
|
||||
extern const uint32_t interrupt_kNumSystems;
|
||||
extern const uint32_t kSystemClockTicksPerMicrosecond;
|
||||
|
||||
void* getPort(uint8_t pin);
|
||||
void* getPortWithModule(uint8_t module, uint8_t pin);
|
||||
void freePort(void* port);
|
||||
HalPortHandle getPort(uint8_t pin);
|
||||
HalPortHandle getPortWithModule(uint8_t module, uint8_t pin);
|
||||
void freePort(HalPortHandle port);
|
||||
const char* getHALErrorMessage(int32_t code);
|
||||
|
||||
uint16_t getFPGAVersion(int32_t* status);
|
||||
|
||||
Reference in New Issue
Block a user