Does RTC uses systick? if so, does it uses the systick callback function?
FreeRTOS uses systick with 1khz interrupts, and set the systick callback function to call an RTOS function that does the scheduling.
I believe RTC uses a different clock source, but if it uses systick, we could have 2 solutions:
-Change the callback from systick to RTC, and RTC calls the freeRTOS scheduler.
-Let RTOS have the callback from systick, but then RTOS calls the RTC.
Besides systick, and 2 functions in assembler that save the stack and restore the stack each time a task is switched, RTOS does not interfere with anything else.
I have successfully used DMA and the DMA ISR without any modification whatsoever, it doesn't care. As the cortex has a NVIC I guess that takes cares of priorities and serving any interrupt that triggers while another is being served, so they don't block each other.
In my most complex example to the moment, I have 2 functions drawing to the screen, with another function doing sqrt calculations in the background, pretty intense math. The sqrt performance goes down like 30% 40% compare as running by itself, but it has the lowest priorities, so at the same time the drawing ones are working at almost full speed.
If I used an mcu with 64KB, and reserved 32KB for frame buffer for a 128x128 full color TFT, I could the screen refresh completely on DMA at whatever frequency I wanted using just a few CPU cycles.
It's something I want to test, but I need to rewrite the ILI9163 driver to do all the drawing to a frame buffer.
Sadly, that would not work on in the nicer bigger 9341, cause the 1 full frame would take 144KB
I believe using the frame buffer could provide a huge performance impact, as writing a pixel would imply just writing 2 bytes to RAM, rather than having to send control data to the display, then the address of the pixel, then the pixel data itself, and wait for all those SPI transactions to complete...
Still the need for speed in such a small lcd display is doubtful...