aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-11-09 19:13:01 +1000
committerinmarket <andrewh@inmarket.com.au>2013-11-09 19:13:01 +1000
commit53408e2cb3d0705f261e9756bcf6f3f6c90c3fe9 (patch)
treec73dd665e3889b660c326dab7c1efdd178ec3657
parent190113b91c7692d13fa72c8b515208e9a648c6d2 (diff)
downloaduGFX-53408e2cb3d0705f261e9756bcf6f3f6c90c3fe9.tar.gz
uGFX-53408e2cb3d0705f261e9756bcf6f3f6c90c3fe9.tar.bz2
uGFX-53408e2cb3d0705f261e9756bcf6f3f6c90c3fe9.zip
Fix incorrect naming of GMISC_INVSQRT_... macros.
-rw-r--r--demos/modules/gdisp/streaming/gfxconf.h4
-rw-r--r--demos/modules/gdisp/streaming/main.c4
-rw-r--r--gfxconf.example.h4
-rw-r--r--include/gmisc/options.h12
-rw-r--r--src/gmisc/trig.c6
5 files changed, 15 insertions, 15 deletions
diff --git a/demos/modules/gdisp/streaming/gfxconf.h b/demos/modules/gdisp/streaming/gfxconf.h
index 4038a3fd..82843184 100644
--- a/demos/modules/gdisp/streaming/gfxconf.h
+++ b/demos/modules/gdisp/streaming/gfxconf.h
@@ -25,7 +25,7 @@
#define GFX_USE_GMISC TRUE
#define GMISC_NEED_INVSQRT TRUE
-//#define GDISP_INVSQRT_MIXED_ENDIAN TRUE
-//#define GDISP_INVSQRT_REAL_SLOW TRUE
+//#define GMISC_INVSQRT_MIXED_ENDIAN TRUE
+//#define GMISC_INVSQRT_REAL_SLOW TRUE
#endif /* _GFXCONF_H */
diff --git a/demos/modules/gdisp/streaming/main.c b/demos/modules/gdisp/streaming/main.c
index 5b857eeb..4ad48b6c 100644
--- a/demos/modules/gdisp/streaming/main.c
+++ b/demos/modules/gdisp/streaming/main.c
@@ -42,11 +42,11 @@
* your processor.
*
* You can modify the implementation of invsqrt() by firstly defining
- * #define GDISP_INVSQRT_MIXED_ENDIAN TRUE
+ * #define GMISC_INVSQRT_MIXED_ENDIAN TRUE
* in your gfxconf.h file.
*
* If it still doesn't work then instead define
- * #define GDISP_INVSQRT_REAL_SLOW TRUE
+ * #define GMISC_INVSQRT_REAL_SLOW TRUE
* in your gfxconf.h file. This should always work although it will probably be slow.
*/
#define BALLCOLOR1 Red
diff --git a/gfxconf.example.h b/gfxconf.example.h
index 74d7f768..260d8bf6 100644
--- a/gfxconf.example.h
+++ b/gfxconf.example.h
@@ -181,8 +181,8 @@
#define GWIN_CONSOLE_USE_BASESTREAM FALSE
#define GWIN_CONSOLE_USE_FLOAT FALSE
#define GWIN_NEED_IMAGE_ANIMATION FALSE
- #define GDISP_INVSQRT_MIXED_ENDIAN FALSE
- #define GDISP_INVSQRT_REAL_SLOW FALSE
+ #define GMISC_INVSQRT_MIXED_ENDIAN FALSE
+ #define GMISC_INVSQRT_REAL_SLOW FALSE
*/
/* Optional Low Level Driver Definitions */
diff --git a/include/gmisc/options.h b/include/gmisc/options.h
index 9c309487..06f689ec 100644
--- a/include/gmisc/options.h
+++ b/include/gmisc/options.h
@@ -53,15 +53,15 @@
* the same endianness. Unfortunately there are some strange
* processors that don't eg. some very early ARM devices.
* For those where the endianness doesn't match you can fix it by
- * defining GDISP_INVSQRT_MIXED_ENDIAN.
+ * defining GMISC_INVSQRT_MIXED_ENDIAN.
* @note This still assumes the processor is using an ieee floating point format.
*
* If you have a software floating point that uses a non-standard
* floating point format (or very strange hardware) then define
- * GDISP_INVSQRT_REAL_SLOW and it will do it the hard way.
+ * GMISC_INVSQRT_REAL_SLOW and it will do it the hard way.
*/
- #ifndef GDISP_INVSQRT_MIXED_ENDIAN
- #define GDISP_INVSQRT_MIXED_ENDIAN FALSE
+ #ifndef GMISC_INVSQRT_MIXED_ENDIAN
+ #define GMISC_INVSQRT_MIXED_ENDIAN FALSE
#endif
/**
* @brief Modifies the @p invsqrt() function to do things the long slow way.
@@ -69,8 +69,8 @@
* processor floating point format.
* @note This makes the @p invsqrt() function very slow.
*/
- #ifndef GDISP_INVSQRT_REAL_SLOW
- #define GDISP_INVSQRT_REAL_SLOW FALSE
+ #ifndef GMISC_INVSQRT_REAL_SLOW
+ #define GMISC_INVSQRT_REAL_SLOW FALSE
#endif
/** @} */
diff --git a/src/gmisc/trig.c b/src/gmisc/trig.c
index 2485da85..3c6dd461 100644
--- a/src/gmisc/trig.c
+++ b/src/gmisc/trig.c
@@ -144,7 +144,7 @@
#if GMISC_NEED_INVSQRT
// Algorithm based on Quake code.
- #if GDISP_INVSQRT_REAL_SLOW
+ #if GMISC_INVSQRT_REAL_SLOW
#include <math.h>
float invsqrt(float n) {
return 1.0/sqrt(n);
@@ -157,7 +157,7 @@
x2 = n * 0.5F;
// Convert into an int32 (no binary format conversion)
- #if GDISP_INVSQRT_MIXED_ENDIAN
+ #if GMISC_INVSQRT_MIXED_ENDIAN
((char *)&i)[0] = ((char *)&n)[3];
((char *)&i)[1] = ((char *)&n)[2];
((char *)&i)[2] = ((char *)&n)[1];
@@ -170,7 +170,7 @@
i = 0x5F375A86 - (i >> 1); // The quake code used 0x5F3759DF but this is better.
// Convert back to a float (no binary format conversion)
- #if GDISP_INVSQRT_MIXED_ENDIAN
+ #if GMISC_INVSQRT_MIXED_ENDIAN
((char *)&n)[0] = ((char *)&i)[3];
((char *)&n)[1] = ((char *)&i)[2];
((char *)&n)[2] = ((char *)&i)[1];