-
Notifications
You must be signed in to change notification settings - Fork 5
Add hall signal delay compensation #72
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
Conversation
|
About #73tfrog-motordriver/controlPWM.cI feel OtherLGTM |
About #75LGTM |
About #76tfrog-motordriver/controlPWM.cIs arm-gcc compiler promise a behavior of compile a modulo to less calculation method? hall_pos = hall_pos % ENC0_BUF_MAX; You limit ENC0_BUF_MAX as 2^n as bellow in // ENC0_BUF_MAX must be 2^n to reduce computation cost.
#define ENC0_BUF_MAX 64 So, how about like this? const int enc0_buf_mask = ENC0_BUF_MAX - 1;
hall_pos &= enc0_buf_mask; |
I don't think bit mask is required as gcc don't use real modulo operation for immediate value divider, even if it is compiled with |
fix #71
fix #38