mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
Major formatting changes (breaks diffs). No code changes.
The changes made in this commit do not affect any actual code,
they are purely aesthetic. I ran clang-format with google style
over all .h/.cpp files in wpilibc that weren't in wpilibC++Sim
or gtest, and the eclipse formatter over all of the Java files
using the Google eclipse formatting configuration.
Change-Id: I9627bca0bc103c398ecc1c5ba17467193291ae63
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2008. All Rights Reserved. */
|
||||
/* Copyright (c) FIRST 2008. All Rights Reserved.
|
||||
*/
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
@@ -9,34 +10,41 @@
|
||||
#include "SensorBase.h"
|
||||
#include "Resource.h"
|
||||
|
||||
class InterruptableSensorBase : public SensorBase
|
||||
{
|
||||
public:
|
||||
enum WaitResult {
|
||||
kTimeout = 0x0,
|
||||
kRisingEdge = 0x1,
|
||||
kFallingEdge = 0x100,
|
||||
kBoth = 0x101,
|
||||
};
|
||||
class InterruptableSensorBase : public SensorBase {
|
||||
public:
|
||||
enum WaitResult {
|
||||
kTimeout = 0x0,
|
||||
kRisingEdge = 0x1,
|
||||
kFallingEdge = 0x100,
|
||||
kBoth = 0x101,
|
||||
};
|
||||
|
||||
InterruptableSensorBase();
|
||||
virtual ~InterruptableSensorBase();
|
||||
virtual uint32_t GetChannelForRouting() const = 0;
|
||||
virtual uint32_t GetModuleForRouting() const = 0;
|
||||
virtual bool GetAnalogTriggerForRouting() const = 0;
|
||||
virtual void RequestInterrupts(InterruptHandlerFunction handler, void *param); ///< Asynchronus handler version.
|
||||
virtual void RequestInterrupts(); ///< Synchronus Wait version.
|
||||
virtual void CancelInterrupts(); ///< Free up the underlying chipobject functions.
|
||||
virtual WaitResult WaitForInterrupt(float timeout, bool ignorePrevious = true); ///< Synchronus version.
|
||||
virtual void EnableInterrupts(); ///< Enable interrupts - after finishing setup.
|
||||
virtual void DisableInterrupts(); ///< Disable, but don't deallocate.
|
||||
virtual double ReadRisingTimestamp();///< Return the timestamp for the rising interrupt that occurred.
|
||||
virtual double ReadFallingTimestamp();///< Return the timestamp for the falling interrupt that occurred.
|
||||
virtual void SetUpSourceEdge(bool risingEdge, bool fallingEdge);
|
||||
protected:
|
||||
void* m_interrupt;
|
||||
uint32_t m_interruptIndex;
|
||||
void AllocateInterrupts(bool watcher);
|
||||
InterruptableSensorBase();
|
||||
virtual ~InterruptableSensorBase();
|
||||
virtual uint32_t GetChannelForRouting() const = 0;
|
||||
virtual uint32_t GetModuleForRouting() const = 0;
|
||||
virtual bool GetAnalogTriggerForRouting() const = 0;
|
||||
virtual void RequestInterrupts(
|
||||
InterruptHandlerFunction handler,
|
||||
void *param); ///< Asynchronus handler version.
|
||||
virtual void RequestInterrupts(); ///< Synchronus Wait version.
|
||||
virtual void
|
||||
CancelInterrupts(); ///< Free up the underlying chipobject functions.
|
||||
virtual WaitResult WaitForInterrupt(
|
||||
float timeout, bool ignorePrevious = true); ///< Synchronus version.
|
||||
virtual void
|
||||
EnableInterrupts(); ///< Enable interrupts - after finishing setup.
|
||||
virtual void DisableInterrupts(); ///< Disable, but don't deallocate.
|
||||
virtual double ReadRisingTimestamp(); ///< Return the timestamp for the
|
||||
///rising interrupt that occurred.
|
||||
virtual double ReadFallingTimestamp(); ///< Return the timestamp for the
|
||||
///falling interrupt that occurred.
|
||||
virtual void SetUpSourceEdge(bool risingEdge, bool fallingEdge);
|
||||
|
||||
static Resource *m_interrupts;
|
||||
protected:
|
||||
void *m_interrupt;
|
||||
uint32_t m_interruptIndex;
|
||||
void AllocateInterrupts(bool watcher);
|
||||
|
||||
static Resource *m_interrupts;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user