InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.68k stars 916 forks source link

infineat: Create colors at compile time. #1566

Closed Riksu9000 closed 1 year ago

Riksu9000 commented 1 year ago

lv_color_hex can't be evaluated at compile time, but LV_COLOR_MAKE can.

I feel like there must be a better approach that I'm missing. Let me know if you have ideas.

github-actions[bot] commented 1 year ago
Build size and comparison to develop: Section Size Difference
text 406752B -400B
data 940B 0B
bss 53568B 0B
lman0 commented 1 year ago

@Riksu9000 could you check if your PR , don't impact / increase the ram use of infinitime (reduce free mem) on pinetime? Because I remember in the past that a PR/proposition similar in purpose was done but in the end was rejected because live memory usage in pinetime increased a lot. (And in contrast the PR/proposition was removing firmware memory usage too).

If your PR reduce usage (or don't impact) memory ram And reduce firmware , this would indeed great.

JF002 commented 1 year ago

@lman0 From what I can tell, this PR reduces the flash usage (by removing code) and also RAM usage : it removes the struct WatchFaceInfineat::InfineatColors which was stored in flash and allocated in ram at runtime. It also reduce the stack usage (in ram) by not calling a function. So I don't think it'll have any negative side effect.