Skip to content

Conversation

@uLipe
Copy link

@uLipe uLipe commented Oct 13, 2025

Move the hot code paths (functions called often by the upper layer of the loopFOC) of the PWM driver to the IRAM:

  • To prevent issues the ESP32 cache is disabled.
  • Improves the execution speed since IRAM is the fastest memory available.
  • Also replace some divisions with reciprocal multiplication to avoid DIV.F instruction usage saving some cycles.

* By moving fast functions to the IRAM
* Replacing divisions by reciprocal multiplication to avoid CPU to issue a DIV.F instruction.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
@uLipe uLipe changed the base branch from master to dev October 13, 2025 14:09
@uLipe
Copy link
Author

uLipe commented Oct 13, 2025

@runger1101001 , @askuric PTAL.

@askuric
Copy link
Member

askuric commented Oct 14, 2025

LGTM :D

@runger1101001 runger1101001 added the enhancement New feature or request label Oct 14, 2025
@runger1101001 runger1101001 added this to the 2.3.6_Release milestone Oct 14, 2025
@runger1101001
Copy link
Member

This looks good to me, I will merge it...

@runger1101001 runger1101001 merged commit 4e933aa into simplefoc:dev Oct 14, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants