commit 8cbe32407822983df2b0292b4c51127ffe0919e9
Author: Julia Niermann <jniermann@techfak.uni-bielefeld.de>
Date:   Wed Jul 3 11:48:32 2019 +0200

    Fix compiling errors

diff --git a/modules/LightRing_1-2/alldconf.h b/modules/LightRing_1-2/alldconf.h
index 136aaa7..ecd1a72 100644
--- a/modules/LightRing_1-2/alldconf.h
+++ b/modules/LightRing_1-2/alldconf.h
@@ -54,6 +54,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define AMIROLLD_CFG_INA219                     1
 
 /**
+ * @brief   Enable flag for the P9221R power monitor.
+ */
+#define AMIROLLD_CFG_P9221R                     1
+
+/**
  * @brief   Enable flag for the status LED.
  */
 #define AMIROLLD_CFG_LED                        1
diff --git a/modules/LightRing_1-2/module.c b/modules/LightRing_1-2/module.c
index c97f0ba..9820aa4 100644
--- a/modules/LightRing_1-2/module.c
+++ b/modules/LightRing_1-2/module.c
@@ -549,23 +549,28 @@ static int _utShellCmdCb_AlldP9221r(BaseSequentialStream* stream, int argc, char
   aosUtRun(stream, &moduleUtAlldP9221r, NULL);
   return AOS_OK;
 }
+
 static ut_p9221rdata_t _utP9221rData = {
-  /* driver           */ &moduleLldPowerMonitorVled,
-  /* expected voltage */ 4.2f,
-  /* tolerance        */ 0.2f,
+  /* driver           */ &moduleQiCharger, // !!!!
+  /* x alignment      */ 0.0f,
+  /* y alignment      */ 0.0f,
+  /* op freq          */ 0.0f,
+  /* voltage          */ 0.0f,
+  /* current          */ 0.0f,
   /* timeout */ MICROSECONDS_PER_SECOND,
 };
+
 aos_unittest_t moduleUtAlldP9221r = {
-  /* name           */ "P9221R",
-  /* info           */ "qi charger",
-  /* test function  */ utAlldP9221rFunc,
-  /* shell command  */ {
-    /* name     */ "unittest:QiCharger",
-    /* callback */ _utShellCmdCb_AlldP9221r,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utP9221rData,
-};
+    /* name           */ "P9221R",
+    /* info           */ "qi charger",
+    /* test function  */ utAlldP9221rFunc,
+    /* shell command  */ {
+      /* name     */ "unittest:QiCharger",
+      /* callback */ _utShellCmdCb_AlldP9221r,
+      /* next     */ NULL,
+    },
+    /* data           */ &_utP9221rData,
+  };
 
 /*
  * Status LED
diff --git a/modules/LightRing_1-2/module.h b/modules/LightRing_1-2/module.h
index e2a21e4..f41e626 100644
--- a/modules/LightRing_1-2/module.h
+++ b/modules/LightRing_1-2/module.h
@@ -391,6 +391,7 @@ extern ROMCONST char* moduleShellPrompt;
 /*===========================================================================*/
 #include <alld_AT24C01B.h>
 #include <alld_INA219.h>
+#include <alld_P9221R.h>
 #include <alld_LED.h>
 #include <alld_MIC9404x.h>
 //#include <alld_SNx5C3221E.h>
@@ -458,6 +459,7 @@ extern TLC5947Driver moduleLldLedPwm;
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 #include <ut_alld_AT24C01B_v1.h>
 #include <ut_alld_INA219_v1.h>
+#include <ut_alld_P9221R_v1.h>
 #include <ut_alld_LED_v1.h>
 #include <ut_alld_MIC9404x_v1.h>
 //#include <ut_alld_SNx5C3221E_v1.h>
@@ -474,6 +476,11 @@ extern aos_unittest_t moduleUtAlldAt24c01b;
 extern aos_unittest_t moduleUtAlldIna219;
 
 /**
+ * @brief   P9221R (qi charger) unit test object.
+ */
+extern aos_unittest_t moduleUtAlldP9221r;
+
+/**
  * @brief   Status LED unit test object.
  */
 extern aos_unittest_t moduleUtAlldLed;
diff --git a/modules/PowerManagement_1-2/module.h b/modules/PowerManagement_1-2/module.h
index aff8906..468e72f 100644
--- a/modules/PowerManagement_1-2/module.h
+++ b/modules/PowerManagement_1-2/module.h
@@ -444,7 +444,6 @@ extern ROMCONST char* moduleShellPrompt;
   aosShellAddCommand(&aos.shell, &moduleUtAlldBq27500.shellcmd);              \
   aosShellAddCommand(&aos.shell, &moduleUtAlldBq27500Bq24103a.shellcmd);      \
   aosShellAddCommand(&aos.shell, &moduleUtAlldIna219.shellcmd);               \
-  aosShellAddCommand(&aos.shell, &moduleUtAlldP9221r.shellcmd);               \
   aosShellAddCommand(&aos.shell, &moduleUtAlldPklcs1212e4001.shellcmd);       \
   aosShellAddCommand(&aos.shell, &moduleUtAlldLed.shellcmd);                  \
   aosShellAddCommand(&aos.shell, &moduleUtAlldTps62113.shellcmd);             \
@@ -596,7 +595,6 @@ extern ROMCONST char* moduleShellPrompt;
 #include <alld_bq241xx.h>
 #include <alld_bq27500.h>
 #include <alld_INA219.h>
-#include <alld_P9221R.h>
 #include <alld_LED.h>
 #include <alld_PKxxxExxx.h>
 #include <alld_TPS6211x.h>
@@ -754,7 +752,6 @@ extern AT42QT1050Driver moduleLldTouch;
 #include <ut_alld_bq27500_v1.h>
 #include <ut_alld_bq27500_v1_bq241xx_v1.h>
 #include <ut_alld_INA219_v1.h>
-#include <ut_alld_P9221R_v1.h>
 #include <ut_alld_LED_v1.h>
 #include <ut_alld_PKxxxExxx_v1.h>
 #include <ut_alld_TPS6211x_v1.h>
@@ -791,11 +788,6 @@ extern aos_unittest_t moduleUtAlldBq27500Bq24103a;
 extern aos_unittest_t moduleUtAlldIna219;
 
 /**
- * @brief   P9221R (qi charger) unit test object.
- */
-extern aos_unittest_t moduleUtAlldP9221r;
-
-/**
  * @brief   Status LED unit test object.
  */
 extern aos_unittest_t moduleUtAlldLed;
diff --git a/unittests/periphery-lld/inc/ut_alld_P9221R_v1.h b/unittests/periphery-lld/inc/ut_alld_P9221R_v1.h
index 4bf650f..012b5b0 100644
--- a/unittests/periphery-lld/inc/ut_alld_P9221R_v1.h
+++ b/unittests/periphery-lld/inc/ut_alld_P9221R_v1.h
@@ -21,9 +21,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <amiroos.h>
 
-#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_R9221R) && (AMIROLLD_CFG_R9221R == 1)) || defined(__DOXYGEN__)
+#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_P9221R) && (AMIROLLD_CFG_P9221R == 1)) || defined(__DOXYGEN__)
 
-#include <alld_R9221R.h>
+#include <alld_P9221R.h>
 
 /******************************************************************************/
 /* CONSTANTS                                                                  */
@@ -48,7 +48,7 @@ typedef struct {
   /**
    * @brief   R9221R driver to use.
    */
-  R9221RDriver *PRd;
+  P9221RDriver *PRd;
 
   /**
    * @brief   Alignment in x direction measured.
diff --git a/unittests/periphery-lld/src/ut_alld_P9221R_v1.c b/unittests/periphery-lld/src/ut_alld_P9221R_v1.c
index ed17341..6efa90b 100644
--- a/unittests/periphery-lld/src/ut_alld_P9221R_v1.c
+++ b/unittests/periphery-lld/src/ut_alld_P9221R_v1.c
@@ -60,12 +60,13 @@ aos_utresult_t utAlldP9221rFunc(BaseSequentialStream* stream, aos_unittest_t* ut
     status = p9221r_lld_read_register(((ut_p9221rdata_t*)ut->data)->PRd, P9221R_LLD_REGISTER_BATTERY_STATUS_SENT, data, 18, ((ut_p9221rdata_t*)ut->data)->timeout);
     if (status == APAL_STATUS_SUCCESS) {
       aosUtPassed(stream, &result);
-      for(int i=0; i<data.len; i++){
+      for(int i=0; i<18; i++){
           chprintf(stream, "register: %02x, data: %u \n", 0x3A+i, data[i]);
       }
     } else {
       aosUtFailed(stream, &result);
     }
 
+    return result;
 }
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_P9221R) && (AMIROLLD_CFG_P9221R == 1) */
