Skip to content

Commit

Permalink
Mitigated apply_background() slowdown
Browse files Browse the repository at this point in the history
  • Loading branch information
connornishijima committed May 10, 2024
1 parent bdafe2d commit 3da6ae2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/leds.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ CRGBF desaturate(struct CRGBF input_color, float amount) {

CRGBF hsv(float h, float s, float v) {
CRGBF return_val;
profile_function([&]() {
//profile_function([&]() {
// Normalize hue to range [0, 1]
h = fmodf(h, 1.0f);
if (h < 0.0f) h += 1.0f;
Expand All @@ -241,7 +241,7 @@ CRGBF hsv(float h, float s, float v) {
r += m; g += m; b += m;

return_val = (CRGBF){r, g, b};
}, __func__);
//}, __func__);

return return_val;
}
Expand Down Expand Up @@ -633,7 +633,7 @@ void apply_brightness() {

float get_color_range_hue(float progress){
float return_val;
profile_function([&]() {
//profile_function([&]() {
float color_range = configuration.color_range;

if(color_range == 0.0){
Expand All @@ -646,7 +646,7 @@ float get_color_range_hue(float progress){
else{
return_val = configuration.color + (color_range * progress);
}
}, __func__);
//}, __func__);

return return_val;
}
Expand Down
2 changes: 1 addition & 1 deletion src/profiler.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// UNCOMMENT THIS TO ENABLE IT
#define PROFILER_ENABLED // Slows down the system, but allows watching how much total time each function takes up
//#define PROFILER_ENABLED // Slows down the system, but allows watching how much total time each function takes up

#define PROFILER_SINGLE_SHOT \
(false) // Count only the most recent run or all runs since last print?
Expand Down

0 comments on commit 3da6ae2

Please sign in to comment.