external mag

Dependents:   FreeIMU_external_magnetometer

Fork of HMC58X3 by Yifei Teng

Files at this revision

API Documentation at this revision

Comitter:
joe4465
Date:
Wed Apr 01 11:18:32 2015 +0000
Parent:
4:8eb12adc8368
Commit message:
...

Changed in this revision

HMC58X3.cpp Show annotated file Show diff for this revision Revisions of this file
HMC58X3.h Show annotated file Show diff for this revision Revisions of this file
diff -r 8eb12adc8368 -r cbeb4c54830c HMC58X3.cpp
--- a/HMC58X3.cpp	Sat Nov 09 08:51:00 2013 +0000
+++ b/HMC58X3.cpp	Wed Apr 01 11:18:32 2015 +0000
@@ -193,7 +193,7 @@
                     Detect saturation.
                 */
                 if (-(1<<12) >= min(xyz[0],min(xyz[1],xyz[2]))) {
-                    DEBUG_PRINT("HMC58x3 Self test saturated. Increase range.");
+                    DEBUG("HMC58x3 Self test saturated. Increase range.");
                     bret=false;
                     break;  // Breaks out of the for loop.  No sense in continuing if we saturated.
                 }
@@ -215,7 +215,7 @@
                     Detect saturation.
                 */
                 if (-(1<<12) >= min(xyz[0],min(xyz[1],xyz[2]))) {
-                    DEBUG_PRINT("HMC58x3 Self test saturated. Increase range.");
+                    DEBUG("HMC58x3 Self test saturated. Increase range.");
                     bret=false;
                     break;  // Breaks out of the for loop.  No sense in continuing if we saturated.
                 }
@@ -240,15 +240,15 @@
                 y_scale=(counts_per_milligauss[gain]*(HMC58X3_Y_SELF_TEST_GAUSS*2))/(xyz_total[1]/n_samples);
                 z_scale=(counts_per_milligauss[gain]*(HMC58X3_Z_SELF_TEST_GAUSS*2))/(xyz_total[2]/n_samples);
             } else {
-                DEBUG_PRINT("HMC58x3 Self test out of range.");
+                DEBUG("HMC58x3 Self test out of range.");
                 bret=false;
             }
             writeReg(HMC58X3_R_CONFA, 0x010); // set RegA/DOR back to default.
         } else {
 #if defined(ISHMC5843)
-            DEBUG_PRINT("HMC5843 failed id check.");
+            DEBUG("HMC5843 failed id check.");
 #else
-            DEBUG_PRINT("HMC5883L failed id check.");
+            DEBUG("HMC5883L failed id check.");
 #endif
             bret=false;
         }
@@ -256,7 +256,7 @@
         /*
             Bad input parameters.
         */
-        DEBUG_PRINT("HMC58x3 Bad parameters.");
+        DEBUG("HMC58x3 Bad parameters.");
         bret=false;
     }
     return(bret);
diff -r 8eb12adc8368 -r cbeb4c54830c HMC58X3.h
--- a/HMC58X3.h	Sat Nov 09 08:51:00 2013 +0000
+++ b/HMC58X3.h	Wed Apr 01 11:18:32 2015 +0000
@@ -28,7 +28,7 @@
 */
 
 //#define ISHMC5843 (1) // Uncomment this following line if you are using this library with the HMC5843.
-
+#include "Global.h"
 
 
 #ifndef HMC58X3_h