Merge pull request #9971 from Zefiro/development

Fixed typos in comments
This commit is contained in:
Theo Arends 2020-11-29 08:09:11 +01:00 committed by GitHub
commit 8eacb36f71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 12 deletions

View File

@ -379,7 +379,7 @@ float sqrt1(const float x)
// //
// PRE-CONDITIONS (if not satisfied, you may 'halt and catch fire') // PRE-CONDITIONS (if not satisfied, you may 'halt and catch fire')
// from_min < from_max (not checked) // from_min < from_max (not checked)
// from_min <= num <= from-max (chacked) // from_min <= num <= from_max (checked)
// POST-CONDITIONS // POST-CONDITIONS
// to_min <= result <= to_max // 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) { uint16_t ito_min, uint16_t ito_max) {
// guard-rails // guard-rails
if (ifrom_min >= ifrom_max) { if (ifrom_min >= ifrom_max) {
if (ito_min > ito_max) { return (ito_min > ito_max ? ito_max : ito_min); // invalid input, return arbitrary value
return ito_max;
} else {
return ito_min; // invalid input, return arbitrary value
}
} }
// convert to uint31, it's more verbose but code is more compact // convert to uint31, it's more verbose but code is more compact
uint32_t num = inum; uint32_t num = inum;

View File

@ -93,8 +93,8 @@
* 1 channel - 0:Brightness * 1 channel - 0:Brightness
* 2 channels - 0:Coldwhite 1:Warmwhite * 2 channels - 0:Coldwhite 1:Warmwhite
* 3 channels - 0:Red 1:Green 2:Blue * 3 channels - 0:Red 1:Green 2:Blue
* 4 chennels - 0:Red 1:Green 2:Blue 3:White * 4 channels - 0:Red 1:Green 2:Blue 3:White
* 5 chennels - 0:Red 1:Green 2:Blue 3:ColdWhite 4:Warmwhite * 5 channels - 0:Red 1:Green 2:Blue 3:ColdWhite 4:Warmwhite
* *
* 3. In LightAnimate(), final PWM values are computed at next tick. * 3. In LightAnimate(), final PWM values are computed at next tick.
* .a If color did not change since last tick - ignore. * .a If color did not change since last tick - ignore.
@ -358,7 +358,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: 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: 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. // use the LightController - changing this object will have no effect on actual light.
// //
class LightStateClass { class LightStateClass {
@ -1181,7 +1181,7 @@ LightControllerClass light_controller = LightControllerClass(light_state);
/*********************************************************************************************\ /*********************************************************************************************\
* Change scales from 8 bits to 10 bits and vice versa * 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) { uint16_t change8to10(uint8_t v) {
return changeUIntScale(v, 0, 255, 0, 1023); return changeUIntScale(v, 0, 255, 0, 1023);
} }
@ -1866,9 +1866,9 @@ void LightAnimate(void)
// or set a maximum of PWM_MAX_SLEEP if light is on or Fade is running // or set a maximum of PWM_MAX_SLEEP if light is on or Fade is running
if (Light.power || Light.fade_running) { if (Light.power || Light.fade_running) {
if (Settings.sleep > PWM_MAX_SLEEP) { 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 { } 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 { } else {
TasmotaGlobal.sleep = Settings.sleep; TasmotaGlobal.sleep = Settings.sleep;