From 698c53ffebb0d730502eace449076a93f39a6700 Mon Sep 17 00:00:00 2001 From: Zefiro Date: Tue, 24 Nov 2020 23:56:24 +0100 Subject: [PATCH] Fixed typos in comments --- tasmota/support_float.ino | 8 ++------ tasmota/xdrv_04_light.ino | 12 ++++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/tasmota/support_float.ino b/tasmota/support_float.ino index e1b97ca89..1e2edc3f2 100644 --- a/tasmota/support_float.ino +++ b/tasmota/support_float.ino @@ -379,7 +379,7 @@ float sqrt1(const float x) // // PRE-CONDITIONS (if not satisfied, you may 'halt and catch fire') // from_min < from_max (not checked) -// from_min <= num <= from-max (chacked) +// from_min <= num <= from_max (checked) // POST-CONDITIONS // to_min <= result <= to_max // @@ -387,11 +387,7 @@ uint16_t changeUIntScale(uint16_t inum, uint16_t ifrom_min, uint16_t ifrom_max, uint16_t ito_min, uint16_t ito_max) { // guard-rails if (ifrom_min >= ifrom_max) { - if (ito_min > ito_max) { - return ito_max; - } else { - return ito_min; // invalid input, return arbitrary value - } + return (ito_min > ito_max ? ito_max : ito_min); // invalid input, return arbitrary value } // convert to uint31, it's more verbose but code is more compact uint32_t num = inum; diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino index ea01afb28..6841c4c76 100644 --- a/tasmota/xdrv_04_light.ino +++ b/tasmota/xdrv_04_light.ino @@ -93,8 +93,8 @@ * 1 channel - 0:Brightness * 2 channels - 0:Coldwhite 1:Warmwhite * 3 channels - 0:Red 1:Green 2:Blue - * 4 chennels - 0:Red 1:Green 2:Blue 3:White - * 5 chennels - 0:Red 1:Green 2:Blue 3:ColdWhite 4:Warmwhite + * 4 channels - 0:Red 1:Green 2:Blue 3:White + * 5 channels - 0:Red 1:Green 2:Blue 3:ColdWhite 4:Warmwhite * * 3. In LightAnimate(), final PWM values are computed at next tick. * .a If color did not change since last tick - ignore. @@ -357,7 +357,7 @@ static uint32_t min3(uint32_t a, uint32_t b, uint32_t c) { // // Note: If you want the actual RGB, you need to multiply with Bri, or use getActualRGBCW() // Note: all values are stored as unsigned integer, no floats. -// Note: you can query vaules from this singleton. But to change values, +// Note: you can query values from this singleton. But to change values, // use the LightController - changing this object will have no effect on actual light. // class LightStateClass { @@ -1180,7 +1180,7 @@ LightControllerClass light_controller = LightControllerClass(light_state); /*********************************************************************************************\ * Change scales from 8 bits to 10 bits and vice versa \*********************************************************************************************/ -// 8 to 10 to 8 is garanteed to give the same result +// 8 to 10 to 8 is guaranteed to give the same result uint16_t change8to10(uint8_t v) { return changeUIntScale(v, 0, 255, 0, 1023); } @@ -1858,9 +1858,9 @@ void LightAnimate(void) // or set a maximum of PWM_MAX_SLEEP if light is on or Fade is running if (Light.power || Light.fade_running) { if (Settings.sleep > PWM_MAX_SLEEP) { - TasmotaGlobal.sleep = PWM_MAX_SLEEP; // set a maxumum value of 10 milliseconds to ensure that animations are smooth + TasmotaGlobal.sleep = PWM_MAX_SLEEP; // set a maximum value (in milliseconds) to sleep to ensure that animations are smooth } else { - TasmotaGlobal.sleep = Settings.sleep; // or keep the current sleep if it's lower than 50 + TasmotaGlobal.sleep = Settings.sleep; // or keep the current sleep if it's low enough } } else { TasmotaGlobal.sleep = Settings.sleep;