Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 3 FirstFirst 1 2 3
Results 51 to 66 of 66

Thread: Teensyduino 1.54 Beta #11

  1. #51
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,441
    And ... thought a second INO would clean it up - and it does it the right SOURCE is started - the IDE would of course, given the Folder name matching.
    For TSET it takes this having not '~' but the primary Sketch.ino like :: sketchcmd=ALL.ino

    If it starts on the wrong one that is when I get:
    Code:
    :\arduino-1.8.15\hardware\teensy\avr\cores\teensy4/FS.h:37:0: warning: "FILE_READ" redefined
     #define FILE_READ  0
     ^
    Instead of second .CPP file > Twin INO's do compile as one and that eliminates the many other issues.
    Will start with that to break them up.

  2. #52
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,209
    Quote Originally Posted by defragster View Post
    So it seems ... but was looking for a way to move 900+ lines form the main.INO so they Setup and Loop would be apparent and the only changing thing needed for the various Media types.

    So that was first thought ... seeing it is problematic I can go to a MONO file, But then wondering if any of this would e a problem for larger projects ... I suppose not as they won't have multiple media type randomly selected but rather known ...

    Just wanted to know I wasn't missing something easy/generic for a CLASS * that would let this work.
    There is this https://docs.microsoft.com/en-us/cpp...5%20See%20also but don't think it will be generic enough.

    One of the nice things the way its set up now is that you see all the examples for the different storage media.

    The other thing you can do is take all the case stuff and make it a function call in a separate file then in the loop and setup it may be cleaner.

  3. #53
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,441
    Quote Originally Posted by mjs513 View Post
    There is this https://docs.microsoft.com/en-us/cpp...5%20See%20also but don't think it will be generic enough.

    One of the nice things the way its set up now is that you see all the examples for the different storage media.

    The other thing you can do is take all the case stuff and make it a function call in a separate file then in the loop and setup it may be cleaner.
    If it isn't done soon - there is no way it will get into 1.54 ... so was looking for the clean way to make it more readable without risking breaking stuff trying to clean it up.

    Thought for that was make separate INO that held setup() and loop() - though only setup() and constructor and such before that are unique.

    Then the 900+ lines of detail would be in separate file, that could be ignored or examined.

    With unique 'setup' then the other file would just be the same in all examples. And opening that sketch would be sure to work with no confusing sausage guts to look at or edit.

    I seem to be buildable now with twin INO's.

    If nothing else that allows unique edit for each Media type - hacking out the #ifdef overhead.

    ???

    <EDIT> these hairy things:
    Code:
    //#define TEST_RAM
    //#define TEST_SPI
    //#define TEST_QSPI
    //#define TEST_SPI_NAND
    //#define TEST_QSPI_NAND
    //#define TEST_PROG
    //#define TEST_MRAM

  4. #54
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,470
    I've added an example to the SD library, which tries to demonstrate how to access SdFat functions.

    https://github.com/PaulStoffregen/SD...dFat_Usage.ino

    We discussed SdFat integration back in November, but as far as I know, no single collection of examples exists to demonstrate how to use it.

    Which other special SdFat features should this example demonstrate how to use?

  5. #55
    There have been some updates to NativeEthernet, will these get rolled into the next beta or release?

  6. #56
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,441
    Quote Originally Posted by PaulStoffregen View Post
    I've added an example to the SD library, which tries to demonstrate how to access SdFat functions.

    https://github.com/PaulStoffregen/SD...dFat_Usage.ino

    We discussed SdFat integration back in November, but as far as I know, no single collection of examples exists to demonstrate how to use it.

    Which other special SdFat features should this example demonstrate how to use?
    No ?? :: // Teensy 3.5 & 3.6 & 4.1 on-board: BUILTIN_SDCARD
    > const int chipSelect = 10;

    Common manipulation?
    Maybe a open file "ThisDir.txt" for write {overwrite or delete if exist} and print the DIR data into the file? Open the file and read and show it matches the prior dir?
    Could use ? : bool ls(print_t* pr, uint8_t flags = 0) {

  7. #57
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,470
    Quote Originally Posted by TeensyWolf View Post
    There have been some updates to NativeEthernet, will these get rolled into the next beta or release?
    Yes. Pulled in the latest just now... that you mentioned it...

    If any other libraries need updates included, please let me know? Will probably package up beta12 tonight or early Wednesday.

  8. #58
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,470
    Quote Originally Posted by defragster View Post
    No ?? :: // Teensy 3.5 & 3.6 & 4.1 on-board: BUILTIN_SDCARD
    > const int chipSelect = 10;
    Look carefully at the 5 SD.sdfs.begin() examples. 2 are for SDIO, 3 are for SPI (using chipSelect).

  9. #59
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,441
    Quote Originally Posted by PaulStoffregen View Post
    Look carefully at the 5 SD.sdfs.begin() examples. 2 are for SDIO, 3 are for SPI (using chipSelect).
    okay ... Looking 'more' carefully I see:
    Code:
      // Access the built in SD card on Teensy 3.5, 3.6, 4.1 using DMA (maybe faster)
      //ok = SD.sdfs.begin(SdioConfig(DMA_SDIO));
    > would have caught my eye / Search with a note that the expected BUILTIN_SDCARD has a new method:
    Code:
      // Access the BUILTIN_SDCARD in SD card on Teensy 3.5, 3.6, 4.1 using DMA (maybe faster)
      //ok = SD.sdfs.begin(SdioConfig(DMA_SDIO));

  10. #60
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,214
    Quote Originally Posted by PaulStoffregen View Post
    I've added an example to the SD library, which tries to demonstrate how to access SdFat functions.

    https://github.com/PaulStoffregen/SD...dFat_Usage.ino

    We discussed SdFat integration back in November, but as far as I know, no single collection of examples exists to demonstrate how to use it.

    Which other special SdFat features should this example demonstrate how to use?
    Sort of a hard one to answer right now... As I don't remember some of the different things we used with the MTP and MSC integration and which parts have been integrated.

    Some of the things I know we have used include things like, check for what type of format does the SD Card have...
    Like: if (sdx[user_token].sdfs.fatType() == FAT_TYPE_FAT12) ...
    Or:
    Serial.println("\n**** dir of sd[0] ****");
    sdx[0].sdfs.ls();


    There were/are some packaging issues also associated with this, like we created our own sub-library PFsLib which is currently hosted within the the UsbMscFat library code. This code is based on SDFat FSLib, but with extensions, that help it work with Fat file systems hosted on Memory sticks or USB drives, like better partition support. But probably most of this needs to be delayed until hopefully next release.

    Edit: Things like extend FS to support Create and Modify dates. SDFS already support this, or forked branches show this in MTP on windows... Also sketches can now query the dates from SDFS File objects...

    With Dates/Times, there is then also some call back functions, such that sketches can properly have their files marked with appropriate dates and times.

    Code:
    // Call back for file timestamps.  Only called for file create and sync(). needed by SDFat-beta
    #include "TimeLib.h"
    void dateTime(uint16_t* date, uint16_t* time, uint8_t* ms10)
    { *date = FS_DATE(year(), month(), day());
      *time = FS_TIME(hour(), minute(), second());
      *ms10 = second() & 1 ? 100 : 0;
    }

  11. #61
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    7,209
    Quote Originally Posted by defragster View Post
    If it isn't done soon - there is no way it will get into 1.54 ... so was looking for the clean way to make it more readable without risking breaking stuff trying to clean it up.
    .....
    <EDIT> these hairy things:
    Code:
    //#define TEST_RAM
    //#define TEST_SPI
    //#define TEST_QSPI
    //#define TEST_SPI_NAND
    //#define TEST_QSPI_NAND
    //#define TEST_PROG
    //#define TEST_MRAM
    Kind of figured that but I can't think of anyway around using defines.

  12. #62
    Senior Member
    Join Date
    Oct 2015
    Location
    Vermont, USA
    Posts
    302
    Since someone brought up MTP, it'd be great if the Teensyduino's experimental MTP support could be switched to a real Serial (per the MTP library's readme) rather than the emulated serial that comes with the earlier versions of Teensyduino.

    Chip

  13. #63
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,470
    Quote Originally Posted by KurtE View Post
    But probably most of this needs to be delayed until hopefully next release.
    Yup. At this point the only things to be done before 1.54 release are bug fixes & improving example code.

    I'm going to package up 1.54-beta12 within the next 12 hours, and maybe a "final" beta in a couple days if we have more changes.

    My goal is a final 1.54 release this weekend.


    Quote Originally Posted by chipaudette View Post
    Since someone brought up MTP, it'd be great if the Teensyduino's experimental MTP support could be switched to a real Serial (per the MTP library's readme) rather than the emulated serial that comes with the earlier versions of Teensyduino.
    Absolutely no major changes like editing the USB types are possible at this late hour.

    We're in the final few days before a stable release.

  14. #64
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,470
    @Defragster - Please rename LFSintegrity and add comments at the top explaining in a new-user oriented way what it does and how to use it and why they might want to do that. It doesn't need to be on github - here is perfectly fine and I'll take care of those details. The code can remain in its current state for 1.54 release, but the name and comments are required. Now is your time to do this the way you want to see it done. If not, I will change it later this week and there won't be time to discuss.

  15. #65
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,441
    Quote Originally Posted by PaulStoffregen View Post
    @Defragster - Please rename LFSintegrity and add comments at the top explaining in a new-user oriented way what it does and how to use it and why they might want to do that. It doesn't need to be on github - here is perfectly fine and I'll take care of those details. The code can remain in its current state for 1.54 release, but the name and comments are required. Now is your time to do this the way you want to see it done. If not, I will change it later this week and there won't be time to discuss.
    Cool, Started work but wasn't sure there would be another Beta in time. Might have it done by your morning ...

    I was breaking it out into individual Media types - so given the wiring/soldering resources as we know to use - when correct it will work.

    No Media specific #defines - multiple sketches as noted before. Then some of the details on cryptic prints and go away like printing 'RAM_DISK' on every line.

    It was designed to allow a tool to do some of anything that seemed like it could lead to creating detecting breakage - so Jenga added stuff - and so much early verbose disabled over time as baby steps turned to walking then running ....

    I was going to fill this out with media specific variation subsketches:
    Code:
    T:\arduino-1.8.15\hardware\teensy\avr\libraries\LittleFS\examples\Integrity>dir /b
    MRAMSPI
    PSRAM
    QSPI
    RAM
    SPI

  16. #66
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,470
    I added more to the SdFat_Usage example.

    https://github.com/PaulStoffregen/SD...0c205fbfbbc0c8

    Rather than demonstrate FsFile with stuff you could just do using regular File, I made a demo of preAllocate() which you can't get with regular SD library functions.

Posting Permissions

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