Skip to content

Commit

Permalink
Merge pull request #3185 from TD-er/bugfix/build_gcc10.1
Browse files Browse the repository at this point in the history
[Build] Fix using GCC 10.1 toolchain
  • Loading branch information
TD-er authored Jul 31, 2020
2 parents d7a1e31 + 874cddf commit c40410f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ env:
- ENV=test_ESP32_lolin-d32-pro
- ENV=test_ESP8266_4M1M_VCC
#- ENV=test_ESP8266_4M1M_VCC_MDNS_SD
#- ENV=test_alt_wifi_ESP8266_4M1M_VCC
#- ENV=test_beta_ESP8266_16M_LittleFS
#- ENV=test_beta_ESP8266_4M1M
- ENV=test_alt_wifi_ESP8266_4M1M_VCC
- ENV=test_beta_ESP8266_16M_LittleFS
- ENV=test_beta_ESP8266_4M1M

script:
- PLATFORMIO_BUILD_FLAGS="-D CONTINUOUS_INTEGRATION" platformio run -e $ENV
Expand Down
3 changes: 1 addition & 2 deletions platformio_core_defs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ build_flags = ${esp82xx_2_6_x.build_flags}
-Wno-deprecated-declarations
platform_packages =
framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git
toolchain-xtensa @ https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/x86_64-w64-mingw32.xtensa-lx106-elf-0474ae9.200706.zip
; toolchain-xtensa @ https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu12/x86_64-linux-gnu.xtensa-lx106-elf-0474ae9.200706.tar.gz
toolchain-xtensa @ ~2.100100.0



Expand Down
6 changes: 6 additions & 0 deletions src/ESPEasy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ void setup()
lastADCvalue = analogRead(A0);
#endif

#ifdef ESP8266
// See https://github.com/esp8266/Arduino/commit/a67986915512c5304bd7c161cf0d9c65f66e0892
analogWriteRange(1023);
#endif


resetPluginTaskData();

checkRAM(F("setup"));
Expand Down
18 changes: 8 additions & 10 deletions src/Misc.ino
Original file line number Diff line number Diff line change
Expand Up @@ -645,12 +645,10 @@ void analogWriteESP32(int pin, int value)
/********************************************************************************************\
Status LED
\*********************************************************************************************/
#if defined(ESP32)
#define PWMRANGE 1024
#endif
#define STATUS_PWM_NORMALVALUE (PWMRANGE>>2)
#define STATUS_PWM_NORMALFADE (PWMRANGE>>8)
#define STATUS_PWM_TRAFFICRISE (PWMRANGE>>1)
#define PWMRANGE_FULL 1023
#define STATUS_PWM_NORMALVALUE (PWMRANGE_FULL>>2)
#define STATUS_PWM_NORMALFADE (PWMRANGE_FULL>>8)
#define STATUS_PWM_TRAFFICRISE (PWMRANGE_FULL>>1)

void statusLED(bool traffic)
{
Expand Down Expand Up @@ -685,16 +683,16 @@ void statusLED(bool traffic)
//AP mode is active
else if (WifiIsAP(WiFi.getMode()))
{
nStatusValue = ((millis()>>1) & PWMRANGE) - (PWMRANGE>>2); //ramp up for 2 sec, 3/4 luminosity
nStatusValue = ((millis()>>1) & PWMRANGE_FULL) - (PWMRANGE_FULL>>2); //ramp up for 2 sec, 3/4 luminosity
}
//Disconnected
else
{
nStatusValue = (millis()>>1) & (PWMRANGE>>2); //ramp up for 1/2 sec, 1/4 luminosity
nStatusValue = (millis()>>1) & (PWMRANGE_FULL>>2); //ramp up for 1/2 sec, 1/4 luminosity
}
}

nStatusValue = constrain(nStatusValue, 0, PWMRANGE);
nStatusValue = constrain(nStatusValue, 0, PWMRANGE_FULL);

if (gnStatusValueCurrent != nStatusValue)
{
Expand All @@ -703,7 +701,7 @@ void statusLED(bool traffic)
long pwm = nStatusValue * nStatusValue; //simple gamma correction
pwm >>= 10;
if (Settings.Pin_status_led_Inversed)
pwm = PWMRANGE-pwm;
pwm = PWMRANGE_FULL-pwm;

#if defined(ESP8266)
analogWrite(Settings.Pin_status_led, pwm);
Expand Down
18 changes: 15 additions & 3 deletions src/src/Helpers/CompiletimeDefines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
#endif // ifndef SET_BUILD_GIT_HEAD

String get_binary_filename() {
return F(SET_BUILD_BINARY_FILENAME);
#ifndef CORE_POST_2_5_0
return F("firmware.bin");
#else
return F(SET_BUILD_BINARY_FILENAME);
#endif
}

String get_build_time() {
Expand All @@ -35,9 +39,17 @@ String get_build_origin() {
}

String get_build_platform() {
return F(SET_BUILD_PLATFORM);
#ifndef CORE_POST_2_5_0
return "";
#else
return F(SET_BUILD_PLATFORM);
#endif
}

String get_git_head() {
return F(SET_BUILD_GIT_HEAD);
#ifndef CORE_POST_2_5_0
return "";
#else
return F(SET_BUILD_GIT_HEAD);
#endif
}

0 comments on commit c40410f

Please sign in to comment.