Skip to content

Comments

Inline LL_Init1msTick to omit division code#66

Open
sw wants to merge 1 commit intoIOsetting:mainfrom
sw:inline-init-tick
Open

Inline LL_Init1msTick to omit division code#66
sw wants to merge 1 commit intoIOsetting:mainfrom
sw:inline-init-tick

Conversation

@sw
Copy link
Contributor

@sw sw commented Dec 3, 2025

Reduce flash footprint by inlining LL_Init1msTick so that the SysTick LOAD register value can be calculated by the compiler, if constant frequency values are used.

Code size for Examples/PY32F002B/LL/GPIO/GPIO_Toggle

Before:

Memory region         Used Size  Region Size  %age Used
             RAM:         800 B         3 KB     26.04%
           FLASH:        1144 B        24 KB      4.65%

After:

Memory region         Used Size  Region Size  %age Used
             RAM:         800 B         3 KB     26.04%
           FLASH:         852 B        24 KB      3.47%

Reduce flash footprint by inlining `LL_Init1msTick` so that the
SysTick LOAD register value can be calculated by the compiler,
if constant frequency values are used.
@mrx23dot
Copy link

you should be using SysTick_Config(uint32_t ticks)

@sw
Copy link
Contributor Author

sw commented Feb 11, 2026

SysTick_Config does a bit more than LL_InitTick, though: it sets the SysTick_IRQn priority and enables the SysTick_CTRL_TICKINT flag. I don't think we necessarily want the tick interrupt enabled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants