Include math.h?


#1

I want to use some common math functions in a axo object (tan, pow, ...).
I guess I need to include C math.h, but how should that be done?

I tried this, but doesnt work (because all includes in that file need to be manually included too? )

<includes>
  <inlcude>/usr/include/math.h</include>
</include>

#2

I think you are unlikely to need to include anything, axoloti_math.h includes.

I think the includes are done using " " , so if you need to use the system path you would need to create a local header file and include that. BUT as i said, I think its not necessary.
note: Ive not tried math.h , but have included other header files from chibios etc without issue.

you can see the include paths setup in firmware/Makefile.patch


#3

did you even read the question?


#4

maybe try

<includes>
  <inlcude>math.h</include>
</include>

?

I'd expect math.h library functions to be very slow. Cortex-M4F is not good in "double" precision floating point. I recommend sinf, powf etc if you need to. CMSIS/DSP_lib provides some optimized math functions.


#5

yes... and if you have tried as i suggested you would have found it is unnecessary as I said, due to the fact it is already being included (via axoloti_math.h via xpatch.h)

anyway, I've had enough of your 'smart' comments and attitude... (this is not the first time, but before I've 'bit my tounge')

Im not part of axoloti support/customer service or any official support, I voluntarily contribute and help support, and help people here, simply because I want axoloti to be a success, and think that given its only @johannes, he needs a bit of community help.

obviously, you do not appreciate my help/advice or comments, thats fine by me, your choice, so I will refrain from answering any of your question/queries/issues or other comments in the future.

enjoy axoloti
Mark


#6

you don't need to include @johannes, xpatch.h -> axoloti.h -> axoloti_math.h -> maths.h & arm_maths.h

(and you've a typo obviously it would be

<includes>
   <include>math.h</include>
</includes>

#7

verified, no need to add extra includes for math.h

@thetechnobear I haven't seen attitude problems with @alex (or anyone else) in this community.

Ok,

shows your reply was not understood well, while your reply was helpful and correct.
You are of course at liberty to choose who you reply to. Your voluntary contributions are in any case very much appreciated!