mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +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
@@ -9,6 +9,7 @@ extern "C"
|
||||
bool checkSolenoidModule(uint8_t module);
|
||||
|
||||
bool getSolenoid(void* solenoid_port_pointer, int32_t *status);
|
||||
uint8_t getAllSolenoids(void* solenoid_port_pointer, int32_t *status);
|
||||
void setSolenoid(void* solenoid_port_pointer, bool value, int32_t *status);
|
||||
|
||||
int getPCMSolenoidBlackList(void* solenoid_port_pointer, int32_t *status);
|
||||
|
||||
@@ -31,10 +31,17 @@ public:
|
||||
*
|
||||
* @Return - CTR_Code - Error code (if any)
|
||||
* @Param - idx - ID of solenoid (0-7) to return if solenoid is on.
|
||||
* @Param - status - OK if solenoid enabled, false otherwise
|
||||
* @Param - status - true if solenoid enabled, false otherwise
|
||||
*/
|
||||
CTR_Code GetSolenoid(UINT8 idx, bool &status);
|
||||
|
||||
/* Get state of all solenoids
|
||||
*
|
||||
* @Return - CTR_Code - Error code (if any)
|
||||
* @Param - status - bitfield of solenoid states
|
||||
*/
|
||||
CTR_Code GetAllSolenoids(UINT8 &status);
|
||||
|
||||
/* Get pressure switch state
|
||||
* @Return - CTR_Code - Error code (if any)
|
||||
* @Param - status - True if pressure adequate, false if low
|
||||
@@ -188,6 +195,7 @@ extern "C" {
|
||||
CTR_Code c_SetClosedLoopControl(void * handle,INT8 param);
|
||||
CTR_Code c_ClearStickyFaults(void * handle,INT8 param);
|
||||
CTR_Code c_GetSolenoid(void * handle,UINT8 idx,INT8 * status);
|
||||
CTR_Code c_GetAllSolenoids(void * handle,UINT8 * status);
|
||||
CTR_Code c_GetPressure(void * handle,INT8 * status);
|
||||
CTR_Code c_GetCompressor(void * handle,INT8 * status);
|
||||
CTR_Code c_GetClosedLoopControl(void * handle,INT8 * status);
|
||||
|
||||
Reference in New Issue
Block a user