PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

3 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. # `framework-arduinoteensy-cxx20`
  2. A fork of the PlatformIO ArduinoTeensy framework compatible with GCC 10 & C++20.
  3. # Usage
  4. ## Prerequisites
  5. In order to build with this framework, you'll need to clone a few repos.
  6. ### Clone framework and dependencies
  7. First, clone this repository:
  8. ```sh
  9. git clone https://github.com/thevisus/framework-arduinoteensy-cxx20.git
  10. ```
  11. This framework is compatible with the GNU ARM Embedded Toolchain v10.2.1. A
  12. corresponding [PlatformIO
  13. toolchain](https://github.com/thevisus/toolchain-gcc-arm-embedded) is therefore
  14. necessary:
  15. ```sh
  16. git clone https://github.com/thevisus/toolchain-gcc-arm-embedded.git
  17. ```
  18. Finally, a PlatformIO "platform" is needed to drive the build:
  19. ```sh
  20. git clone https://github.com/thevisus/teensy-gcc10.git
  21. ```
  22. Each of these needs to be installed locally via PlatformIO. The `pio` command or
  23. similar management software should be able to do this. The simplest method, on
  24. Linux/macOS is to symlink the projects into the PlatformIO user directory:
  25. ```sh
  26. ln -s /path/to/framework-arduinoteensy-cxx20 $HOME/.platformio/packages
  27. ln -s /path/to/toolchain-gcc-arm-embedded $HOME/.platformio/packages
  28. ln -s /path/to/teensy-gcc10 $HOME/.platformio/platforms
  29. ```
  30. You may check the full platform's availability using `pio`:
  31. ```sh
  32. pio platform show teensy-gcc10
  33. ```
  34. ## Configuring a project
  35. In your project's `platform.ini`, adjust your environment settings similar to
  36. the following:
  37. ```ini
  38. [platformio]
  39. default_envs = teensy41
  40. [env:teensy41]
  41. platform = teensy-gcc10
  42. platform_packages = toolchain-gcc-arm-embedded
  43. board = teensy41
  44. framework = arduino
  45. ```
  46. ## Building a project
  47. If everything is setup correctly, you may build your project per usual.
  48. ```sh
  49. # compile
  50. pio run
  51. # upload
  52. pio run --target upload
  53. ```
  54. ### Example Makefile
  55. Driving the pio process via `make` can be accomplished with a simple Makefile.
  56. (NB: this version assumes `make` will be invoked from within `vim`; if that's
  57. not the case, remove the `-c vim` portions.)
  58. ```Makefile
  59. all:
  60. pio -c vim run
  61. upload:
  62. pio -c vim run --target upload
  63. clean:
  64. pio -c vim run --target clean
  65. program:
  66. pio -c vim run --target program
  67. uploadfs:
  68. pio -c vim run --target uploadfs
  69. update:
  70. pio -c vim update
  71. ```
  72. # Upstream
  73. The code in `cores` is up-to-date as of late 2020 from the original
  74. https://github.com/PaulStoffregen/cores repo, combined with the libraries and
  75. tools found in PlatformIO's original framework-arduinoteensy. It's a bit of a
  76. mish-mash, but is fairly up-to-date and functional (tested and run in live
  77. systems for several months now).
  78. However, due to the amalgamation of repos and a variety of other reasons, the
  79. `cores` code will only be minimally updated for critical fixes, if at all.
  80. Instead, a leaner version of the 4.1 core, intended to be built with the
  81. [dds](https://github.com/vector-of-bool/dds) toolchain is actively maintained at
  82. my personal Gitea: https://git.thevis.us/visus/teensy-core-4.1
  83. # License
  84. ```
  85. Teensyduino Core Library
  86. http://www.pjrc.com/teensy/
  87. Copyright (c) 2017 PJRC.COM, LLC.
  88. Permission is hereby granted, free of charge, to any person obtaining
  89. a copy of this software and associated documentation files (the
  90. "Software"), to deal in the Software without restriction, including
  91. without limitation the rights to use, copy, modify, merge, publish,
  92. distribute, sublicense, and/or sell copies of the Software, and to
  93. permit persons to whom the Software is furnished to do so, subject to
  94. the following conditions:
  95. 1. The above copyright notice and this permission notice shall be
  96. included in all copies or substantial portions of the Software.
  97. 2. If the Software is incorporated into a build system that allows
  98. selection among a list of target devices, hen similar target
  99. devices manufactured by PJRC.COM must be included in the list of
  100. target devices and selectable in the same manner.
  101. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  102. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  103. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  104. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  105. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  106. ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  107. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  108. SOFTWARE.
  109. ```