Teensy 4.0 and C++

Status
Not open for further replies.

JupiterMoll

Member
Hi,
I working right now on a wearable project using Teensy 4.0 with the Audio-Shield, W2182B and some sensor...
The Project has some complexity using dynamic rewiring audio connection, create light animation, that are in sync with the sound and
so on... .
My question is what features of C++ can we use with the fastest microncontroller of wolrd : Teensy 4.0 with the Power 600Mhz and 1 Mb Ram that where not possible with slower microcontrollers without impact on code size or on speed.
1.) Interfaces -Pure Virtual Functions
2.) Smart Pointers
3.) Dynammic Allocation...etc.

I hope you got the point...
 
These have on all computers impact on codesize and speed. Even on your PC ;)
If you don't care you can use them.
 
Hi,

My question is what features of C++ can we use with the fastest microncontroller of wolrd : Teensy 4.0 with the Power 600Mhz and 1 Mb Ram that where not possible with slower microcontrollers without impact on code size or on speed.

I hope you got the point...

Advanced coding practices always have a cost, as Frank has said. The real issue is whether this cost is significant in your environment. The answer is to instrument your code and measure the impact for yourself. Measure, measure and measure again.

My own big project tries to do a lot in the main loop, but some things must not be delayed. And so I instrumented my program to see how long things are taking. My instrumentation was very simple but, I think, quite effective. In the main loop I put a loop counter which was incremented on every traversal. An interrupt is triggered at half second intervals(by the PPS from a GPS). This ISR reports the number of loop traversal in the half second and then it resets the loop counter to zero.

I now tested different approaches and measured their effect by counting the loop traversals per half second. This was a real eye opener for me and I redesigned my code accordingly.
 
Status
Not open for further replies.
Back
Top