Reflowed comments and removed commented out code (#735)

This commit is contained in:
Tyler Veness
2017-11-16 00:33:51 -08:00
committed by Peter Johnson
parent 1e8d18b328
commit c663d7cd16
103 changed files with 784 additions and 778 deletions

View File

@@ -26,6 +26,7 @@ class DigitalOutput;
/**
* Ultrasonic rangefinder class.
*
* The Ultrasonic rangefinder measures absolute distance based on the round-trip
* time of a ping generated by the controller. These sensors use two
* transducers, a speaker and a microphone both tuned to the ultrasonic range. A
@@ -43,10 +44,8 @@ class Ultrasonic : public SensorBase,
Ultrasonic(DigitalOutput* pingChannel, DigitalInput* echoChannel,
DistanceUnit units = kInches);
Ultrasonic(DigitalOutput& pingChannel, DigitalInput& echoChannel,
DistanceUnit units = kInches);
Ultrasonic(std::shared_ptr<DigitalOutput> pingChannel,
std::shared_ptr<DigitalInput> echoChannel,
DistanceUnit units = kInches);
@@ -79,16 +78,22 @@ class Ultrasonic : public SensorBase,
// Time (sec) for the ping trigger pulse.
static constexpr double kPingTime = 10 * 1e-6;
// Priority that the ultrasonic round robin task runs.
static const int kPriority = 64;
// Max time (ms) between readings.
static constexpr double kMaxUltrasonicTime = 0.1;
static constexpr double kSpeedOfSoundInchesPerSec = 1130.0 * 12.0;
static std::thread
m_thread; // thread doing the round-robin automatic sensing
static std::set<Ultrasonic*> m_sensors; // ultrasonic sensors
static std::atomic<bool> m_automaticEnabled; // automatic round robin mode
// Thread doing the round-robin automatic sensing
static std::thread m_thread;
// Ultrasonic sensors
static std::set<Ultrasonic*> m_sensors;
// Automatic round-robin mode
static std::atomic<bool> m_automaticEnabled;
std::shared_ptr<DigitalOutput> m_pingChannel;
std::shared_ptr<DigitalInput> m_echoChannel;