platformio.ini 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. ; meCoffee firmware (PlatformIO, Arduino core + plain C++ logic library)
  2. ; See README.md and docs/AGENT_HANDOFF.md.
  3. [platformio]
  4. default_envs = 328p8m
  5. [common]
  6. build_flags =
  7. -DCOMPAT_V10=1
  8. -Wall
  9. -Wextra
  10. extra_scripts = pre:tools/apply_cplusplus_flags.py
  11. [env:328p8m]
  12. platform = atmelavr@5.3.0
  13. board = 328p8m
  14. framework = arduino
  15. ; The registry toolchain (x86_64 avr-gcc 7.3) does not run on Apple Silicon without
  16. ; Rosetta. tools/toolchain-native wraps the Homebrew avr-gcc 9.5 (arm64).
  17. ; On Intel/Rosetta hosts use: toolchain-atmelavr@1.70300.191015
  18. platform_packages =
  19. framework-arduino-avr@5.4.0
  20. toolchain-atmelavr@symlink://tools/toolchain-native
  21. build_flags = ${common.build_flags}
  22. extra_scripts = ${common.extra_scripts}
  23. lib_deps =
  24. meCoffee_controller_logic
  25. meCoffee_hardware_access
  26. lib_ignore = meCoffee_simulated_hardware
  27. lib_ldf_mode = chain
  28. upload_protocol = arduino
  29. upload_speed = 57600
  30. [env:uno]
  31. extends = env:328p8m
  32. board = uno
  33. board_build.f_cpu = 16000000L
  34. build_flags =
  35. ${common.build_flags}
  36. -DMECOFFEE_ARDUINO_16MHZ=1
  37. upload_speed = 115200
  38. [env:pro_mini]
  39. extends = env:uno
  40. board = pro16MHzatmega328
  41. upload_speed = 57600
  42. [env:nano]
  43. extends = env:uno
  44. board = nanoatmega328new
  45. upload_speed = 115200
  46. ; Bench-only BLE upload experiment, pinned to the verified stock Uno Optiboot 4.4.
  47. ; See docs/UNO_BLE_FLASH_TEST.md. USB installer checks the bootloader before writing.
  48. [env:uno_ble_test]
  49. extends = env:uno
  50. build_flags =
  51. ${env:uno.build_flags}
  52. -DMECOFFEE_UNO_BLE_TEST=1
  53. upload_protocol = custom
  54. upload_command = "$PYTHONEXE" "$PROJECT_DIR/tools/ble_test/upload_usb.py" --port "$UPLOAD_PORT" "$SOURCE"
  55. ; Same firmware with start-up padded to the original's start-up time (differential runs only).
  56. [env:328p8m_aligned]
  57. extends = env:328p8m
  58. build_flags =
  59. ${common.build_flags}
  60. -DMECOFFEE_CONSTRUCTION_ALIGNMENT_MICROSECONDS=5900
  61. -DMECOFFEE_SETUP_ALIGNMENT_MICROSECONDS=1100
  62. [env:float_check]
  63. extends = env:328p8m
  64. build_src_filter = -<*> +<../tools/avr_checks/float_check.cpp>
  65. [env:native]
  66. platform = native
  67. build_flags =
  68. ${common.build_flags}
  69. -DNATIVE_TEST=1
  70. extra_scripts = ${common.extra_scripts}
  71. lib_ignore = meCoffee_hardware_access
  72. lib_deps =
  73. meCoffee_controller_logic
  74. meCoffee_simulated_hardware
  75. test_framework = unity
  76. [env:native_arduino16m]
  77. extends = env:native
  78. build_flags =
  79. ${env:native.build_flags}
  80. -DMECOFFEE_ARDUINO_16MHZ=1