code spell checking - part4 (MM specific)
This commit is contained in:
@@ -118,7 +118,7 @@ class UsermodBattery : public Usermod
|
||||
{
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
if ((batteryPin <0) || !pinManager.isPinAnalog(batteryPin)) return(-1.0f); // WLEDMM avoid reading from invalid pin
|
||||
// use calibrated millivolts analogread on esp32 (150 mV ~ 2450 mV default attentuation) and divide by 1000 to get from milivolts to volts and multiply by voltage multiplier and apply calibration value
|
||||
// use calibrated millivolts analogread on esp32 (150 mV ~ 2450 mV default attenuation) and divide by 1000 to get from milliVolts to volts and multiply by voltage multiplier and apply calibration value
|
||||
return (analogReadMilliVolts(batteryPin) / 1000.0f) * voltageMultiplier + calibration;
|
||||
#else
|
||||
// use analog read on esp8266 ( 0V ~ 1V no attenuation options) and divide by ADC precision 1023 and multiply by voltage multiplier and apply calibration value
|
||||
@@ -216,7 +216,7 @@ class UsermodBattery : public Usermod
|
||||
*/
|
||||
#ifdef USERMOD_BATTERY_USE_LIPO
|
||||
batteryLevel = mapf(voltage, minBatteryVoltage, maxBatteryVoltage, 0, 100); // basic mapping
|
||||
// LiPo batteries have a differnt dischargin curve, see
|
||||
// LiPo batteries have a different dischargin curve, see
|
||||
// https://blog.ampow.com/lipo-voltage-chart/
|
||||
if (batteryLevel < 40.0f)
|
||||
batteryLevel = mapf(batteryLevel, 0, 40, 0, 12); // last 45% -> drops very quickly
|
||||
@@ -413,7 +413,7 @@ class UsermodBattery : public Usermod
|
||||
oappend(SET_F("addInfo('Battery:indicator:threshold', 1, '%');"));
|
||||
oappend(SET_F("addInfo('Battery:indicator:duration', 1, 's');"));
|
||||
|
||||
// cannot quite get this mf to work. its exeeding some buffer limit i think
|
||||
// cannot quite get this mf to work. its exceeding some buffer limit i think
|
||||
// what i wanted is a list of all presets to select one from
|
||||
// oappend(SET_F("bd=addDropdown('Battery:low-power-indicator', 'preset');"));
|
||||
// the loop generates: oappend(SET_F("addOption(bd, 'preset name', preset id);"));
|
||||
@@ -612,7 +612,7 @@ class UsermodBattery : public Usermod
|
||||
|
||||
|
||||
/*
|
||||
* Get the capacity of all cells in parralel sumed up
|
||||
* Get the capacity of all cells in parallel summed up
|
||||
* unit: mAh
|
||||
*/
|
||||
unsigned int getTotalBatteryCapacity()
|
||||
@@ -788,7 +788,7 @@ class UsermodBattery : public Usermod
|
||||
|
||||
|
||||
/*
|
||||
* Get low-power-indicator status when the indication is done thsi returns true
|
||||
* Get low-power-indicator status when the indication is done this returns true
|
||||
*/
|
||||
bool getLowPowerIndicatorDone()
|
||||
{
|
||||
|
||||
@@ -75,7 +75,7 @@ class PWMFanUsermod : public Usermod {
|
||||
pinMode(tachoPin, INPUT);
|
||||
digitalWrite(tachoPin, HIGH);
|
||||
attachInterrupt(digitalPinToInterrupt(tachoPin), rpm_fan, FALLING);
|
||||
DEBUG_PRINTLN(F("Tacho sucessfully initialized."));
|
||||
DEBUG_PRINTLN(F("Tacho successfully initialized."));
|
||||
}
|
||||
|
||||
void deinitTacho(void) {
|
||||
@@ -118,12 +118,12 @@ class PWMFanUsermod : public Usermod {
|
||||
if (pwmChannel == 255) { //no more free LEDC channels
|
||||
deinitPWMfan(); return;
|
||||
}
|
||||
// configure LED PWM functionalitites
|
||||
// configure LED PWM functionalities
|
||||
ledcSetup(pwmChannel, 25000, 8);
|
||||
// attach the channel to the GPIO to be controlled
|
||||
ledcAttachPin(pwmPin, pwmChannel);
|
||||
#endif
|
||||
DEBUG_PRINTLN(F("Fan PWM sucessfully initialized."));
|
||||
DEBUG_PRINTLN(F("Fan PWM successfully initialized."));
|
||||
}
|
||||
|
||||
void deinitPWMfan(void) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
- #define ARDUINOJSON_DEFAULT_NESTING_LIMIT 100 //set this in ArduinoJson!!!, currently not necessary...
|
||||
- IF UPDATING THIS FILE IN THE WLED REPO, SEND A PULL REQUEST TO https://github.com/ewoudwijma/ARTI AS WELL!!!
|
||||
@later
|
||||
- Code improvememt
|
||||
- Code improvement
|
||||
- See 'for some weird reason this causes a crash on esp32'
|
||||
- check why column/lineno not correct
|
||||
- Definition improvements
|
||||
@@ -2181,7 +2181,7 @@ public:
|
||||
ERROR_ARTI("%s %s %s unknown\n", spaces+50-depth, key, variable_name);
|
||||
valueStack->push(floatNull);
|
||||
}
|
||||
} // ! founnd
|
||||
} // ! fouund
|
||||
visitedAlready = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// For testing porposes, definitions should not only run on Arduino but also on Windows etc.
|
||||
// For testing purposes, definitions should not only run on Arduino but also on Windows etc.
|
||||
// Because compiling on arduino takes seriously more time than on Windows.
|
||||
// The plugin.h files replace native arduino calls by windows simulated calls (e.g. setPixelColor will become printf)
|
||||
|
||||
@@ -185,7 +185,7 @@ float ARTI::arti_external_function(uint8_t function, float par1, float par2, flo
|
||||
|
||||
float halfLength = (circleLength-1)/2.0;
|
||||
|
||||
//calculate circle positions, round to 5 digits and then round again to cater for radians inprecision (e.g. 3.49->3.5->4)
|
||||
//calculate circle positions, round to 5 digits and then round again to cater for radians imprecision (e.g. 3.49->3.5->4)
|
||||
int x = round(round((sin(radians(par1)) * halfLength + halfLength) * 10)/10) + deltaWidth;
|
||||
int y = round(round((halfLength - cos(radians(par1)) * halfLength) * 10)/10) + deltaHeight;
|
||||
return SEGMENT.XY(x,y);
|
||||
|
||||
@@ -82,7 +82,7 @@ function populateCEEditor(name, segID)
|
||||
<button class="btn infobtn btn-xs" onclick="location.href='https://mm.kno.wled.ge/moonmodules/arti-fx'" type="button">?</button><br>
|
||||
<br><i>Compile and Run Log</i><br>
|
||||
<textarea class="ceTextarea" id="ceLogArea"></textarea><br>
|
||||
<i>Run log > 3 seconds is send to Serial Ouput.</i><br>
|
||||
<i>Run log > 3 seconds is send to Serial Output.</i><br>
|
||||
<a href="#" onclick="downloadGHFile('HBB','presets.json',true,true);return false;" title="Download HBaas Base presets">🥚</a>
|
||||
<a href="#" onclick="downloadGHFile('HBE','presets.json',true,true);return false;" title="Download HBaas Effects presets">🥚</a>
|
||||
<a href="#" onclick="downloadGHFile('LM','presets.json',true,true);return false;" title="Download Ledmap presets">🥚</a>`;
|
||||
|
||||
@@ -19,7 +19,7 @@ ARTI * arti;
|
||||
//effect function
|
||||
uint16_t mode_ARTIFX(void) {
|
||||
//tbd: move statics to SEGMENT.data
|
||||
static bool succesful;
|
||||
static bool successful;
|
||||
static bool notEnoughHeap;
|
||||
|
||||
static char previousEffect[charLength];
|
||||
@@ -46,20 +46,20 @@ uint16_t mode_ARTIFX(void) {
|
||||
// artiWrapper = reinterpret_cast<ArtiWrapper*>(SEGENV.data);
|
||||
arti = new ARTI();
|
||||
|
||||
succesful = arti->setup("/wledv033.json", currentEffect);
|
||||
successful = arti->setup("/wledv033.json", currentEffect);
|
||||
|
||||
if (!succesful)
|
||||
ERROR_ARTI("Setup not succesful\n");
|
||||
if (!successful)
|
||||
ERROR_ARTI("Setup not successful\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (succesful) // && SEGENV.call < 250 for each frame
|
||||
if (successful) // && SEGENV.call < 250 for each frame
|
||||
{
|
||||
if (FREE_SIZE <= 20000)
|
||||
{
|
||||
ERROR_ARTI("Not enough free heap (%u <= 30000)\n", FREE_SIZE);
|
||||
notEnoughHeap = true;
|
||||
succesful = false;
|
||||
successful = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -71,7 +71,7 @@ uint16_t mode_ARTIFX(void) {
|
||||
// previousCall = SEGENV.call;
|
||||
// }
|
||||
|
||||
succesful = arti->loop();
|
||||
successful = arti->loop();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -79,7 +79,7 @@ uint16_t mode_ARTIFX(void) {
|
||||
arti->closeLog();
|
||||
if (notEnoughHeap && FREE_SIZE > 20000) {
|
||||
ERROR_ARTI("Again enough free heap, restart effect (%u > 30000)\n", FREE_SIZE);
|
||||
succesful = true;
|
||||
successful = true;
|
||||
notEnoughHeap = false;
|
||||
strcpy(previousEffect, ""); // force new create
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ class mcuTemp : public Usermod
|
||||
private:
|
||||
float mcutemp = 0;
|
||||
|
||||
// any private methods should go here (non-inline methosd should be defined out of class)
|
||||
// any private methods should go here (non-inline method should be defined out of class)
|
||||
void publishMqtt(const char *state, bool retain = false); // example for publishing MQTT message
|
||||
|
||||
public:
|
||||
|
||||
@@ -185,7 +185,7 @@ class MPU6050Driver : public Usermod {
|
||||
//INTERRUPT_PIN = -1;
|
||||
//return;
|
||||
}
|
||||
if ((INTERRUPT_PIN >= 0) && (pinManager.getPinOwner(INTERRUPT_PIN) != PinOwner::UM_IMU) // only allocate pin if we don't ownn it already
|
||||
if ((INTERRUPT_PIN >= 0) && (pinManager.getPinOwner(INTERRUPT_PIN) != PinOwner::UM_IMU) // only allocate pin if we don't own it already
|
||||
&& !pinManager.allocatePin(INTERRUPT_PIN, false, PinOwner::UM_IMU))
|
||||
{
|
||||
//enabled = false;
|
||||
|
||||
@@ -671,7 +671,7 @@ void FourLineDisplayUsermod::setup() {
|
||||
}
|
||||
// start SPI now!
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
if (isHW) SPI.begin(spi_sclk, spi_miso, spi_mosi); // ESP32 - will silently fail if SPI alread active.
|
||||
if (isHW) SPI.begin(spi_sclk, spi_miso, spi_mosi); // ESP32 - will silently fail if SPI already active.
|
||||
#else
|
||||
if (isHW) SPI.begin(); // ESP8266 - SPI pins are fixed
|
||||
#endif
|
||||
|
||||
@@ -59,7 +59,7 @@ int re_qstringCmp(const void *ap, const void *bp) {
|
||||
// Lowercase
|
||||
bVal -= 32;
|
||||
}
|
||||
// Relly we shouldn't ever get to '\0'
|
||||
// Really we shouldn't ever get to '\0'
|
||||
if (aVal == '"' || bVal == '"' || aVal == '\0' || bVal == '\0') {
|
||||
// We're done. one is a substring of the other
|
||||
// or something happenend and the quote didn't stop us.
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
// tracking the owner tags....
|
||||
pinA = pinB = pinC = -1;
|
||||
enabled = false;
|
||||
DEBUG_PRINTLN(F("Failed to alocate GPIO pins for Usermod Rotary Encoder.")); //WLEDMM add debug info
|
||||
DEBUG_PRINTLN(F("Failed to allocate GPIO pins for Usermod Rotary Encoder.")); //WLEDMM add debug info
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -436,7 +436,7 @@ void RotaryEncoderUIUsermod::setup()
|
||||
// tracking the owner tags....
|
||||
pinA = pinB = pinC = -1;
|
||||
enabled = false;
|
||||
DEBUG_PRINTLN(F("Failed to alocate GPIO pins for Usermod Rotary Encoder (ALT).")); //WLEDMM add debug info
|
||||
DEBUG_PRINTLN(F("Failed to allocate GPIO pins for Usermod Rotary Encoder (ALT).")); //WLEDMM add debug info
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
// #define WEATHER_DEBUG
|
||||
|
||||
//declare weathermod global variables (always precede with weather_ (psuedo class static variables)
|
||||
//declare weathermod global variables (always precede with weather_ (pseudo class static variables)
|
||||
static uint32_t usermods_pushLoop = 0; //effect pushes loop to execute. might be interesting for audioreactive too
|
||||
static uint8_t weather_units = 1; //config var metric (celsius) is default. (Standard=Kelvin, Imperial is Fahrenheit)
|
||||
static float weather_minTemp = 0; //config var
|
||||
@@ -159,7 +159,7 @@ class WeatherUsermod : public Usermod {
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// return if no location or no api key (reset lastTume to force loop)
|
||||
// return if no location or no api key (reset lastTime to force loop)
|
||||
if (fabs(latitude) < 0.00001 && fabs(latitude) < 0.00001) {strcpy(errorMessage, PSTR("No location")); lastTime = 0; return;}
|
||||
if (strcmp(apiKey.c_str(), "") == 0) {strcpy(errorMessage, PSTR("No api key")); lastTime = 0; return;}
|
||||
|
||||
@@ -181,12 +181,12 @@ class WeatherUsermod : public Usermod {
|
||||
if (strcmp(errorMessage, "") == 0) {
|
||||
|
||||
// https://arduinojson.org/v6/how-to/deserialize-a-very-large-document/
|
||||
StaticJsonDocument<256> filter; //in practive about 128
|
||||
StaticJsonDocument<256> filter; //in practice about 128
|
||||
filter["list"][0]["dt"] = true;
|
||||
filter["list"][0]["main"]["temp"] = true;
|
||||
filter["city"]["name"] = true;
|
||||
filter["city"]["country"] = true;
|
||||
PSRAMDynamicJsonDocument weatherDoc(4096); //in practive about 2673
|
||||
PSRAMDynamicJsonDocument weatherDoc(4096); //in practice about 2673
|
||||
|
||||
// Parse JSON object
|
||||
DeserializationError error = deserializeJson(weatherDoc, client, DeserializationOption::Filter(filter));
|
||||
@@ -206,7 +206,7 @@ class WeatherUsermod : public Usermod {
|
||||
JsonObject weatherDocObject = weatherDoc.as<JsonObject>();
|
||||
JsonArray list = weatherDocObject[F("list")];
|
||||
JsonObject city = weatherDocObject["city"];
|
||||
strcat(errorMessage, city["name"]); //api succesfull
|
||||
strcat(errorMessage, city["name"]); //api successful
|
||||
strcat(errorMessage, city["country"]);
|
||||
|
||||
uint8_t i = 0;
|
||||
@@ -319,10 +319,10 @@ class WeatherUsermod : public Usermod {
|
||||
|
||||
oappend(SET_F("dd=addDropdown('Weather','units');"));
|
||||
oappend(SET_F("addOption(dd,'Kelvin',0);"));
|
||||
oappend(SET_F("addOption(dd,'Celcius',1);"));
|
||||
oappend(SET_F("addOption(dd,'Celsius',1);"));
|
||||
oappend(SET_F("addOption(dd,'Fahrenheit',2);"));
|
||||
oappend(SET_F("addInfo('Weather:units',1,'<i>Set time and location in time settings</i>');"));
|
||||
oappend(SET_F("addInfo('Weather:apiKey',1,'<i>Create acount on openweathermap.org and copy the key</i>');"));
|
||||
oappend(SET_F("addInfo('Weather:apiKey',1,'<i>Create account on openweathermap.org and copy the key</i>');"));
|
||||
oappend(SET_F("addInfo('Weather:minTemp',1,'<i>Changing values: Reboot to (re)load forecast</i>');"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user