|
TDuino
Convenient functionality for Arduino
|
By default TTimer, TTimeline and TTimelineT uses dynamic memory allocation for the items / slots they hold. In some cases this may not be an ideal sollution and therefore it is possible to allocate the memory used by the objects in a static way.
You need to modify TDefs.h in the library folder and you must focus on the lines:
First you need to uncomment the line which belongs to the object you want to use static allocation for. Next you need to define how many items / slots that object should be able to hold - by default the value is 10, but you can modify this to suit your needs.
By doing this, all instances of the selected object will hold the number of slots / items specified with the define. The value passed to the objects constructor will be ignored.
The code above will create two instances of TTimer, both able to hold 5 timers - even if another value is passed to the constructor!
1.8.15