Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Why install libraries along with teensy support?

  1. #1

    Why install libraries along with teensy support?

    Howdy, says
    " Teensyduino can automatically install many libraries that are tested and verified to work with Teensy. Usually it's best to allow the installer to add them all."

    Let's say I let it install its own copy of FastLED. Why would I do this if I'm working on other chips too and I have FastLED in my ~/arduino/libraries?
    Now that arduino IDE has a libraries manager, why would I want to muddle the waters and have yet another copy (maybe out of date) of libraries in hardware/teensy/avr/libraries ?

    I understand that teensy used to have patched version of standard libraries, but I'm assuming that those patches are now merged upstream, are they not?
    How do I easily know if some of those libraries differ from upstream and whether I'd want to use that forked copy over the standard copy?

    Thanks, Marc

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Like so many things in life, your choice is a matter of your personal preference.

    For a bit of background, consider Teensyduino's library install feature has existed since about 2010, much older than Arduino's library manager which was only added within the last couple years.

    The installer also adds several Teensy specific libs like ILI9341_t3 and Audio, which aren't available via Arduino's library manager.

    Now that many of the libs are available through Arduino's library manager, their inclusion in the installer is redundant. But it's still very convenient. Again, that's a matter of personal preference. Maybe what some people consider convenient to you is "muddle the waters". That's why the installer lets you choose.

  3. #3
    Senior Member
    Join Date
    Apr 2013
    Generally the generic arduino libraries will work on Teensy unless they go deep into the weeds setting AVR specific registers. The Teensy libraries often have changes make use of the hardware support and or 32 bit math for increased speed when compiling for a Teensy and so will be a better choice. The broader Arduino politics also mean that the Teensy installed libraries will be months or even years ahead of the official Arduino release that often lag behind the community for features that require discussion and community consensus.

    The general intent is that a Teensyduino install by a new user will give them code that works and fully uses the capability of their Teensy board out of the box. FastLED is a special case since the project ships with Teensy support already so unless there is a Teensy specific bug fixed by PJRC that has not yet merged into fastLED main stream then you are better of scrubing the Teensyduino version and using your custom version to reduce confusion, though the Arduino handling of multiple libraries has got much better of late, and should mean that if you compile for a non Teensy board the Teensy specific libraries are hidden.

    Edit - go with Paul's answer since he beat me to it

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    FastLED is kind of a special case. Mark & Daniel have usually be willing to merge fixes pretty quickly. But their release pace as slowed and they use branches, so fixes tend to sit on a branch for some time, so you have to pull from github (not in the zip download) and be able to deal with git branches. Most people don't use git & github on that level. In fact, I barely do, and only when contributing to projects that use them.

    Over the last few years there have been several minor minor issues, like the case about half a year ago where it was discovered one of their color space conversion macros would sometimes crash on Teensy LC due to unaligned memory access (and would have crashed on boards like Arduino Zero and MKR1000, but seems not many people use those for FastLED). I believe we may *still* have a tiny tweak to support Teensy 3.5, which may not be in the official FastLED.

    In fact, on my list of bugs to investigate is a problem reported in FastLED with software bitbang mode when use on Teensy 3.6 when running at 168 MHz or higher (but apparently 144 MHz & slower do work). I'm hoping to get a fix for that problem into the 1.42 release. Of course I'll contribute it back to FastLED. If past experience is any indication, they'll probably merge it to a branch within a few weeks. It'll probably become part of an official FastLED release by the time Teensyduino 1.44 releases, so we'll probably have a couple releases where Teensy's copy isn't identical due to that fix.

  5. #5
    Thanks for the answer Paul.
    Given where we are today, would it make sense to only include libraries that are different/better in teensyduino at the time it's released? Or is that already the case?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts