Skip to content

Commit

Permalink
[Telink] Fix compilation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
andriy-bilynskyy committed Dec 18, 2024
1 parent 08803bb commit 68e2183
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/platform/telink/util/src/ColorFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ RgbColor_t XYToRgb(uint8_t Level, uint16_t currentX, uint16_t currentY)
b = (X * 0.0557f) - (Y * 0.2040f) + (Z * 1.0570f);

// apply gamma 2.2 correction
r = (r <= 0.0031308f ? 12.92f * r : (1.055f) * pow(r, (1.0f / 2.4f)) - 0.055f);
g = (g <= 0.0031308f ? 12.92f * g : (1.055f) * pow(g, (1.0f / 2.4f)) - 0.055f);
b = (b <= 0.0031308f ? 12.92f * b : (1.055f) * pow(b, (1.0f / 2.4f)) - 0.055f);
r = (r <= 0.0031308f ? 12.92f * r : (1.055f) * powf(r, (1.0f / 2.4f)) - 0.055f);
g = (g <= 0.0031308f ? 12.92f * g : (1.055f) * powf(g, (1.0f / 2.4f)) - 0.055f);
b = (b <= 0.0031308f ? 12.92f * b : (1.055f) * powf(b, (1.0f / 2.4f)) - 0.055f);

// Round off
r = clamp(r, 0, 1);
Expand Down Expand Up @@ -150,17 +150,17 @@ RgbColor_t CTToRgb(CtColor_t ct)
}
else
{
r = 329.698727446f * pow(ctCentiKelvin - 60, -0.1332047592f);
r = 329.698727446f * powf(ctCentiKelvin - 60, -0.1332047592f);
}

// Green
if (ctCentiKelvin <= 66)
{
g = 99.4708025861f * log(ctCentiKelvin) - 161.1195681661f;
g = 99.4708025861f * logf(ctCentiKelvin) - 161.1195681661f;
}
else
{
g = 288.1221695283f * pow(ctCentiKelvin - 60, -0.0755148492f);
g = 288.1221695283f * powf(ctCentiKelvin - 60, -0.0755148492f);
}

// Blue
Expand Down

0 comments on commit 68e2183

Please sign in to comment.