HOWTO develop teensy framework in structured manner?

caleb

Active member
Hi All,
I'm editing and updating code in the teensy framework, fixing buts, etc.

Is there a preferred way to check out all the teensy repos from github, and edit them, rather than use the auto-downloaded code from the Arduino/platformio tools?

My current method is using platformio command line tools, so I do this:

Code:
# pio init --board teensy41

Edit some code and compile

Code:
# pio run

Then,
Code:
cd ~.platformio/.../framework-aurduinoteensy/library
mv Audio Audio.old
git https://github.com/clone my_audio_library.git

And do edits from there. It's really kind of icky.

I'd prefer to

Code:
git clone my_teensy_repo.git  # <--- includes all needed repos as submodules

Then point platformio to this newly checked out place.

Any thoughts?

Thanks,
-Caleb
 
Sorry I don't normally do anything with platform IO, so don't know it's limitations or the like.


But what I typically do is:
git clone stuff for the different libraries, core, ...
Make edits and the like and submit Pull request on github...

My work pattern is probably different than most, but I download most of my github projects to d:\github\<project>

Note I am talking windows for commands but do something similar on Linus
I then for libraries:
I make a symbolic link in my case:
cd \users\kurte\documents\arduino\libraries
mklink /D audio d:\github\audio

When you build on Arduino it will choose the directories in the <sketches>/libraries over the ones that teensyduino installed in the arduino/hardware/teensy... directories.

For core: I end up renaming the cores directory to something like cores_release, and do the mklink in <arduino install/hardware/teensy/avr directory

Then when updating to new releases I remove the links ...
 
Ah! Thanks for the reply. Sounds about as ad-hoc as what I was doing :)

I just found a method with platformio that actually works reasonably well:

I do a clone like you did of the libraries, but put them into <mylibdir>/framework-teensyduino, so it includes framework-teensyduino/cores, librarries, etc.

Then, I can point platformio over to get the files directly from my local directory instead of git by doing something like this:

platformio.ini
Code:
[env:teensy41-dev]
board = teensy41
framework = arduino

platform = git@gitlab.com:signal-essence/teensy/platform-teensy.git

; For local development, use a local checkout of the framework                                                                                                                                                     
platform_packages = framework-arduinoteensy @ file:///home/caleb/se/framework-arduinoteensy
;                                                                                                                                                                                                                  
; for non-local develoopment, use this one.                                                                                                                                                                               
;platform_packages = framework-arduinoteensy @ git@gitlab.com:<your local copy of the stuff>/framework-arduinoteensy.git

Then when building I
Code:
rm -rf  ~/.platformio/packages/framework-arduinoteensy .pio/ && pio run
to rebuild and make sure it picks up the latest edits.

Thanks!
 
Here's what I do:

make the project directory:

Code:
mkdir audiotest

initialize it:

Code:
cd audiotest
pio init --board teensy41

add the library to the lib directory:

Code:
cd lib
git clone https://github.com/PaulStoffregen/Audio.git

and put the project source in
Code:
src
, for example I'll use the WavFilePLayer.ino:

Code:
cp Audio/examples/WavFilePlayer/WavFilePlayer.ino ../src

This should, by default, use the Audio in the lib folder instead of downloading its own copy.

Code:
cd ..
pio run

If you make changes in lib/Audio/ then platformio should pick them up automatically.
 
I should have known you'd have an easy way to do it my friend!

Does it work for cores as well? I suppose I could test it myself ;-)
 
Back
Top