mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
Optimize Solenoid Gets. Fixes artf4730.
Implement GetAllSolenoids in the HAL so that SolenoidBase doesn't have to read each solenoid individually. Change-Id: I85559565949f7a7119ead410187235636a63f0ed
This commit is contained in:
committed by
Brad Miller (WPI)
parent
84ca2ab0f5
commit
906fe65e39
@@ -51,6 +51,15 @@ bool getSolenoid(void* solenoid_port_pointer, int32_t *status) {
|
||||
return value;
|
||||
}
|
||||
|
||||
uint8_t getAllSolenoids(void* solenoid_port_pointer, int32_t *status) {
|
||||
solenoid_port_t* port = (solenoid_port_t*) solenoid_port_pointer;
|
||||
uint8_t value;
|
||||
|
||||
*status = port->module->GetAllSolenoids(value);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
void setSolenoid(void* solenoid_port_pointer, bool value, int32_t *status) {
|
||||
solenoid_port_t* port = (solenoid_port_t*) solenoid_port_pointer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user