My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

common-cxxflags.py 1.3KB

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