external mag

Dependents:   FreeIMU_external_magnetometer

Fork of HMC58X3 by Yifei Teng

Revision:
6:cbeb4c54830c
Parent:
4:8eb12adc8368
--- 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);