mirror of
https://github.com/wled/WLED.git
synced 2025-07-10 04:16:36 +00:00
align some function declariations with their implementation
This is purely a "clean code" thing, no impact on function - it helps to avoid confusion when reading the code. C++ allows declaration and implementation to use different variable names.
This commit is contained in:
parent
ed3ec66d33
commit
cd52d7bcf6
@ -598,7 +598,7 @@ typedef struct Segment {
|
|||||||
|
|
||||||
// 1D strip
|
// 1D strip
|
||||||
[[gnu::hot]] uint16_t virtualLength() const;
|
[[gnu::hot]] uint16_t virtualLength() const;
|
||||||
[[gnu::hot]] void setPixelColor(int n, uint32_t c) const; // set relative pixel within segment with color
|
[[gnu::hot]] void setPixelColor(int i, uint32_t c) const; // set relative pixel within segment with color
|
||||||
inline void setPixelColor(unsigned n, uint32_t c) const { setPixelColor(int(n), c); }
|
inline void setPixelColor(unsigned n, uint32_t c) const { setPixelColor(int(n), c); }
|
||||||
inline void setPixelColor(int n, byte r, byte g, byte b, byte w = 0) const { setPixelColor(n, RGBW32(r,g,b,w)); }
|
inline void setPixelColor(int n, byte r, byte g, byte b, byte w = 0) const { setPixelColor(n, RGBW32(r,g,b,w)); }
|
||||||
inline void setPixelColor(int n, CRGB c) const { setPixelColor(n, RGBW32(c.r,c.g,c.b,0)); }
|
inline void setPixelColor(int n, CRGB c) const { setPixelColor(n, RGBW32(c.r,c.g,c.b,0)); }
|
||||||
@ -805,7 +805,7 @@ class WS2812FX { // 96 bytes
|
|||||||
resetSegments(), // marks all segments for reset
|
resetSegments(), // marks all segments for reset
|
||||||
makeAutoSegments(bool forceReset = false), // will create segments based on configured outputs
|
makeAutoSegments(bool forceReset = false), // will create segments based on configured outputs
|
||||||
fixInvalidSegments(), // fixes incorrect segment configuration
|
fixInvalidSegments(), // fixes incorrect segment configuration
|
||||||
setPixelColor(unsigned n, uint32_t c) const, // paints absolute strip pixel with index n and color c
|
setPixelColor(unsigned i, uint32_t c) const, // paints absolute strip pixel with index n and color c
|
||||||
show(), // initiates LED output
|
show(), // initiates LED output
|
||||||
setTargetFps(unsigned fps),
|
setTargetFps(unsigned fps),
|
||||||
setupEffectData(); // add default effects to the list; defined in FX.cpp
|
setupEffectData(); // add default effects to the list; defined in FX.cpp
|
||||||
@ -870,7 +870,7 @@ class WS2812FX { // 96 bytes
|
|||||||
};
|
};
|
||||||
|
|
||||||
unsigned long now, timebase;
|
unsigned long now, timebase;
|
||||||
uint32_t getPixelColor(unsigned) const;
|
uint32_t getPixelColor(unsigned i) const;
|
||||||
|
|
||||||
inline uint32_t getLastShow() const { return _lastShow; } // returns millis() timestamp of last strip.show() call
|
inline uint32_t getLastShow() const { return _lastShow; } // returns millis() timestamp of last strip.show() call
|
||||||
|
|
||||||
|
@ -90,12 +90,12 @@ void doublePressAction(uint8_t b)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isButtonPressed(uint8_t i)
|
bool isButtonPressed(uint8_t b)
|
||||||
{
|
{
|
||||||
if (btnPin[i]<0) return false;
|
if (btnPin[b]<0) return false;
|
||||||
unsigned pin = btnPin[i];
|
unsigned pin = btnPin[b];
|
||||||
|
|
||||||
switch (buttonType[i]) {
|
switch (buttonType[b]) {
|
||||||
case BTN_TYPE_NONE:
|
case BTN_TYPE_NONE:
|
||||||
case BTN_TYPE_RESERVED:
|
case BTN_TYPE_RESERVED:
|
||||||
break;
|
break;
|
||||||
@ -113,7 +113,7 @@ bool isButtonPressed(uint8_t i)
|
|||||||
#ifdef SOC_TOUCH_VERSION_2 //ESP32 S2 and S3 provide a function to check touch state (state is updated in interrupt)
|
#ifdef SOC_TOUCH_VERSION_2 //ESP32 S2 and S3 provide a function to check touch state (state is updated in interrupt)
|
||||||
if (touchInterruptGetLastStatus(pin)) return true;
|
if (touchInterruptGetLastStatus(pin)) return true;
|
||||||
#else
|
#else
|
||||||
if (digitalPinToTouchChannel(btnPin[i]) >= 0 && touchRead(pin) <= touchThreshold) return true;
|
if (digitalPinToTouchChannel(btnPin[b]) >= 0 && touchRead(pin) <= touchThreshold) return true;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -251,8 +251,8 @@ bool deserializeState(JsonObject root, byte callMode = CALL_MODE_DIRECT_CHANGE,
|
|||||||
void serializeSegment(const JsonObject& root, const Segment& seg, byte id, bool forPreset = false, bool segmentBounds = true);
|
void serializeSegment(const JsonObject& root, const Segment& seg, byte id, bool forPreset = false, bool segmentBounds = true);
|
||||||
void serializeState(JsonObject root, bool forPreset = false, bool includeBri = true, bool segmentBounds = true, bool selectedSegmentsOnly = false);
|
void serializeState(JsonObject root, bool forPreset = false, bool includeBri = true, bool segmentBounds = true, bool selectedSegmentsOnly = false);
|
||||||
void serializeInfo(JsonObject root);
|
void serializeInfo(JsonObject root);
|
||||||
void serializeModeNames(JsonArray root);
|
void serializeModeNames(JsonArray arr);
|
||||||
void serializeModeData(JsonArray root);
|
void serializeModeData(JsonArray fxdata);
|
||||||
void serveJson(AsyncWebServerRequest* request);
|
void serveJson(AsyncWebServerRequest* request);
|
||||||
#ifdef WLED_ENABLE_JSONLIVE
|
#ifdef WLED_ENABLE_JSONLIVE
|
||||||
bool serveLiveLeds(AsyncWebServerRequest* request, uint32_t wsClient = 0);
|
bool serveLiveLeds(AsyncWebServerRequest* request, uint32_t wsClient = 0);
|
||||||
@ -469,7 +469,7 @@ void userLoop();
|
|||||||
#endif
|
#endif
|
||||||
[[gnu::pure]] int getNumVal(const String* req, uint16_t pos);
|
[[gnu::pure]] int getNumVal(const String* req, uint16_t pos);
|
||||||
void parseNumber(const char* str, byte* val, byte minv=0, byte maxv=255);
|
void parseNumber(const char* str, byte* val, byte minv=0, byte maxv=255);
|
||||||
bool getVal(JsonVariant elem, byte* val, byte minv=0, byte maxv=255); // getVal supports inc/decrementing and random ("X~Y(r|[w]~[-][Z])" form)
|
bool getVal(JsonVariant elem, byte* val, byte vmin=0, byte vmax=255); // getVal supports inc/decrementing and random ("X~Y(r|[w]~[-][Z])" form)
|
||||||
[[gnu::pure]] bool getBoolVal(const JsonVariant &elem, bool dflt);
|
[[gnu::pure]] bool getBoolVal(const JsonVariant &elem, bool dflt);
|
||||||
bool updateVal(const char* req, const char* key, byte* val, byte minv=0, byte maxv=255);
|
bool updateVal(const char* req, const char* key, byte* val, byte minv=0, byte maxv=255);
|
||||||
size_t printSetFormCheckbox(Print& settingsScript, const char* key, int val);
|
size_t printSetFormCheckbox(Print& settingsScript, const char* key, int val);
|
||||||
|
@ -22,7 +22,7 @@ bool parseLx(int lxValue, byte* rgbw)
|
|||||||
} else if ((lxValue >= 200000000) && (lxValue <= 201006500)) {
|
} else if ((lxValue >= 200000000) && (lxValue <= 201006500)) {
|
||||||
// Loxone Lumitech
|
// Loxone Lumitech
|
||||||
ok = true;
|
ok = true;
|
||||||
float tmpBri = floor((lxValue - 200000000) / 10000); ;
|
float tmpBri = floor((lxValue - 200000000) / 10000);
|
||||||
uint16_t ct = (lxValue - 200000000) - (((uint8_t)tmpBri) * 10000);
|
uint16_t ct = (lxValue - 200000000) - (((uint8_t)tmpBri) * 10000);
|
||||||
|
|
||||||
tmpBri *= 2.55f;
|
tmpBri *= 2.55f;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user