What are the advantages of the Teensy LC/3.x optimized speeds?

Status
Not open for further replies.

Djinny

Member
Looking at the Teensy LC, and 3.x, they have an optimized, in the speeds. 72mhz and then 72mhz(optimized)
What are the advantages and disadvantages to both? And what are the situations where one should be used over the other?

It likely won't affect any of my projects since they're USB HID, but i'm very curious about this.
 
The compiler tries to optimize your code for speed vs memory usage.

On Teensy LC with Cortex-M0+, the speedup is usually only a few percent. On Teensy 3.2, with the more powerful Cortex-M4, the compiler can actually make your code run significantly faster by using more memory.

The speed optimized code also uses a printf which supports floating point with "%f", which only matters if you use sprintf() or Serial.printf(), and only if you try printing float or double. Omitting float from printf saves about 20K.
 
Thank you. Now i know. I've been very curious about it for a while and did some testing to see if it affected my code. More specifically to see if it affected my analog jitter. And nothing.
But figured i'd ask anyways.

Thank you again, i love your products Mr Stoffregen. We'll have to talk some time about changing your USB joystick HID to 8 analogs by default, which all the teensy 2.0s 3.x can support. Since 8 analog axis seems to be what windows DirectInput supports. (with possibly a hidden 9th axis, but i haven't confirmed this.)
I have the code for the ++2.0, 32 buttons and 8 axis, but no hats, but those can be added later, my T3.2 code is only 16 buttons and 8 axis, since it's what i needed, since couldn't use buttons on a matrix for my projects.

With Star Citizen, Elite:Dangerous, No Man's Sky, i have a feeling we're going to see even more people building these things. http://imgur.com/a/vtc5C
And they're going to want to squeeze everything they can
 
The speed optimized code also uses a printf which supports floating point with "%f", which only matters if you use sprintf() or Serial.printf(), and only if you try printing float or double. Omitting float from printf saves about 20K.
I assume that's 20k of flash storage, right?
 
Would the optimized code also run faster when the CPU runs at 8MHz or even 4MHz? If yes then this would be very interesting for low power applications.
 
We'll have to talk some time about changing your USB joystick HID to 8 analogs by default, which all the teensy 2.0s 3.x can support. Since 8 analog axis seems to be what windows DirectInput supports.

Yes, I'd like to add this change. It's too late to get this into Teensyduino 1.28, but let's do it for 1.29 (likely late June to early July)
 
Alright, so 8 axis, 32 buttons, and a hat switch. i can do that. i'll work on it over the next couple days
Not like it's all that hard now that i figured out how to change all that stuff.
Currently my 3.2's code is 16 buttons, no hat, but i can modify that. My ++ code is 32buttons and no hat (windows shows hat switches as normal buttons in addition to the "hat" anyways for me.) so up on the hat will show up on the hat in joy.cpl but will also press one of the controller's buttons. /shrugs
 
Status
Not open for further replies.
Back
Top