Browse Source

pio: major version option renames

pull/2516/head
Maxim Prokhorov 2 years ago
parent
commit
57f04023d4
8 changed files with 215 additions and 215 deletions
  1. +2
    -2
      code/espurna/config/custom.h.example
  2. +1
    -1
      code/espurna/sensor.cpp
  3. +197
    -197
      code/platformio.ini
  4. +3
    -3
      code/platformio_override.ini.example
  5. +9
    -9
      code/scripts/generate_release_sh.py
  6. +1
    -1
      code/scripts/memanalyzer.py
  7. +1
    -1
      code/scripts/pio_main.py
  8. +1
    -1
      code/scripts/test_build.py

+ 2
- 2
code/espurna/config/custom.h.example View File

@ -12,7 +12,7 @@
// Example of a Sonoff Basic board with some options disabled to reduce firmware size.
#if defined(MY_SONOFF_BUILD01) // This section will be used when src_build_flags contains
#if defined(MY_SONOFF_BUILD01) // This section will be used when build_src_flags contains
// -DMY_SONOFF_BUILD01 in 'platformio_override.ini'
#define MANUFACTURER "ITEAD"
@ -45,7 +45,7 @@
// the 'DOUBLE CLICK, LONG CLICK OR LONG-LONG CLICK' trigger. A BMX280 environment
// sensor is also connected using I2C on GPIO 1 and 3.
#elif defined(MY_SONOFF_BUILD02) // This section will be used when src_build_flags contains
#elif defined(MY_SONOFF_BUILD02) // This section will be used when build_src_flags contains
// -DMY_SONOFF_BUILD02 in 'platformio_override.ini
// Info - Custom Basic with BMX280 I2C on GPIO 1 and 3


+ 1
- 1
code/espurna/sensor.cpp View File

@ -2518,7 +2518,7 @@ void _sensorLoad() {
#endif
DHT2_PIN and DHT2_TYPE should be globally accessible:
- as `src_build_flags = -DDHT2_PIN=... -DDHT2_TYPE=...`
- as `build_src_flags = -DDHT2_PIN=... -DDHT2_TYPE=...`
- in custom.h, as `#define ...`
*/


+ 197
- 197
code/platformio.ini
File diff suppressed because it is too large
View File


+ 3
- 3
code/platformio_override.ini.example View File

@ -15,7 +15,7 @@
[env:my-sonoff-build-dht]
extends = env:esp8266-1m-base
src_build_flags = -DITEAD_SONOFF_BASIC -DDHT_SUPPORT=1 -DDHT_PIN=2
build_src_flags = -DITEAD_SONOFF_BASIC -DDHT_SUPPORT=1 -DDHT_PIN=2
# Example for an environment based on a 1M byte esp8266 board. E.G. Sonoff Basic R2 or R3.
@ -27,11 +27,11 @@ src_build_flags = -DITEAD_SONOFF_BASIC -DDHT_SUPPORT=1 -DDHT_PIN=2
[env:my-sonoff-build01]
extends = env:esp8266-1m-latest-base
src_build_flags = -DMY_SONOFF_BUILD01 -DUSE_CUSTOM_H
build_src_flags = -DMY_SONOFF_BUILD01 -DUSE_CUSTOM_H
# Example for an environment the same as 'my-sonoff-build01' but with a different 'custom.h' configuration.
[env:my-sonoff-build02]
extends = env:esp8266-1m-latest-base
src_build_flags = -DMY_SONOFF_BUILD02 -DUSE_CUSTOM_H
build_src_flags = -DMY_SONOFF_BUILD02 -DUSE_CUSTOM_H

+ 9
- 9
code/scripts/generate_release_sh.py View File

@ -21,7 +21,7 @@ import shlex
import configparser
import collections
Build = collections.namedtuple("Build", "env extends build_flags src_build_flags")
Build = collections.namedtuple("Build", "env extends build_flags build_src_flags")
def expand_variables(cfg, value):
@ -47,7 +47,7 @@ def get_builds(cfg):
continue
build_flags = None
src_build_flags = None
build_src_flags = None
try:
build_flags = cfg.get(section, "build_flags")
@ -59,9 +59,9 @@ def get_builds(cfg):
pass
try:
src_build_flags = cfg.get(section, "src_build_flags")
src_build_flags = RE_NEWLINE.sub(" ", src_build_flags).strip()
src_build_flags = expand_variables(cfg, src_build_flags)
build_src_flags = cfg.get(section, "build_src_flags")
build_src_flags = RE_NEWLINE.sub(" ", build_src_flags).strip()
build_src_flags = expand_variables(cfg, build_src_flags)
except configparser.NoOptionError:
pass
@ -69,7 +69,7 @@ def get_builds(cfg):
section.replace("env:", ""),
cfg.get(section, "extends").replace("env:", ""),
build_flags,
src_build_flags,
build_src_flags,
)
@ -92,8 +92,8 @@ def generate_lines(builds, ignore):
flags = []
if build.build_flags:
flags.append('PLATFORMIO_BUILD_FLAGS="{}"'.format(build.build_flags))
if build.src_build_flags:
flags.append('ESPURNA_FLAGS="{}"'.format(build.src_build_flags))
if build.build_src_flags:
flags.append('ESPURNA_FLAGS="{}"'.format(build.build_src_flags))
flags.append('ESPURNA_BUILD_NAME="{env}"'.format(env=build.env))
cmd = ["env"]
@ -104,7 +104,7 @@ def generate_lines(builds, ignore):
# push core variants to the front as they definetly include global build_flags
output = generic
if "ESPURNA_CORE" in build.src_build_flags:
if "ESPURNA_CORE" in build.build_src_flags:
output = cores
output.append(line)


+ 1
- 1
code/scripts/memanalyzer.py View File

@ -99,7 +99,7 @@ def run(prefix, env, modules, debug):
flags = " ".join("-D{}_SUPPORT={:d}".format(k, v) for k, v in modules.items())
os_env = os.environ.copy()
os_env["PLATFORMIO_SRC_BUILD_FLAGS"] = flags
os_env["PLATFORMIO_BUILD_SRC_FLAGS"] = flags
os_env["PLATFORMIO_BUILD_CACHE_DIR"] = "test/pio_cache"
command = [os.path.join(prefix, "platformio"), "run"]


+ 1
- 1
code/scripts/pio_main.py View File

@ -54,7 +54,7 @@ if "DISABLE_POSTMORTEM_STACKDUMP" in env["CPPFLAGS"]:
app_inject_version(projenv)
# handle ESPURNA_BOARD and ESPURNA_FLAGS here, since projenv is not available in pre-scripts
# TODO: prefer PLATFORMIO_SRC_BUILD_FLAGS instead? both of these only allow -D...
# TODO: prefer PLATFORMIO_BUILD_SRC_FLAGS instead? both of these only allow -D...
app_inject_flags(projenv)
# handle when CI does a tagged build or user explicitly asked to store the firmware.bin


+ 1
- 1
code/scripts/test_build.py View File

@ -55,7 +55,7 @@ def build_configurations(args, configurations):
if not args.no_single_source:
os_env["ESPURNA_BUILD_SINGLE_SOURCE"] = "1"
os_env["PLATFORMIO_SRC_BUILD_FLAGS"] = " ".join(
os_env["PLATFORMIO_BUILD_SRC_FLAGS"] = " ".join(
[
'-DMANUFACTURER=\\"TEST_BUILD\\"',
'-DDEVICE=\\"{}\\"'.format(cfg.stem.replace(" ", "_").upper()),


Loading…
Cancel
Save