Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change float calculation to fixed point calculation #147

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

akkako
Copy link
Contributor

@akkako akkako commented Dec 14, 2024

Cortex-M0/M0+/M4(not M4F)/M23 has no FPU, float calculations use soft abi implimentation.

This cause complex calculation process and large code size.

Change all float calculations to fixed point calculations can save about 4 kB Flash space, and more efficiency calculation process.

This change is only tested on GD32DEV_A_E230 target(I only have this).

@AlkaMotors
Copy link
Collaborator

Have you tested stall protection and PID loop functions? Do they work as intended. I have not been able to test this yet but the changes look good.

@AlkaMotors AlkaMotors force-pushed the fixpoint_calc_optimize branch from 3048273 to 455fe3f Compare February 21, 2025 17:26
@AlkaMotors AlkaMotors merged commit a6bddd1 into am32-firmware:main Feb 21, 2025
2 checks passed
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