My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

common-cxxflags.py 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #
  2. # common-cxxflags.py
  3. # Convenience script to apply customizations to CPP flags
  4. #
  5. import pioutil
  6. if pioutil.is_pio_build():
  7. Import("env")
  8. cxxflags = [
  9. #"-Wno-incompatible-pointer-types",
  10. #"-Wno-unused-const-variable",
  11. #"-Wno-maybe-uninitialized",
  12. #"-Wno-sign-compare"
  13. ]
  14. if "teensy" not in env['PIOENV']:
  15. cxxflags += ["-Wno-register"]
  16. env.Append(CXXFLAGS=cxxflags)
  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', 'custom']:
  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()