Files
allwpilib/hal/lib/Athena/Compressor.cpp
thomasclark 255a3a5b12 Updated the HAL, wpilibj, and wpilibc for PCM and PDP
Removed #if 0...#endif from PCM.cpp

Change-Id: I2d117c87a3fa10bddebf83706f79c2e767d22a0d

Update the HAL to the PCM/PDP changes

Change-Id: If554b650e263f174e90864f1e9ffba91daf20f7e

Update C++ to the PCM/PDP changes

Change-Id: Ia3114d4526be1dc5cc2f74fd8f7ab44f204d15f2

Updated PCM/PDP in Java

Change-Id: I8fe03afbcb1739d555e86abc0eaae1e12313d490
2014-07-02 16:49:36 -04:00

65 lines
1.2 KiB
C++

#include "HAL/Compressor.hpp"
#include "ctre/PCM.h"
#include <iostream>
static const int NUM_MODULE_NUMBERS = 63;
extern PCM *modules[NUM_MODULE_NUMBERS];
extern void initializePCM(int module);
void *initializeCompressor(uint8_t module) {
initializePCM(module);
return modules[module];
}
bool checkCompressorModule(uint8_t module) {
return module < NUM_MODULE_NUMBERS;
}
bool getCompressor(void *pcm_pointer, int32_t *status) {
PCM *module = (PCM *)pcm_pointer;
bool value;
*status = module->GetCompressor(value);
return value;
}
void setClosedLoopControl(void *pcm_pointer, bool value, int32_t *status) {
PCM *module = (PCM *)pcm_pointer;
*status = module->SetClosedLoopControl(value);
}
bool getClosedLoopControl(void *pcm_pointer, int32_t *status) {
PCM *module = (PCM *)pcm_pointer;
bool value;
*status = module->GetClosedLoopControl(value);
return value;
}
bool getPressureSwitch(void *pcm_pointer, int32_t *status) {
PCM *module = (PCM *)pcm_pointer;
bool value;
*status = module->GetPressure(value);
return value;
}
float getCompressorCurrent(void *pcm_pointer, int32_t *status) {
PCM *module = (PCM *)pcm_pointer;
float value;
*status = module->GetCompressorCurrent(value);
return value;
}