6
6
// ~50us (int array)
7
7
// precision +-0.005
8
8
// it has to receive an angle in between 0 and 2PI
9
- WEAK float _sin (float a){
9
+ __attribute__ ((weak)) float _sin(float a){
10
10
// int array instead of float array
11
11
// 4x200 points per 360 deg
12
12
// 2x storage save (int 2Byte float 4 Byte )
@@ -37,15 +37,15 @@ WEAK float _sin(float a){
37
37
// ~56us (int array)
38
38
// precision +-0.005
39
39
// it has to receive an angle in between 0 and 2PI
40
- WEAK float _cos (float a){
40
+ __attribute__ ((weak)) float _cos(float a){
41
41
float a_sin = a + _PI_2;
42
42
a_sin = a_sin > _2PI ? a_sin - _2PI : a_sin;
43
43
return _sin (a_sin);
44
44
}
45
45
46
46
47
47
// normalizing radian angle to [0,2PI]
48
- WEAK float _normalizeAngle (float angle){
48
+ __attribute__ ((weak)) float _normalizeAngle(float angle){
49
49
float a = fmod (angle, _2PI);
50
50
return a >= 0 ? a : (a + _2PI);
51
51
}
@@ -58,7 +58,7 @@ float _electricalAngle(float shaft_angle, int pole_pairs) {
58
58
// square root approximation function using
59
59
// https://reprap.org/forum/read.php?147,219210
60
60
// https://en.wikipedia.org/wiki/Fast_inverse_square_root
61
- WEAK float _sqrtApprox (float number) {// low in fat
61
+ __attribute__ ((weak)) float _sqrtApprox(float number) {// low in fat
62
62
// float x;
63
63
// const float f = 1.5F; // better precision
64
64
0 commit comments