Skip to content

Commit a49f27b

Browse files
committed
working on color addons
1 parent c1ee07f commit a49f27b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ext_mod/lvgl_addons/src/color_addons.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#define INV_TWO_PI 0.15915494309189533576876437577476f
1010

1111
#ifdef MP_SOFT_ATAN2
12-
1312
// Approximates atan2(y, x) normalized to the [0,4) range
1413
// with a maximum error of 0.1620 degrees
1514
float soft_atan2( float y, float x )
@@ -18,8 +17,8 @@ float soft_atan2( float y, float x )
1817
static const float b = 0.596227f;
1918

2019
// Extract the sign bits
21-
uint32_t ux_s = sign_mask & ((uint32_t) &)x;
22-
uint32_t uy_s = sign_mask & ((uint32_t) &)y;
20+
uint32_t ux_s = sign_mask & (uint32_t)x;
21+
uint32_t uy_s = sign_mask & (uint32_t)y;
2322

2423
// Determine the quadrant offset
2524
float q = (float)( ( ~ux_s & uy_s ) >> 29 | ux_s >> 30 );
@@ -30,8 +29,8 @@ float soft_atan2( float y, float x )
3029
float atan_1q = num / ( x * x + bxy_a + num );
3130

3231
// Translate it to the proper quadrant
33-
uint32_t uatan_2q = (ux_s ^ uy_s) | ((uint32_t) &)atan_1q;
34-
return q + ((float) &)uatan_2q;
32+
uint32_t uatan_2q = (ux_s ^ uy_s) | (uint32_t)atan_1q;
33+
return q + (float)uatan_2q;
3534
}
3635

3736
#endif /* MP_SOFT_ATAN */

0 commit comments

Comments
 (0)