We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://github.com/hpmicro/hpm_sdk/blob/276af9395fde9ca963ac5bf7ad1e516163168bfa/drivers/src/hpm_enc_pos_drv.c#L52C1-L53C1
当打开-Werror=double-promotion编译参数时,该出会出现float to double的隐式转换。
建议修改为:
uint32_t encoder_rad_to_position(float rad) { double tmp = (double)rad; const double _2pi = 6.283185307179586; while (tmp < 0) { tmp += _2pi; } while (tmp > _2pi) { tmp -= _2pi; } return (uint32_t)((tmp / _2pi) * (double)0xFFFFFFFF); }
The text was updated successfully, but these errors were encountered:
好的,谢谢提醒,将在下一个release修复。
Sorry, something went wrong.
No branches or pull requests
https://github.com/hpmicro/hpm_sdk/blob/276af9395fde9ca963ac5bf7ad1e516163168bfa/drivers/src/hpm_enc_pos_drv.c#L52C1-L53C1
当打开-Werror=double-promotion编译参数时,该出会出现float to double的隐式转换。
建议修改为:
The text was updated successfully, but these errors were encountered: