My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

common-cxxflags.py 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #
  2. # common-cxxflags.py
  3. # Convenience script to apply customizations to CPP flags
  4. #
  5. Import("env")
  6. # Detect that 'vscode init' is running
  7. from SCons.Script import COMMAND_LINE_TARGETS
  8. if "idedata" in COMMAND_LINE_TARGETS:
  9. env.Exit(0)
  10. env.Append(CXXFLAGS=[
  11. "-Wno-register"
  12. #"-Wno-incompatible-pointer-types",
  13. #"-Wno-unused-const-variable",
  14. #"-Wno-maybe-uninitialized",
  15. #"-Wno-sign-compare"
  16. ])
  17. #
  18. # Add CPU frequency as a compile time constant instead of a runtime variable
  19. #
  20. def add_cpu_freq():
  21. if 'BOARD_F_CPU' in env:
  22. env['BUILD_FLAGS'].append('-DBOARD_F_CPU=' + env['BOARD_F_CPU'])
  23. # Useful for JTAG debugging
  24. #
  25. # It will separate release and debug build folders.
  26. # It useful to keep two live versions: a debug version for debugging and another for
  27. # release, for flashing when upload is not done automatically by jlink/stlink.
  28. # Without this, PIO needs to recompile everything twice for any small change.
  29. if env.GetBuildType() == "debug" and env.get('UPLOAD_PROTOCOL') not in ['jlink', 'stlink']:
  30. env['BUILD_DIR'] = '$PROJECT_BUILD_DIR/$PIOENV/debug'
  31. # On some platform, F_CPU is a runtime variable. Since it's used to convert from ns
  32. # to CPU cycles, this adds overhead preventing small delay (in the order of less than
  33. # 30 cycles) to be generated correctly. By using a compile time constant instead
  34. # the compiler will perform the computation and this overhead will be avoided
  35. add_cpu_freq()