- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to use atan and it does not seem to be working. I have math.h included.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I understand that the math functions in the compiler is required, but it still would not work.......
I did get it to work by the following:
After setting the "m" in the Compiler-General, I looked at the Linker and saw that the Use newlb-nano Float Formatting was set to false so I changed it to True and it started working. This may be helpful for other users.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it can. The M4 even has support for floating point in hardware. You would need to change the compiler settings to take advantage of that.
Are you using PSoC Creator or ModusToolbox?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using PSoC Creator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can follow these instructions to have access to the math library. It should work for PSoC 6 as well.
Using Math Functions in PSoC® Creator™ for the PSoC 4 or PSoC 5LP GCC Compiler – KBA93076
Unfortunately, PSoC Creator doesn't allow you to enable floating point support in a easy way. You need to follow these instructions:
Enabling Hardware Floating Point Compilation for Arm Cortex-M4 in PSoC Creator™ - KBA222890
Note you don't need the second step to make this work. If you don't use it, it will just take more time to process floating point operations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I understand that the math functions in the compiler is required, but it still would not work.......
I did get it to work by the following:
After setting the "m" in the Compiler-General, I looked at the Linker and saw that the Use newlb-nano Float Formatting was set to false so I changed it to True and it started working. This may be helpful for other users.