Skip to content

Commit

Permalink
Tidy up custom debug flags declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
valeros committed Mar 22, 2021
1 parent 75c95f0 commit e16be52
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,11 @@
if env.get("PROGNAME", "program") == "program":
env.Replace(PROGNAME="firmware")

#
# Automatically remove flags which are incompatible with SDCC
# in debug mode
# Automatically remove flags which are incompatible with SDCC in debug mode
# Can be replaced by `PIODEBUGFLAGS` once PIO Core 5.2 is released
if env.GetBuildType() == "debug":
# inject build unflags and unflags that will be
# processed later.
env.Append(BUILD_UNFLAGS=["-Og","-g2", "-ggdb2"])
env.Append(BUILD_FLAGS=["--debug", "--out-fmt-elf"])
env.Append(BUILD_UNFLAGS=["-Og", "-g2", "-ggdb2"])
env.Append(CFLAGS=["--debug"])

#
# Target: Build executable and linkable firmware
Expand Down Expand Up @@ -161,7 +158,7 @@

elif "stlink" in upload_protocol:
mcu = board_config.get("build.mcu")
# either derive value for the "part" switch from MCU name, or use the value
# either derive value for the "part" switch from MCU name, or use the value
# in the board manifest, in cases in which the derivation would be wrong.
flash_target = board_config.get("upload.stm8flash_target", mcu[:8] + "?" + mcu[9])
env.Replace(
Expand Down

0 comments on commit e16be52

Please sign in to comment.