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

Thread: Suggestion for update to the SD card driver

  1. #1
    Junior Member
    Join Date
    Feb 2019
    Posts
    2

    Suggestion for update to the SD card driver

    Hi Teensy Forum,

    As usual I am very impressed with the long list of available libraries for the Teensy 3.6. Having a complete FAT and SD library is very powerful and a great addition to the functionality of the Teensy 3.6.

    Currently I am learning how to use the SD library. I noticed that many of the built-in functions (like "ls") use the "Serial.print" method to print text (or file directories) to the screen.

    As it turns out, my dedicated CLI port is actually Serial1, which is then interfaced with a Teensy LC to provide a UART-USB bridge. I require this setup, since in my final device the Teensy 3.6 USB will be connected to a different device. In order to provide access to the CLI and other commands, I have routed my CLI through Serial1.

    Working with the SD library, this creates a slight complication, since any of the text printed by Serial, won't be printed to the correct serial channel.

    My suggestion is to replace the uses of "Serial" in the SD library with a #define so that the serial port can be unilaterally changed in one location.

    Since I am new to the forum and Teensy development, I am posting this suggestion to the forum to get the consensus of the forum on making this edit. Also, as a new contributor I would appreciate help from a more experienced contributor to take the lead on implementing this edit.

    Happy coding,

    Michael

  2. #2
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,052
    the best way to contribute is to fork the SD library from Paul's repository, modify the code and to issue a pull request.
    If the changes are reasonable and do not generate backward incompatibilities, Paul will for sure consider to merge the changes.
    (BTW, I agree that it is not a good idea to have 'Serial' be hard-coded)

Posting Permissions

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