Commit Graph

4 Commits (ae2cd08965ccfab6c2a5e8d117ee50104c5da57b)

Author SHA1 Message Date
Reinhold Gschweicher 7c2ea617f9 sim: mark header that need to be as C header 2023-05-03 22:39:40 +07:00
Jean-François Milants 8ae5ba7c0a Integrate the new heap implementation from InfiniTime (https://github.com/InfiniTimeOrg/InfiniTime/pull/1709).
Since FreeRTOS.h, portmacro_cmsis.h and task.h are now built in C (by lv_mem.c), I had to change some includes and declarations to make them compatible with a C compiler.

Integrating the new memory management from InfiniTime in InfiniSim is not easy because InfiniSim does not include the whole FreeRTOS. Which means that, for example, pvPortMalloc() and vPortFree() are not accessible from InfiniSim.
As a first step, I provided custom implementations for pvPortMalloc(), vPortFree() which are based on ... malloc(). These function keep track of the memory that is currently allocated so that xPortGetFreeHeapSize(), xPortGetMinimumEverFreeHeapSize() return something.

Not that this implementation do not keep track of all the memory allocations done in InfiniTime. It can only "see" those done via pvPortMalloc(). It means that the available memory displayed by InfiniSim will probably be very optimistic.
2023-05-03 22:39:40 +07:00
Reinhold Gschweicher 999888eaf8 add missing <string> and <cmath> includes 2022-02-26 21:37:21 +07:00
Reinhold Gschweicher f19355949b Initial InfiniSim project 2022-02-17 22:57:08 +07:00