mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
Wunused-but-set-variable: Fixed all unused but set variables
This commit addresses all warnings emitted from -Wunused-but-set-variable in the C++ src. Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
parent
ee27485218
commit
33471436bf
@ -203,14 +203,13 @@ HTU21D::testSensor(void)
|
|||||||
float fTemp, fHum;
|
float fTemp, fHum;
|
||||||
float fTempMax, fTempMin;
|
float fTempMax, fTempMin;
|
||||||
float fHumMax, fHumMin;
|
float fHumMax, fHumMin;
|
||||||
float fHumFirst, fTempFirst;
|
float fTempFirst;
|
||||||
|
|
||||||
fprintf(stdout, "Executing Sensor Test\n" );
|
fprintf(stdout, "Executing Sensor Test\n" );
|
||||||
|
|
||||||
fHum = getHumidity(true);
|
fHum = getHumidity(true);
|
||||||
fTemp = getTemperature(false);
|
fTemp = getTemperature(false);
|
||||||
fTempFirst = fTempMax = fTempMin = fTemp;
|
fTempFirst = fTempMax = fTempMin = fTemp;
|
||||||
fHumFirst = fHumMax = fHumMin = fHum;
|
|
||||||
|
|
||||||
// Turn on the heater to make a sensor change
|
// Turn on the heater to make a sensor change
|
||||||
setHeater(true);
|
setHeater(true);
|
||||||
|
@ -60,13 +60,11 @@ LPD8806::LPD8806 (uint16_t pixelCount, uint8_t csn) : m_csnPinCtx(csn), m_spi(0)
|
|||||||
|
|
||||||
uint8_t latchBytes;
|
uint8_t latchBytes;
|
||||||
uint16_t dataBytes, totalBytes;
|
uint16_t dataBytes, totalBytes;
|
||||||
uint16_t numBytes = 0;
|
|
||||||
|
|
||||||
dataBytes = m_pixelsCount * 3;
|
dataBytes = m_pixelsCount * 3;
|
||||||
latchBytes = (m_pixelsCount + 31) / 32;
|
latchBytes = (m_pixelsCount + 31) / 32;
|
||||||
totalBytes = dataBytes + latchBytes;
|
totalBytes = dataBytes + latchBytes;
|
||||||
if ((m_pixels = (uint8_t *) malloc(totalBytes))) {
|
if ((m_pixels = (uint8_t *) malloc(totalBytes))) {
|
||||||
numBytes = totalBytes;
|
|
||||||
memset ( m_pixels , 0x80, dataBytes); // Init to RGB 'off' state
|
memset ( m_pixels , 0x80, dataBytes); // Init to RGB 'off' state
|
||||||
memset (&m_pixels[dataBytes], 0 , latchBytes); // Clear latch bytes
|
memset (&m_pixels[dataBytes], 0 , latchBytes); // Clear latch bytes
|
||||||
}
|
}
|
||||||
|
@ -51,11 +51,10 @@ MAX31723::MAX31723 (int csn) : m_csnPinCtx(csn), m_spi(0) {
|
|||||||
|
|
||||||
short
|
short
|
||||||
MAX31723::getTemperature () {
|
MAX31723::getTemperature () {
|
||||||
uint8_t lsb = 0;
|
|
||||||
uint8_t msb = 0;
|
uint8_t msb = 0;
|
||||||
short temperature = 0;
|
short temperature = 0;
|
||||||
|
|
||||||
lsb = readRegister (R_TEMPERATURE_LSB);
|
readRegister (R_TEMPERATURE_LSB);
|
||||||
msb = readRegister (R_TEMPERATURE_MSB);
|
msb = readRegister (R_TEMPERATURE_MSB);
|
||||||
|
|
||||||
if ((msb & 0x80) != 0) {
|
if ((msb & 0x80) != 0) {
|
||||||
@ -91,12 +90,11 @@ MAX31723::readRegister (uint8_t reg) {
|
|||||||
void
|
void
|
||||||
MAX31723::writeRegister (uint8_t reg, uint8_t data) {
|
MAX31723::writeRegister (uint8_t reg, uint8_t data) {
|
||||||
uint8_t buffer[2] = { 0x00, 0x00 };
|
uint8_t buffer[2] = { 0x00, 0x00 };
|
||||||
uint8_t* sensorData = NULL;
|
|
||||||
|
|
||||||
CSOn ();
|
CSOn ();
|
||||||
buffer[0] = reg;
|
buffer[0] = reg;
|
||||||
buffer[1] = data;
|
buffer[1] = data;
|
||||||
sensorData = m_spi.write(buffer, 2);
|
m_spi.write(buffer, 2);
|
||||||
CSOff ();
|
CSOff ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user