Skip to content

Implement __aeabi_f2d and __aeabi_d2f #356

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

Merged
merged 1 commit into from
Mar 23, 2014
Merged

Conversation

iabdalkader
Copy link
Contributor

Note1: those are using the correct calling convention, they will read the argument from r0(+r1) because (all?) _aeabi functions should use softfp.

Note2: math.h breaks build (is it needed?):

math.c:67:7: error: expected ')' before '/' token

Note3: I'm not sure if I'm supposed to handle overflows or special values, hopefully someone who knows better would improve this.

@blmorris
Copy link
Contributor

I have seen the same error you mentioned in note 2, for me the line of code that gets marked is for the log2f function. Build proceeds normally with that one line commented out. I had no idea what to make of that error.

@iabdalkader
Copy link
Contributor Author

because after the prototype in math.h it's redefined as logf

#if !defined(__cplusplus)
#define log2f(x) (logf (x) / (float_t) _M_LN2)
#endif

@blmorris
Copy link
Contributor

Thanks, I see it now. Are the prototypes in math.h also the reason for the problem I noted in issue #353 ? Just curious, trying to follow along with the work being done by people who actually know what they are doing ;)

@iabdalkader
Copy link
Contributor Author

probably has something to do with the math header, but it is also related because double to float and float to double conversion was needed for printf to work

@dpgeorge
Copy link
Member

Are the prototypes in math.h also the reason for the problem I noted in issue #353 ?

No, there was a mistake in the code, that isfinite etc don't have --f versions (eg isfinitef does not exist for single prec, but sinf does).

dpgeorge added a commit that referenced this pull request Mar 23, 2014
Implement __aeabi_f2d and __aeabi_d2f
@dpgeorge dpgeorge merged commit e43e27c into micropython:master Mar 23, 2014
@iabdalkader iabdalkader deleted the d2f branch March 23, 2014 00:40
tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Nov 7, 2017
If a soft reset happens while the gamepad module is scanning for button
presses, there is a moment when the pins get de-initialized, but the
gamepad module is still trying to read them, which ends in a crash.
We can avoid it by disabling scanning on reset.
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.

3 participants