[Build] Reduce ESP8266 and ESP32-C6 DisplayB build size

This commit is contained in:
TD-er committed 2026-09-11 18:14:19 +02:00
1 parent f6bd2ea643
commit 6dfd71a4a0
25 files changed
+352 -126

No files matched your search

+1 -1
View File
@@ -278,7 +278,7 @@ float Adafruit_BME680::readAltitude(float seaLevel) {
// http://forums.adafruit.com/viewtopic.php?f=22&t=58064
float atmospheric = readPressure() / 100.0F;
return 44330.0 * (1.0 - pow(atmospheric / seaLevel, 0.1903));
return 44330.0f * (1.0f - powf(atmospheric / seaLevel, 0.1903f));
}
/*!
+1 -1
View File
@@ -291,7 +291,7 @@ float Adafruit_BMP3XX::readAltitude(float seaLevel) {
// http://forums.adafruit.com/viewtopic.php?f=22&t=58064
float atmospheric = readPressure() / 100.0F;
return 44330.0 * (1.0 - pow(atmospheric / seaLevel, 0.1903));
return 44330.0f * (1.0f - powf(atmospheric / seaLevel, 0.1903f));
}
/**************************************************************************/
@@ -39,7 +39,7 @@ void setup() {
for (int i=0; i<256; i++) {
float x = i;
x /= 255;
x = pow(x, 2.5);
x = powf(x, 2.5f);
x *= 255;
if (commonAnode) {
+7 -7
View File
@@ -218,12 +218,12 @@ public:
static float ExponentialIn(float unitValue)
{
return (pow(2, 10.0f * (unitValue - 1.0f)));
return (powf(2, 10.0f * (unitValue - 1.0f)));
}
static float ExponentialOut(float unitValue)
{
return (-pow(2, -10.0f * unitValue) + 1.0f);
return (-powf(2, -10.0f * unitValue) + 1.0f);
}
static float ExponentialInOut(float unitValue)
@@ -231,12 +231,12 @@ public:
unitValue *= 2.0f;
if (unitValue < 1.0f)
{
return (0.5f * pow(2, 10.0f * (unitValue - 1.0f)));
return (0.5f * powf(2, 10.0f * (unitValue - 1.0f)));
}
else
{
unitValue -= 1.0f;
return (0.5f * (-pow(2, -10.0f * unitValue) + 2.0f));
return (0.5f * (-powf(2, -10.0f * unitValue) + 2.0f));
}
}
@@ -245,12 +245,12 @@ public:
unitValue *= 2.0f;
if (unitValue < 1.0f)
{
return (0.5f * (-pow(2, -10.0f * unitValue) + 1.0f));
return (0.5f * (-powf(2, -10.0f * unitValue) + 1.0f));
}
else
{
unitValue -= 2.0f;
return (0.5f * (pow(2, 10.0f * unitValue) + 1.0f));
return (0.5f * (powf(2, 10.0f * unitValue) + 1.0f));
}
}
@@ -308,6 +308,6 @@ public:
static float Gamma(float unitValue)
{
return pow(unitValue, 1.0f / 0.45f);
return powf(unitValue, 1.0f / 0.45f);
}
};
@@ -703,7 +703,8 @@ double ADXL345::getRate() {
readFrom(ADXL345_BW_RATE, 1, &_b);
_b &= 0b00001111;
return (pow(2, ((int)_b) - 6)) * 6.25;
return (2 << (int)_b) * 0.09765625;
// return (pow(2, ((int)_b) - 6)) * 6.25;
}
void ADXL345::setRate(double rate) {