Wreorder: fix a variety of re-ordering warnings

Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
Jon Trulson
2016-11-03 11:56:48 -06:00
parent d33e7e532e
commit 0589f445f0
14 changed files with 51 additions and 54 deletions

View File

@ -32,10 +32,10 @@
using namespace std;
using namespace upm;
RGBRingCoder::RGBRingCoder(int en, int latch, int clear, int clk, int dat,
int sw, int encA, int encB, int red,
RGBRingCoder::RGBRingCoder(int en, int latch, int clear, int clk, int dat,
int sw, int encA, int encB, int red,
int green, int blue) :
m_gpioEn(en), m_gpioLatch(latch), m_gpioClear(clear), m_gpioClock(clk),
m_gpioEn(en), m_gpioLatch(latch), m_gpioClear(clear), m_gpioClock(clk),
m_gpioData(dat), m_gpioSwitch(sw), m_gpioEncA(encA), m_gpioEncB(encB),
m_pwmRed(red), m_pwmGreen(green), m_pwmBlue(blue)
{
@ -48,15 +48,15 @@ RGBRingCoder::RGBRingCoder(int en, int latch, int clear, int clk, int dat,
// latch
m_gpioLatch.dir(mraa::DIR_OUT);
m_gpioLatch.write(0);
// clear, HIGH
m_gpioClear.dir(mraa::DIR_OUT);
m_gpioLatch.write(1);
// clock
m_gpioClock.dir(mraa::DIR_OUT);
m_gpioClock.write(0);
// data
m_gpioData.dir(mraa::DIR_OUT);
m_gpioData.write(0);
@ -65,7 +65,7 @@ RGBRingCoder::RGBRingCoder(int en, int latch, int clear, int clk, int dat,
m_gpioSwitch.dir(mraa::DIR_IN);
m_gpioSwitch.mode(mraa::MODE_HIZ); // no pullup
m_gpioSwitch.write(0);
// ecoder A interrupt
m_gpioEncA.dir(mraa::DIR_IN);
m_gpioEncA.mode(mraa::MODE_PULLUP);
@ -136,7 +136,7 @@ void RGBRingCoder::interruptHandler(void *ctx)
// First, find the newEncoderState. This'll be a 2-bit value
// the msb is the state of the B pin. The lsb is the state
// of the A pin on the encoder.
newEncoderState = (This->m_gpioEncB.read()<<1) |
newEncoderState = (This->m_gpioEncB.read()<<1) |
(This->m_gpioEncA.read());
// Now we pair oldEncoderState with new encoder state

View File

@ -57,7 +57,7 @@ namespace upm {
*
* The device requires 11 pins, 3 of which must be PWM-capable
* (for the RGB LEDs).
*
*
* @image html rgbringcoder.jpg
* @snippet rgbringcoder.cxx Interesting
*/
@ -80,7 +80,7 @@ namespace upm {
* @param green RGB green LED PWM
* @param blue RGB blue LED PWM
*/
RGBRingCoder(int en, int latch, int clear, int clk, int dat, int sw,
RGBRingCoder(int en, int latch, int clear, int clk, int dat, int sw,
int encA, int encB, int red, int green, int blue);
/**
@ -98,26 +98,26 @@ namespace upm {
*/
void setRingLEDS(uint16_t bits);
/*
/**
* Returns the state of the button
*
* @return True if the button is pressed, false otherwise
*/
bool getButtonState();
/*
/*
* Gets the current rotary encoder counter value
*
* @return Current counter value
*/
int getEncoderPosition() { return m_counter; };
/*
/**
* Sets the encoder counter to 0
*/
void clearEncoderPosition() { m_counter = 0; };
/*
/**
* Sets the intensity of the red, green, and blue LEDs. Values can
* be between 0.0 and 1.0. Lower is brighter, higher is dimmer.
*
@ -128,7 +128,7 @@ namespace upm {
void setRGBLED(float r, float g, float b);
private:
mraa::Gpio m_gpioEn;
mraa::Gpio m_gpioLatch;
@ -138,17 +138,15 @@ namespace upm {
mraa::Gpio m_gpioSwitch;
mraa::Gpio m_gpioEncA;
mraa::Gpio m_gpioEncB;
mraa::Pwm m_pwmRed;
mraa::Pwm m_pwmGreen;
mraa::Pwm m_pwmBlue;
mraa::Gpio m_gpioEncA;
mraa::Gpio m_gpioEncB;
static void interruptHandler(void *ctx);
volatile int m_counter;
};
}