The making each string widget (there will be 2, and the other widgets sum to 7) is needed mostly because some of them aren’t the same (the method of updating is different, could be a descendant of a class, was one, and then the C++ wrappers came along). I want each task to show up as a separate and recognized entity on the task list, which I had. The way that the C++ wrappers are structured enforces this. Otherwise, it could be an instance of a derived class of widget (difference is where they update and if another task is feeding the update). Not a big deal, but yes, this is a moderately complex system with a lot of I/O feeding a main receive queue, which then dispatches packets through several interfaces.
Normal graphics objects (string, for instance) simply know how to draw themselves, what their parent is, and where on the screen to go. They normally do not have tasks. They change only if the screen is drawn again (ie. changing screens). Only widgets live update. Examples of widgets are time, heap, network address, battery, NRF, WIFI, and caption.
Most of these widgets update every 100 ms or more, or only if there is a change (queue driven).
Almost everything in the system is packet driven, which vastly simplifies the remoting of displays and peripherals, so there are a number of tasks involving the queues.
Now for TaskPrio = 48, well. I didn’t do that. In the STM32 version of CMISS 2.0
#if (configMAX_PRIORITIES != 56)
/*
CMSIS-RTOS2 defines 56 different priorities (see osPriority_t) and portable CMSIS-RTOS2
implementation should implement the same number of priorities.
Set #define configMAX_PRIORITIES 56 to fix this error.
*/
#error "Definition configMAX_PRIORITIES must equal 56 to implement Thread Management API."
#endif
#if (configUSE_PORT_OPTIMISED_TASK_SELECTION != 0)
/*
CMSIS-RTOS2 requires handling of 56 different priorities (see osPriority_t) while FreeRTOS port
optimised selection for Cortex core only handles 32 different priorities.
Set #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 to fix this error.
*/
#error "Definition configUSE_PORT_OPTIMISED_TASK_SELECTION must be zero to implement Thread Management API."
#endif
So this wasn’t my idea. I was perfectly happy with task priorities from 0 to 5
The draw method sends off a packet to a queue, and that’s about it. The only tasks in graphics are are based on widgets, which need to be self updating. (or are intended to be so).
display packets are enqueued, dequeued, sent to the TFT driver which does magic and updates a display image, which then calls a task to copy the affected area of the virtual display image to the actual display hardware (where it isn’t a direct write).
The system advantage to this is that the board supports multiple displays in local hardware, and should support any remote display over any supported communications means (NRF, WIFI, SERIAL, I2C). Packet communications for these interfaces is done, or mostly done.
However, the graphics routines themselves, string, for instance is a descendant of a virtual object (graphics object). The various draw routines (per class of object) generally harken back to an instantiated routine for that kind of object. This is used to draw children of an object without knowing the class of the object.
Main difference is if the drawn is allowed to have children. Whole graphics draw walks down a tree of siblings and children, so drawing an object draws all the children, be they siblings or child objects of siblings (and so on). Some have children, some don’t.
The draw member for any object (however far it has to go down), produces a display packet and then sends that off to the main queue, which then routes it to the display driver. Don’t see how this creates a loop, though, since no other draw routine is called, just a routine in a parent class, which calls no other draw routines.
Seems complicated once I explain it.