[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 

How to increase the number of tasks or number of switches RSS feed
Forum Index » IoAbstraction & TaskManagerIO
Author Message
davetcc


Joined: Jan 19, 2019
Messages: 167
Offline
I wish to use task manager with more switches than are supported by default, how can I change the settings?
davetcc


Joined: Jan 19, 2019
Messages: 167
Offline
The number of switches can be changed from the default of 4 by setting the following define:

MAX_KEYS

It can either be done by editing SwitchInput.h in the library, or re-defining the value in the compiler settings. Changing it in your sketch will not work.

For task manager the setting to change the number of tasks from (AVR 6 tasks, SAMD 10 tasks) is:

DEFAULT_TASK_SIZE

It can either be done by editing TaskManager.h in the library, or re-defining the value in the compiler settings. Changing it in your sketch will not work.
davetcc


Joined: Jan 19, 2019
Messages: 167
Offline
As of version 1.6 of IoAbstraction you no longer need to redefine these parameters. However, if you want to avoid reallocations you can allocate these yourself to specific values just as before.

* Task Manager will grow on 32-bit boards up to 256 tasks, and up to about 80 tasks on larger 8-bit boards. It uses a tranche system, so for example on a 32-bit board, it will start with 16 tasks then allocate another 16 when needed. Until it reaches the maximum number of tranches.

* Switches will reallocate keys as needed starting with reasonable defaults. It uses the lightweight-collection that is built into IoAbstraction, so as you exceed the number of switches it reallocates the backing array.

* Note that Rotary Encoders do not automatically reallocate, this is because most people don't need more than 4 rotary encoders. You still need to change this manually if you need more.
 
Forum Index » IoAbstraction & TaskManagerIO
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer