diff --git a/docs/apichanges.md b/docs/apichanges.md index fe23e291..88adfaec 100644 --- a/docs/apichanges.md +++ b/docs/apichanges.md @@ -4,6 +4,10 @@ API Changes {#apichanges} Here's a list of other API changes made to the library that break source/binary compatibility between releases: + * There were frequent misspellings of the word *Celsius* in the UPM + code. In some cases, these were in method names, which will cause + some API compatibility issues. These have all been corrected for UPM + versions after v.0.7.2. * Our **C++ header files** changed their extension from *.h* to *.hpp* in version 0.7.0, Intel provided examples and code samples also reflect this change but you will need to modify your `#include` directives in existing code @@ -12,4 +16,3 @@ compatibility between releases: * **stepmotor** driver API was changed significantly from v.0.4.1 to v.0.5.0 * **eboled** library was greatly improved in version 0.4.0 and the `draw()` function was removed in favor of a more complete GFX library implementation - \ No newline at end of file diff --git a/examples/c++/hp20x.cxx b/examples/c++/hp20x.cxx index ff7dd275..0aa82bba 100644 --- a/examples/c++/hp20x.cxx +++ b/examples/c++/hp20x.cxx @@ -53,7 +53,7 @@ int main(int argc, char **argv) // Output data every second until interrupted while (shouldRun) { - printf("Temperature: %f Celcius\n", bar->getTemperature()); + printf("Temperature: %f Celsius\n", bar->getTemperature()); printf("Pressure: %f Millibars\n", bar->getPressure()); printf("Altitude: %f Meters\n", bar->getAltitude()); diff --git a/examples/c++/mcp9808.cxx b/examples/c++/mcp9808.cxx index 32076da1..590ba3fe 100644 --- a/examples/c++/mcp9808.cxx +++ b/examples/c++/mcp9808.cxx @@ -18,7 +18,7 @@ int main() cout << "1 - read temp \t" ; cout << "2 - sleep mode \t"; cout << "3 - wake up" << endl; - cout << "4 - set mode to " << (temp->isCelsius() == true ? "Fahrenheit" : "Celcius") << endl; + cout << "4 - set mode to " << (temp->isCelsius() == true ? "Fahrenheit" : "Celsius") << endl; cout << "5 - show status bits" << endl; cout << "6 - Set Tcrit \t" ; cout << "7 - Set Tupper \t" ; @@ -53,7 +53,7 @@ int main() temp->shutDown(false); break; case 4: - cout << "set mode to " << (temp->isCelsius() ? "Fahrenheit" : "Celcius") << endl; + cout << "set mode to " << (temp->isCelsius() ? "Fahrenheit" : "Celsius") << endl; temp->setMode(!temp->isCelsius()); break; case 5: diff --git a/examples/c++/si7005.cxx b/examples/c++/si7005.cxx index 97e013db..db6ad289 100644 --- a/examples/c++/si7005.cxx +++ b/examples/c++/si7005.cxx @@ -35,7 +35,7 @@ int main () try { upm::SI7005* sensor = new upm::SI7005(EDISON_I2C_BUS, EDISON_GPIO_SI7005_CS); while (true) { - int temperature = sensor->getTemperatureCelcius(); + int temperature = sensor->getTemperatureCelsius(); int humidity = sensor->getHumidityRelative(); std::cout << "Temperature = " << temperature << "C" << std::endl; std::cout << "Humidity = " << humidity << "%" << std::endl; diff --git a/examples/c++/temperature-sensor.cxx b/examples/c++/temperature-sensor.cxx index d6134613..f077217a 100644 --- a/examples/c++/temperature-sensor.cxx +++ b/examples/c++/temperature-sensor.cxx @@ -76,7 +76,7 @@ int main () std::cout << "Temperature sensor " << temperatureSensor->getModuleName() << " detected" << std::endl; while (true) { try { - int value = temperatureSensor->getTemperatureCelcius(); + int value = temperatureSensor->getTemperatureCelsius(); std::cout << "Temperature = " << value << "C" << std::endl; } catch (std::exception& e) { std::cerr << e.what() << std::endl; diff --git a/examples/javascript/hp20x.js b/examples/javascript/hp20x.js index 04474595..c319a58e 100644 --- a/examples/javascript/hp20x.js +++ b/examples/javascript/hp20x.js @@ -37,7 +37,7 @@ bar.init(); // Output data every second until interrupted setInterval(function() { - console.log("Temperature: " + bar.getTemperature() + " Celcius"); + console.log("Temperature: " + bar.getTemperature() + " Celsius"); console.log("Pressure: " + bar.getPressure() + " Millibars"); console.log("Altitude: " + bar.getAltitude() + " Meters"); console.log(""); diff --git a/examples/python/hp20x.py b/examples/python/hp20x.py index f0ae5e6b..0eeff04f 100644 --- a/examples/python/hp20x.py +++ b/examples/python/hp20x.py @@ -46,7 +46,7 @@ bar = barometerObj.HP20X() bar.init() while(1): - print "Temperature:", bar.getTemperature(), "Celcius" + print "Temperature:", bar.getTemperature(), "Celsius" print "Pressure: ", bar.getPressure(), "Millibars" print "Altitude: ", bar.getAltitude(), "Meters" print diff --git a/src/adis16448/adis16448.cxx b/src/adis16448/adis16448.cxx index eb6f4a8c..8d0f55ec 100644 --- a/src/adis16448/adis16448.cxx +++ b/src/adis16448/adis16448.cxx @@ -212,10 +212,10 @@ float ADIS16448::gyroScale(int16_t sensorData) } ///////////////////////////////////////////////////////////////////////////////////////////// // Converts temperature data output from the sensorRead() function and returns temperature -// in degrees Celcius +// in degrees Celsius ///////////////////////////////////////////////////////////////////////////////////////////// // sensorData - data output from sensorRead() -// return - (float) signed/scaled temperature in degrees Celcius +// return - (float) signed/scaled temperature in degrees Celsius ///////////////////////////////////////////////////////////////////////////////////////// float ADIS16448::tempScale(int16_t sensorData) { @@ -226,7 +226,7 @@ float ADIS16448::tempScale(int16_t sensorData) // Converts barometer data output from sensorRead() function and returns pressure in bar ///////////////////////////////////////////////////////////////////////////////////////////// // sensorData - data output from sensorRead() -// return - (float) signed/scaled temperature in degrees Celcius +// return - (float) signed/scaled temperature in degrees Celsius ///////////////////////////////////////////////////////////////////////////////////////// float ADIS16448::pressureScale(int16_t sensorData) { @@ -238,7 +238,7 @@ float ADIS16448::pressureScale(int16_t sensorData) // reading in Gauss ///////////////////////////////////////////////////////////////////////////////////////////// // sensorData - data output from sensorRead() -// return - (float) signed/scaled temperature in degrees Celcius +// return - (float) signed/scaled temperature in degrees Celsius ///////////////////////////////////////////////////////////////////////////////////////// float ADIS16448::magnetometerScale(int16_t sensorData) { diff --git a/src/adxrs610/adxrs610.hpp b/src/adxrs610/adxrs610.hpp index ac8cdb03..6145d5e9 100644 --- a/src/adxrs610/adxrs610.hpp +++ b/src/adxrs610/adxrs610.hpp @@ -138,7 +138,7 @@ namespace upm { float getZeroPoint() { return m_zeroPoint; }; /** - * Return the measured temperature in Celcius. Note, the + * Return the measured temperature in Celsius. Note, the * datasheet says that this value is very repeatable, but is not * an accurate absolute temperature. * diff --git a/src/bmp280/bmp280.cxx b/src/bmp280/bmp280.cxx index 4e599756..54bc3c8b 100644 --- a/src/bmp280/bmp280.cxx +++ b/src/bmp280/bmp280.cxx @@ -40,7 +40,7 @@ using namespace std; // #define BMP280_USE_TEST_DATA -// conversion from fahrenheit to celcius and back +// conversion from fahrenheit to celsius and back static float f2c(float f) { diff --git a/src/bmp280/bmp280.hpp b/src/bmp280/bmp280.hpp index 447ac610..e2c9eba3 100644 --- a/src/bmp280/bmp280.hpp +++ b/src/bmp280/bmp280.hpp @@ -304,8 +304,8 @@ namespace upm { * to calling this method. * * @param fahrenheit true to return data in Fahrenheit, false for - * Celicus. Celcius is the default. - * @return The temperature in degrees Celcius or Fahrenheit. + * Celicus. Celsius is the default. + * @return The temperature in degrees Celsius or Fahrenheit. */ float getTemperature(bool fahrenheit=false); @@ -393,7 +393,7 @@ namespace upm { return "BMP280"; }; - int getTemperatureCelcius() + int getTemperatureCelsius() { return int(getTemperature(false)); }; diff --git a/src/bmpx8x/bmpx8x.cxx b/src/bmpx8x/bmpx8x.cxx index 5bf7f57c..7e221952 100644 --- a/src/bmpx8x/bmpx8x.cxx +++ b/src/bmpx8x/bmpx8x.cxx @@ -172,7 +172,7 @@ BMPX8X::getAltitude (float sealevelPressure) { int -BMPX8X::getTemperatureCelcius() { +BMPX8X::getTemperatureCelsius() { return static_cast(getTemperature() + 0.5); } diff --git a/src/bmpx8x/bmpx8x.hpp b/src/bmpx8x/bmpx8x.hpp index 40033feb..2b995868 100644 --- a/src/bmpx8x/bmpx8x.hpp +++ b/src/bmpx8x/bmpx8x.hpp @@ -144,10 +144,10 @@ class BMPX8X : public IPressureSensor, public ITemperatureSensor { float getAltitude (float sealevelPressure = 101325); /** - * Return latest calculated temperature value in Celcius + * Return latest calculated temperature value in Celsius * See ITemperatureSensor */ - int getTemperatureCelcius(); + int getTemperatureCelsius(); /** * Return latest calculated pressure value in Pascals diff --git a/src/bmx055/bma250e.cxx b/src/bmx055/bma250e.cxx index cee8a953..eee4edf0 100644 --- a/src/bmx055/bma250e.cxx +++ b/src/bmx055/bma250e.cxx @@ -33,7 +33,7 @@ using namespace upm; using namespace std; -// conversion from celcius to fahrenheit +// conversion from celsius to fahrenheit static float c2f(float c) { diff --git a/src/bmx055/bma250e.hpp b/src/bmx055/bma250e.hpp index 8d59a2cb..c867e6d1 100644 --- a/src/bmx055/bma250e.hpp +++ b/src/bmx055/bma250e.hpp @@ -1014,8 +1014,8 @@ namespace upm { * calling this method. * * @param fahrenheit true to return data in Fahrenheit, false for - * Celicus. Celcius is the default. - * @return The temperature in degrees Celcius or Fahrenheit. + * Celicus. Celsius is the default. + * @return The temperature in degrees Celsius or Fahrenheit. */ float getTemperature(bool fahrenheit=false); diff --git a/src/bmx055/bmg160.cxx b/src/bmx055/bmg160.cxx index 1a750ab9..b50302d9 100644 --- a/src/bmx055/bmg160.cxx +++ b/src/bmx055/bmg160.cxx @@ -35,7 +35,7 @@ using namespace std; #define BMG160_DEFAULT_CHIPID 0x0f -// conversion from celcius to fahrenheit +// conversion from celsius to fahrenheit static float c2f(float c) { diff --git a/src/bmx055/bmg160.hpp b/src/bmx055/bmg160.hpp index 6203434f..b9995aca 100644 --- a/src/bmx055/bmg160.hpp +++ b/src/bmx055/bmg160.hpp @@ -873,8 +873,8 @@ namespace upm { * calling this method. * * @param fahrenheit true to return data in Fahrenheit, false for - * Celicus. Celcius is the default. - * @return The temperature in degrees Celcius or Fahrenheit. + * Celicus. Celsius is the default. + * @return The temperature in degrees Celsius or Fahrenheit. */ float getTemperature(bool fahrenheit=false); diff --git a/src/bno055/bno055.cxx b/src/bno055/bno055.cxx index f59f2716..359de514 100644 --- a/src/bno055/bno055.cxx +++ b/src/bno055/bno055.cxx @@ -33,7 +33,7 @@ using namespace upm; using namespace std; -// conversion from fahrenheit to celcius and back +// conversion from fahrenheit to celsius and back static float f2c(float f) { @@ -245,20 +245,20 @@ void BNO055::setTemperatureSource(TEMP_SOURCES_T src) writeReg(REG_TEMP_SOURCE, src); } -void BNO055::setTemperatureUnits(bool celcius) +void BNO055::setTemperatureUnits(bool celsius) { setPage(0); uint8_t reg = readReg(REG_UNIT_SEL); - if (celcius) + if (celsius) reg &= ~UNIT_SEL_TEMP_UNIT; else reg |= UNIT_SEL_TEMP_UNIT; writeReg(REG_UNIT_SEL, reg); - m_tempIsC = celcius; + m_tempIsC = celsius; } void BNO055::setAccelerometerUnits(bool mg) diff --git a/src/bno055/bno055.hpp b/src/bno055/bno055.hpp index bc9fcbc1..0faa4640 100644 --- a/src/bno055/bno055.hpp +++ b/src/bno055/bno055.hpp @@ -896,7 +896,7 @@ namespace upm { * * By default, the constructor sets the acceleration units to * m/s^2, gyro and Euler units to degrees, and temperature to - * celcius. It then enters the NDOF fusion mode. + * celsius. It then enters the NDOF fusion mode. * * In addition, the internal clock is used so that compatibility * with other implementations is assured. If you are using a @@ -980,11 +980,11 @@ namespace upm { /** * Select the temperature units. This can be the Fahrenheit or - * Celcius. + * Celsius. * - * @param celcius true for Celius, false for Fahrenheit. + * @param celsius true for Celius, false for Fahrenheit. */ - void setTemperatureUnits(bool celcius); + void setTemperatureUnits(bool celsius); /** * Set the operating mode for the device. This places the device @@ -1060,8 +1060,8 @@ namespace upm { * calling this method. * * @param fahrenheit true to return data in Fahrenheit, false for - * Celicus. Celcius is the default. - * @return The temperature in degrees Celcius or Fahrenheit. + * Celicus. Celsius is the default. + * @return The temperature in degrees Celsius or Fahrenheit. */ float getTemperature(bool fahrenheit=false); diff --git a/src/cwlsxxa/cwlsxxa.cxx b/src/cwlsxxa/cwlsxxa.cxx index 8101698a..1369ab8a 100644 --- a/src/cwlsxxa/cwlsxxa.cxx +++ b/src/cwlsxxa/cwlsxxa.cxx @@ -33,7 +33,7 @@ using namespace std; // several aio reads. static const int maxSamples = 50; -// conversion from celcius to fahrenheit +// conversion from celsius to fahrenheit static float c2f(float c) { diff --git a/src/cwlsxxa/cwlsxxa.hpp b/src/cwlsxxa/cwlsxxa.hpp index 184eaadd..d22030f8 100644 --- a/src/cwlsxxa/cwlsxxa.hpp +++ b/src/cwlsxxa/cwlsxxa.hpp @@ -130,9 +130,9 @@ namespace upm { * constructor) then this function will always return 0C/32F. * * @param fahrenheit true to return the temperature in degrees - * fahrenheit, false to return the temperature in degrees celcius. - * The default is false (degrees Celcius). - * @return The last temperature reading in Celcius or Fahrenheit + * fahrenheit, false to return the temperature in degrees celsius. + * The default is false (degrees Celsius). + * @return The last temperature reading in Celsius or Fahrenheit */ float getTemperature(bool fahrenheit=false); @@ -174,7 +174,7 @@ namespace upm { bool m_hasTemp; bool m_hasHum; - // in Celcius + // in Celsius float m_temperature; float m_humidity; diff --git a/src/ds18b20/ds18b20.cxx b/src/ds18b20/ds18b20.cxx index 0848fe34..2c628e38 100644 --- a/src/ds18b20/ds18b20.cxx +++ b/src/ds18b20/ds18b20.cxx @@ -31,7 +31,7 @@ using namespace upm; using namespace std; -// conversion from celcius to fahrenheit +// conversion from celsius to fahrenheit static float c2f(float c) { return (c * (9.0 / 5.0) + 32.0); diff --git a/src/ds18b20/ds18b20.hpp b/src/ds18b20/ds18b20.hpp index 46d7abb2..e22ca69c 100644 --- a/src/ds18b20/ds18b20.hpp +++ b/src/ds18b20/ds18b20.hpp @@ -153,9 +153,9 @@ namespace upm { * * @param index The device index to access (starts at 0). * @param fahrenheit true to return the temperature in degrees - * fahrenheit, false to return the temperature in degrees celcius. - * The default is false (degrees Celcius). - * @return The last temperature reading in Celcius or Fahrenheit + * fahrenheit, false to return the temperature in degrees celsius. + * The default is false (degrees Celsius). + * @return The last temperature reading in Celsius or Fahrenheit */ float getTemperature(int index, bool fahrenheit=false); diff --git a/src/hdxxvxta/hdxxvxta.cxx b/src/hdxxvxta/hdxxvxta.cxx index 0d734925..da46a57c 100644 --- a/src/hdxxvxta/hdxxvxta.cxx +++ b/src/hdxxvxta/hdxxvxta.cxx @@ -29,7 +29,7 @@ using namespace upm; using namespace std; -// conversion from celcius to fahrenheit +// conversion from celsius to fahrenheit static float c2f(float c) { diff --git a/src/hdxxvxta/hdxxvxta.hpp b/src/hdxxvxta/hdxxvxta.hpp index a0f5f7ad..ebe71ff0 100644 --- a/src/hdxxvxta/hdxxvxta.hpp +++ b/src/hdxxvxta/hdxxvxta.hpp @@ -125,9 +125,9 @@ namespace upm { * constructor) then this function will always return 0C/32F. * * @param fahrenheit true to return the temperature in degrees - * fahrenheit, false to return the temperature in degrees celcius. - * The default is false (degrees Celcius). - * @return The last temperature reading in Celcius or Fahrenheit + * fahrenheit, false to return the temperature in degrees celsius. + * The default is false (degrees Celsius). + * @return The last temperature reading in Celsius or Fahrenheit */ float getTemperature(bool fahrenheit=false); @@ -154,7 +154,7 @@ namespace upm { // does this sensor support temperature reporting? bool m_hasTemp; - // in Celcius + // in Celsius float m_temperature; float m_humidity; diff --git a/src/hwxpxx/hwxpxx.cxx b/src/hwxpxx/hwxpxx.cxx index 51deae96..3362cfa0 100644 --- a/src/hwxpxx/hwxpxx.cxx +++ b/src/hwxpxx/hwxpxx.cxx @@ -32,7 +32,7 @@ using namespace upm; using namespace std; -// conversion from fahrenheit to celcius and back +// conversion from fahrenheit to celsius and back static float f2c(float f) { @@ -107,9 +107,9 @@ HWXPXX::HWXPXX(std::string device, int address, int baud, int bits, char parity, // temp scale if (coils[0]) - m_isCelcius = false; + m_isCelsius = false; else - m_isCelcius = true; + m_isCelsius = true; // current override switch status m_override = ((coils[1]) ? true : false); @@ -243,7 +243,7 @@ void HWXPXX::update() // temperature, we always store as C float tmpF = float((int16_t)data[1]) / 10.0; - if (m_isCelcius) + if (m_isCelsius) m_temperature = tmpF; else m_temperature = f2c(tmpF); @@ -319,11 +319,11 @@ void HWXPXX::setTemperatureScale(bool fahrenheit) { writeCoil(COIL_TEMP_SCALE, fahrenheit); - // now re-read and set m_isCelcius properly + // now re-read and set m_isCelsius properly if (readCoil(COIL_TEMP_SCALE)) - m_isCelcius = false; + m_isCelsius = false; else - m_isCelcius = true; + m_isCelsius = true; } string HWXPXX::getSlaveID() @@ -361,11 +361,11 @@ void HWXPXX::setSlaveAddress(int addr) ": modbus_set_slave() failed"); } - // now re-read and set m_isCelcius properly + // now re-read and set m_isCelsius properly if (readCoil(COIL_TEMP_SCALE)) - m_isCelcius = false; + m_isCelsius = false; else - m_isCelcius = true; + m_isCelsius = true; } void HWXPXX::setDebug(bool enable) diff --git a/src/hwxpxx/hwxpxx.hpp b/src/hwxpxx/hwxpxx.hpp index 1d2da733..47e3a0c2 100644 --- a/src/hwxpxx/hwxpxx.hpp +++ b/src/hwxpxx/hwxpxx.hpp @@ -124,9 +124,9 @@ namespace upm { * the scale the device is operating in natively. * * @param fahrenheit true to return the temperature in degrees - * fahrenheit, false to return the temperature in degrees celcius. - * The default is false (degrees Celcius). - * @return The last temperature reading in Celcius or Fahrenheit + * fahrenheit, false to return the temperature in degrees celsius. + * The default is false (degrees Celsius). + * @return The last temperature reading in Celsius or Fahrenheit */ float getTemperature(bool fahrenheit=false); @@ -173,7 +173,7 @@ namespace upm { /** * Return the current temperature offset stored on the device. * This is a value between -50 and +50, specified in tenths of a - * degree in whatever scale (Celcius or Fahrenheit) is in use. + * degree in whatever scale (Celsius or Fahrenheit) is in use. * This offset is applied to the returned temperature reading by the * device. * @@ -194,7 +194,7 @@ namespace upm { /** * Set the stored temperature offset on the device. This is a * value between -50 and +50, specified in tenths of a degree in - * what ever scale (Celcius or Fahrenheit) is in use. This offset + * what ever scale (Celsius or Fahrenheit) is in use. This offset * is applied to the returned temperature reading by the device. * * @param offset Offset in tenths of a degree with a range of -50 to +50 @@ -216,10 +216,10 @@ namespace upm { * detects this setting automatically and adjusts itself * accordingly, so this is generally never needed. It is used to * set the native reporting scale of the temperature either in - * degrees Celcius or Fahrenheit. Its setting will not affect + * degrees Celsius or Fahrenheit. Its setting will not affect * the operation of getTemperature(). * - * @param fahrenheit true to set Fahrenheit, false to set Celcius + * @param fahrenheit true to set Fahrenheit, false to set Celsius */ void setTemperatureScale(bool fahrenheit); @@ -269,7 +269,7 @@ namespace upm { modbus_t *m_mbContext; // is the device reporting in C or F? - bool m_isCelcius; + bool m_isCelsius; private: bool m_debugging; diff --git a/src/lm35/lm35.hpp b/src/lm35/lm35.hpp index 2bf6fbaa..675c4f87 100644 --- a/src/lm35/lm35.hpp +++ b/src/lm35/lm35.hpp @@ -75,9 +75,9 @@ namespace upm { ~LM35(); /** - * Returns the temperature in degrees Celcius + * Returns the temperature in degrees Celsius * - * @return The Temperature in degrees Celcius + * @return The Temperature in degrees Celsius */ float getTemperature(); diff --git a/src/lsm9ds0/lsm9ds0.hpp b/src/lsm9ds0/lsm9ds0.hpp index cc872cc6..0508a5db 100644 --- a/src/lsm9ds0/lsm9ds0.hpp +++ b/src/lsm9ds0/lsm9ds0.hpp @@ -1294,7 +1294,7 @@ namespace upm { * the correct value, so I made a 'guess'. If it's wrong, and you * figure it out, send a patch! * - * @return the temperature value in degrees Celcius + * @return the temperature value in degrees Celsius */ float getTemperature(); diff --git a/src/mcp9808/mcp9808.hpp b/src/mcp9808/mcp9808.hpp index ac2f4d11..a3c99a25 100644 --- a/src/mcp9808/mcp9808.hpp +++ b/src/mcp9808/mcp9808.hpp @@ -188,7 +188,7 @@ namespace upm { * setMode - sets temperature reporting mode. * * @param celsius. Default is true. If false all - * temps will be reported in fahrenhiet. + * temps will be reported in fahrenheit. */ void setMode(bool celsius = true) { diff --git a/src/mpu9150/mpu60x0.hpp b/src/mpu9150/mpu60x0.hpp index 23f292f5..d114ba35 100644 --- a/src/mpu9150/mpu60x0.hpp +++ b/src/mpu9150/mpu60x0.hpp @@ -820,7 +820,7 @@ namespace upm { /** * get the temperature value * - * @return the temperature value in degrees Celcius + * @return the temperature value in degrees Celsius */ virtual float getTemperature(); diff --git a/src/mpu9150/mpu9250.hpp b/src/mpu9150/mpu9250.hpp index 3b1c50cc..cda71ed1 100644 --- a/src/mpu9150/mpu9250.hpp +++ b/src/mpu9150/mpu9250.hpp @@ -73,7 +73,7 @@ namespace upm { /** * get the temperature value * - * @return the temperature value in degrees Celcius + * @return the temperature value in degrees Celsius */ float getTemperature(); diff --git a/src/ozw/tzemt400.cxx b/src/ozw/tzemt400.cxx index f7c432a6..200fd492 100644 --- a/src/ozw/tzemt400.cxx +++ b/src/ozw/tzemt400.cxx @@ -31,7 +31,7 @@ using namespace upm; using namespace std; -// conversion from fahrenheit to celcius and back +// conversion from fahrenheit to celsius and back static float f2c(float f) { diff --git a/src/ozw/tzemt400.hpp b/src/ozw/tzemt400.hpp index c6435f01..204a8af9 100644 --- a/src/ozw/tzemt400.hpp +++ b/src/ozw/tzemt400.hpp @@ -74,12 +74,12 @@ namespace upm { ~TZEMT400(); /** - * Return the current measured temperature in Celcius or + * Return the current measured temperature in Celsius or * Fahrenheit. * * @param fahrenheit true to return data in Fahrenheit, false for - * Celicus. Celcius is the default. - * @return The temperature in degrees Celcius or Fahrenheit. + * Celicus. Celsius is the default. + * @return The temperature in degrees Celsius or Fahrenheit. */ float getTemperature(bool fahrenheit=false); @@ -100,25 +100,25 @@ namespace upm { std::string getOperatingState(); /** - * Return the current Heating Point temperature in Celcius or + * Return the current Heating Point temperature in Celsius or * Fahrenheit. This is the temperature at which the thermostat * will want to engage Heat. * * @param fahrenheit true to return data in Fahrenheit, false for - * Celicus. Celcius is the default. - * @return The Heating Point temperature in degrees Celcius or + * Celicus. Celsius is the default. + * @return The Heating Point temperature in degrees Celsius or * Fahrenheit. */ float getHeatingPointTemperature(bool fahrenheit=false); /** - * Return the current Cooling Point temperature in Celcius or + * Return the current Cooling Point temperature in Celsius or * Fahrenheit. This is the temperature at which the thermostat * will want to engage Cooling. * * @param fahrenheit true to return data in Fahrenheit, false for - * Celicus. Celcius is the default. - * @return The Cooling Point temperature in degrees Celcius or + * Celicus. Celsius is the default. + * @return The Cooling Point temperature in degrees Celsius or * Fahrenheit. */ float getCoolingPointTemperature(bool fahrenheit=false); diff --git a/src/rhusb/rhusb.cxx b/src/rhusb/rhusb.cxx index ca51d6e9..c0575996 100644 --- a/src/rhusb/rhusb.cxx +++ b/src/rhusb/rhusb.cxx @@ -37,7 +37,7 @@ static const int maxBuffer = 1024; // baud rate is always 9600 static const int baudRate = 9600; -// conversion from celcius to fahrenheit +// conversion from celsius to fahrenheit static float c2f(float c) { diff --git a/src/rhusb/rhusb.hpp b/src/rhusb/rhusb.hpp index 4fd45485..ee44d6ef 100644 --- a/src/rhusb/rhusb.hpp +++ b/src/rhusb/rhusb.hpp @@ -79,9 +79,9 @@ namespace upm { * prior to calling this method. * * @param fahrenheit true to return the temperature in degrees - * fahrenheit, false to return the temperature in degrees celcius. - * The default is false (degrees Celcius). - * @return The last temperature reading in Celcius or Fahrenheit + * fahrenheit, false to return the temperature in degrees celsius. + * The default is false (degrees Celsius). + * @return The last temperature reading in Celsius or Fahrenheit */ float getTemperature(bool fahrenheit=false); diff --git a/src/si7005/si7005.cxx b/src/si7005/si7005.cxx index 6dd07a65..f79afc3b 100644 --- a/src/si7005/si7005.cxx +++ b/src/si7005/si7005.cxx @@ -95,7 +95,7 @@ SI7005::getTemperatureRaw () { } int -SI7005::getTemperatureCelcius () { +SI7005::getTemperatureCelsius () { uint16_t rawTemperature = getTemperatureRaw(); rawTemperature = ((rawTemperature >> 2) & 0xFFFF); last_temperature = ((float)rawTemperature) / SI7005_TEMPERATURE_SLOPE - SI7005_TEMPERATURE_OFFSET; diff --git a/src/si7005/si7005.hpp b/src/si7005/si7005.hpp index bec2825f..d47d1480 100644 --- a/src/si7005/si7005.hpp +++ b/src/si7005/si7005.hpp @@ -82,7 +82,7 @@ class SI7005 : public ITemperatureSensor, public IHumiditySensor { /** * Get temperature measurement. */ - int getTemperatureCelcius (); + int getTemperatureCelsius (); /** * Get relative humidity measurement. diff --git a/src/t3311/t3311.cxx b/src/t3311/t3311.cxx index 342ebfa1..97c04b94 100644 --- a/src/t3311/t3311.cxx +++ b/src/t3311/t3311.cxx @@ -34,7 +34,7 @@ using namespace upm; using namespace std; -// conversion from fahrenheit to celcius and back +// conversion from fahrenheit to celsius and back static float f2c(float f) { @@ -133,9 +133,9 @@ T3311::T3311(std::string device, int address, int baud, int bits, char parity, // our temperature data in. tmp = readInputReg(REG_UNIT_SETTINGS); if (tmp & 0x0001) - m_isCelcius = false; + m_isCelsius = false; else - m_isCelcius = true; + m_isCelsius = true; // read in the the FW_LO register (BCD encoded) and convert tmp = readInputReg(REG_FW_LO); @@ -225,7 +225,7 @@ void T3311::update() // temperature first, we always store as C float tmpF = float((int16_t)data[0]) / 10.0; - if (m_isCelcius) + if (m_isCelsius) m_temperature = tmpF; else m_temperature = f2c(tmpF); @@ -240,7 +240,7 @@ void T3311::update() { // we always store temps in C tmpF = float((int16_t)data[4]) / 10.0; - if (m_isCelcius) + if (m_isCelsius) m_dewPointTemperature = tmpF; else m_dewPointTemperature = f2c(tmpF); diff --git a/src/t3311/t3311.hpp b/src/t3311/t3311.hpp index f84dc95a..ec577e52 100644 --- a/src/t3311/t3311.hpp +++ b/src/t3311/t3311.hpp @@ -90,7 +90,7 @@ namespace upm { // Advantech-ADAM standard section) in the "Description of // communications protocols of TXXXX series" document. We use // it to simply detect whether the device is configured for - // Celcius or Fahrenheit data and compensate internally. + // Celsius or Fahrenheit data and compensate internally. REG_UNIT_SETTINGS = 0x203F, @@ -144,9 +144,9 @@ namespace upm { * prior to calling this method. * * @param fahrenheit true to return the temperature in degrees - * fahrenheit, false to return the temperature in degrees celcius. - * The default is false (degrees Celcius). - * @return The last temperature reading in Celcius or Fahrenheit + * fahrenheit, false to return the temperature in degrees celsius. + * The default is false (degrees Celsius). + * @return The last temperature reading in Celsius or Fahrenheit */ float getTemperature(bool fahrenheit=false); @@ -183,9 +183,9 @@ namespace upm { * extendedDataAvailable() returns true). * * @param fahrenheit true to return the temperature in degrees - * fahrenheit, false to return the temperature in degrees celcius. - * The default is false (degrees Celcius). - * @return The last dew point temperature reading in Celcius or + * fahrenheit, false to return the temperature in degrees celsius. + * The default is false (degrees Celsius). + * @return The last dew point temperature reading in Celsius or * Fahrenheit */ float getDewPointTemperature(bool fahrenheit=false); @@ -281,7 +281,7 @@ namespace upm { modbus_t *m_mbContext; // is the device reporting in C or F? - bool m_isCelcius; + bool m_isCelsius; // Is the device FW > than 2.44? bool m_isExtendedDataAvailable; diff --git a/src/t8100/t8100.cxx b/src/t8100/t8100.cxx index 6e5b596a..78e5c83c 100644 --- a/src/t8100/t8100.cxx +++ b/src/t8100/t8100.cxx @@ -34,7 +34,7 @@ using namespace upm; using namespace std; -// conversion from fahrenheit to celcius and back +// conversion from fahrenheit to celsius and back static float f2c(float f) { @@ -56,7 +56,7 @@ T8100::T8100(uint32_t targetDeviceObjectID) : checkReliability(false); m_isTempInitialized = false; - m_isCelcius = false; + m_isCelsius = false; m_humidity = 0.0; m_temperature = 0.0; @@ -78,7 +78,7 @@ void T8100::update() float tmpF = getAnalogInput(AI_Temperature_Thermistor); - if (m_isCelcius) + if (m_isCelsius) m_temperature = tmpF; else m_temperature = f2c(tmpF); @@ -101,7 +101,7 @@ void T8100::setTemperatureScale(bool fahrenheit) setBinaryValue(BV_Temperature_Units, fahrenheit); m_isTempInitialized = true; - m_isCelcius = (fahrenheit) ? false : true; + m_isCelsius = (fahrenheit) ? false : true; } bool T8100::getTemperatureScale() @@ -109,7 +109,7 @@ bool T8100::getTemperatureScale() bool scale = getBinaryValue(BV_Temperature_Units); m_isTempInitialized = true; - m_isCelcius = !scale; + m_isCelsius = !scale; return scale; } @@ -126,7 +126,7 @@ void T8100::setTemperatureOffset(float value) { throw std::out_of_range(std::string(__FUNCTION__) + ": value must be between -50 and 50," - + " in degrees Celcius"); + + " in degrees Celsius"); } diff --git a/src/t8100/t8100.hpp b/src/t8100/t8100.hpp index bc53d825..71825520 100644 --- a/src/t8100/t8100.hpp +++ b/src/t8100/t8100.hpp @@ -167,9 +167,9 @@ namespace upm { * prior to calling this method. * * @param fahrenheit true to return the temperature in degrees - * fahrenheit, false to return the temperature in degrees celcius. - * The default is false (degrees Celcius). - * @return The last temperature reading in Celcius or Fahrenheit. + * fahrenheit, false to return the temperature in degrees celsius. + * The default is false (degrees Celsius). + * @return The last temperature reading in Celsius or Fahrenheit. */ float getTemperature(bool fahrenheit=false); @@ -186,20 +186,20 @@ namespace upm { } /** - * Set the device temperature scale to Celcius of Fahrenheit. For + * Set the device temperature scale to Celsius of Fahrenheit. For * devices with an LCD display, this will affect which scale is * displayed. When changing the scale, it may take several * seconds for the setting to take effect. * * @param fahrenheit true to set the scale to fahrenheit, false - * for celcius. + * for celsius. */ void setTemperatureScale(bool fahrenheit); /** * Get the device temperature scale. * - * @return true if scale is fahrenheit, false for celcius. + * @return true if scale is fahrenheit, false for celsius. */ bool getTemperatureScale(); @@ -213,7 +213,7 @@ namespace upm { /** * Set the device temperature offset. The offset is applied by * the device internally to the temperature reading. The offset - * must always be specified in degrees Celcius. Valid values must + * must always be specified in degrees Celsius. Valid values must * be between -50 and 50. * * @param value The temperature offset to configure. @@ -373,7 +373,7 @@ namespace upm { // Have we checked the device's temperature unit setting yet bool m_isTempInitialized; - // Is the device configured for Celcius? - bool m_isCelcius; + // Is the device configured for Celsius? + bool m_isCelsius; }; } diff --git a/src/tb7300/tb7300.cxx b/src/tb7300/tb7300.cxx index d4f14ccc..7d11488d 100644 --- a/src/tb7300/tb7300.cxx +++ b/src/tb7300/tb7300.cxx @@ -33,7 +33,7 @@ using namespace upm; using namespace std; -// conversion from fahrenheit to celcius and back +// conversion from fahrenheit to celsius and back static float f2c(float f) { @@ -55,7 +55,7 @@ TB7300::TB7300(uint32_t targetDeviceObjectID) : checkReliability(false); m_isTempInitialized = false; - m_isCelcius = false; + m_isCelsius = false; // room temperature only m_temperature = 0.0; @@ -75,7 +75,7 @@ void TB7300::update() float tmpF = getAnalogValue(AV_Room_Temperature); - if (m_isCelcius) + if (m_isCelsius) m_temperature = tmpF; else m_temperature = f2c(tmpF); @@ -94,7 +94,7 @@ void TB7300::setTemperatureScale(bool fahrenheit) setBinaryValue(BV_Temperature_Scale, fahrenheit); m_isTempInitialized = true; - m_isCelcius = (fahrenheit) ? false : true; + m_isCelsius = (fahrenheit) ? false : true; } bool TB7300::getTemperatureScale() @@ -102,7 +102,7 @@ bool TB7300::getTemperatureScale() bool scale = getBinaryValue(BV_Temperature_Scale); m_isTempInitialized = true; - m_isCelcius = !scale; + m_isCelsius = !scale; return scale; } diff --git a/src/tb7300/tb7300.hpp b/src/tb7300/tb7300.hpp index 2b6a0cce..425bf63d 100644 --- a/src/tb7300/tb7300.hpp +++ b/src/tb7300/tb7300.hpp @@ -222,27 +222,27 @@ namespace upm { * prior to calling this method. * * @param fahrenheit true to return the temperature in degrees - * fahrenheit, false to return the temperature in degrees celcius. - * The default is false (degrees Celcius). - * @return The last temperature reading in Celcius or Fahrenheit. + * fahrenheit, false to return the temperature in degrees celsius. + * The default is false (degrees Celsius). + * @return The last temperature reading in Celsius or Fahrenheit. */ float getTemperature(bool fahrenheit=false); /** - * Set the device temperature scale to Celcius of Fahrenheit. For + * Set the device temperature scale to Celsius of Fahrenheit. For * devices with an LCD display, this will affect which scale is * displayed. When changing the scale, it may take several * seconds for the setting to take effect. * * @param fahrenheit true to set the scale to fahrenheit, false - * for celcius. + * for celsius. */ void setTemperatureScale(bool fahrenheit); /** * Get the device temperature scale. * - * @return true if scale is fahrenheit, false for celcius. + * @return true if scale is fahrenheit, false for celsius. */ bool getTemperatureScale(); @@ -251,7 +251,7 @@ namespace upm { float m_temperature; bool m_isTempInitialized; - bool m_isCelcius; + bool m_isCelsius; private: }; diff --git a/src/teams/teams.cxx b/src/teams/teams.cxx index eab59c19..e8e8fbcc 100644 --- a/src/teams/teams.cxx +++ b/src/teams/teams.cxx @@ -33,7 +33,7 @@ using namespace std; // several aio reads. static const int maxSamples = 50; -// conversion from celcius to fahrenheit +// conversion from celsius to fahrenheit static float c2f(float c) { diff --git a/src/teams/teams.hpp b/src/teams/teams.hpp index 6e8ed8f7..90e1c330 100644 --- a/src/teams/teams.hpp +++ b/src/teams/teams.hpp @@ -100,9 +100,9 @@ namespace upm { * prior to calling this method. * * @param fahrenheit true to return the temperature in degrees - * fahrenheit, false to return the temperature in degrees celcius. - * The default is false (degrees Celcius). - * @return The last temperature reading in Celcius or Fahrenheit + * fahrenheit, false to return the temperature in degrees celsius. + * The default is false (degrees Celsius). + * @return The last temperature reading in Celsius or Fahrenheit */ float getTemperature(bool fahrenheit=false); @@ -161,7 +161,7 @@ namespace upm { bool m_connected; float m_rawMilliamps; - // in Celcius + // in Celsius float m_temperature; // in case an offset should be applied to the cumputed current diff --git a/src/tex00/tex00.cxx b/src/tex00/tex00.cxx index 2a3c1ad8..8335b294 100644 --- a/src/tex00/tex00.cxx +++ b/src/tex00/tex00.cxx @@ -32,7 +32,7 @@ using namespace std; // we average over several aio reads. static const int maxSamples = 10; -// conversion from celcius to fahrenheit +// conversion from celsius to fahrenheit static float c2f(float c) { diff --git a/src/tex00/tex00.hpp b/src/tex00/tex00.hpp index d747f7be..4b2616d1 100644 --- a/src/tex00/tex00.hpp +++ b/src/tex00/tex00.hpp @@ -122,9 +122,9 @@ namespace upm { * prior to calling this method. * * @param fahrenheit true to return the temperature in degrees - * fahrenheit, false to return the temperature in degrees celcius. - * The default is false (degrees Celcius). - * @return The last temperature reading in Celcius or Fahrenheit + * fahrenheit, false to return the temperature in degrees celsius. + * The default is false (degrees Celsius). + * @return The last temperature reading in Celsius or Fahrenheit */ float getTemperature(bool fahrenheit=false); @@ -169,7 +169,7 @@ namespace upm { float m_aref; int m_aResTemp; - // in Celcius + // in Celsius float m_temperature; // temp reading out of range bool m_outOfRange; diff --git a/src/upm/iTemperatureSensor.hpp b/src/upm/iTemperatureSensor.hpp index 7b393e86..2ec6c032 100644 --- a/src/upm/iTemperatureSensor.hpp +++ b/src/upm/iTemperatureSensor.hpp @@ -34,7 +34,7 @@ namespace upm class ITemperatureSensor : public IModuleStatus { public: - virtual int getTemperatureCelcius () = 0; + virtual int getTemperatureCelsius () = 0; virtual ~ITemperatureSensor() {} };