mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal, wpilib] Rewrite CAN APIs (#7798)
This commit is contained in:
@@ -17,15 +17,20 @@ namespace frc {
|
||||
* Module. */
|
||||
class PneumaticsControlModule : public PneumaticsBase {
|
||||
public:
|
||||
/** Constructs a PneumaticsControlModule with the default ID (0). */
|
||||
PneumaticsControlModule();
|
||||
/**
|
||||
* Constructs a PneumaticsControlModule with the default ID (0).
|
||||
*
|
||||
* @param busId The bus ID.
|
||||
*/
|
||||
explicit PneumaticsControlModule(int busId);
|
||||
|
||||
/**
|
||||
* Constructs a PneumaticsControlModule.
|
||||
*
|
||||
* @param busId The bus ID.
|
||||
* @param module module number to construct
|
||||
*/
|
||||
explicit PneumaticsControlModule(int module);
|
||||
PneumaticsControlModule(int busId, int module);
|
||||
|
||||
~PneumaticsControlModule() override = default;
|
||||
|
||||
@@ -196,17 +201,17 @@ class PneumaticsControlModule : public PneumaticsBase {
|
||||
class DataStore;
|
||||
friend class DataStore;
|
||||
friend class PneumaticsBase;
|
||||
PneumaticsControlModule(HAL_CTREPCMHandle handle, int module);
|
||||
PneumaticsControlModule(int busId, HAL_CTREPCMHandle handle, int module);
|
||||
|
||||
static std::shared_ptr<PneumaticsBase> GetForModule(int module);
|
||||
static std::shared_ptr<PneumaticsBase> GetForModule(int busId, int module);
|
||||
|
||||
std::shared_ptr<DataStore> m_dataStore;
|
||||
HAL_CTREPCMHandle m_handle;
|
||||
int m_module;
|
||||
|
||||
static wpi::mutex m_handleLock;
|
||||
static std::unique_ptr<wpi::DenseMap<int, std::weak_ptr<DataStore>>>
|
||||
m_handleMap;
|
||||
static std::weak_ptr<DataStore>& GetDataStore(int module);
|
||||
static std::unique_ptr<wpi::DenseMap<int, std::weak_ptr<DataStore>>[]>
|
||||
m_handleMaps;
|
||||
static std::weak_ptr<DataStore>& GetDataStore(int busId, int module);
|
||||
};
|
||||
} // namespace frc
|
||||
|
||||
Reference in New Issue
Block a user