diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2021-03-21 16:33:08 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2021-03-21 16:33:08 -0400 |
commit | a4f1482a8b23d5f761f60d6f3821c84190d89e2f (patch) | |
tree | 746095fa69eccccdc1c2830fdd0c06bac01848f5 /source/cordic.cpp | |
parent | 1a7d45b9130251119874df8b15424ec41306d8f2 (diff) |
add pot. support; L4 trig; eagle schematic draft
Diffstat (limited to 'source/cordic.cpp')
-rw-r--r-- | source/cordic.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/cordic.cpp b/source/cordic.cpp index d2997f2..29ee068 100644 --- a/source/cordic.cpp +++ b/source/cordic.cpp @@ -1,8 +1,8 @@ #include "cordic.hpp" #include "hal.h" -namespace cordic { #if !defined(TARGET_PLATFORM_L4) +namespace cordic { void init() { @@ -93,16 +93,21 @@ double tan(double x) { return tanx; } +} #else // L4 +#include <cmath> +namespace cordic { void init() {} -double mod(double, double) { return 0; } +float mod(float a, float b) { + return a - (b * std::floor(a / b)); +} -double cos(double) { return 0; } -double sin(double) { return 0; } -double tan(double) { return 0; } +float cos(float x) { return std::cos(x); } +float sin(float x) { return std::sin(x); } +float tan(float x) { return std::tan(x); } -#endif } +#endif |