commit 916f8d28c66d5da8125a48e4faae93c117848a63
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Thu Mar 21 17:43:49 2019 +0100

    aos_status_t type optimized for smaller memory footprint.

diff --git a/core/inc/aos_types.h b/core/inc/aos_types.h
index c2cad4c..f0546d5 100644
--- a/core/inc/aos_types.h
+++ b/core/inc/aos_types.h
@@ -46,17 +46,39 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /******************************************************************************/
 
 /**
- * @brief   Error codes used in AMiRo-OS.
+ * @brief   Error and status type generally used in AMiRo-OS.
  */
-typedef enum {
-  AOS_OK = 0,                 /**< No error, success. */
-  AOS_SUCCESS = 0,            /**< No error, success */
-  AOS_WARNING = 1,            /**< No error, but a warning occurred */
-  AOS_INVALID_ARGUMENTS = 2,  /**< No error, but given arguments are invalid */
-  AOS_ERROR = 0x80,           /**< An error occurred */
-  AOS_FAILURE = 0x80,         /**< An error occurred */
-} aos_status_t;
+typedef uint8_t aos_status_t;
 
+/**
+ * @brief   Success: no error or warning occurred.
+ */
+#define AOS_OK                                  ((aos_status_t)0x00u)
+
+/**
+ * @brief   Success: no error or warning occurred.
+ */
+#define AOS_SUCCESS                             ((aos_status_t)0x00u)
+
+/**
+ * @brief   Some unspecified waring occurred.
+ */
+#define AOS_WARNING                             ((aos_status_t)0x01u)
+
+/**
+ * @brief   Invalid arguments detected.
+ */
+#define AOS_INVALIDARGUMENTS                    ((aos_status_t)0x02u)
+
+/**
+ * @brief   An error occurred.
+ */
+#define AOS_ERROR                               ((aos_status_t)0x80u)
+
+/**
+ * @brief   An error occurred.
+ */
+#define AOS_FAILURE                             ((aos_status_t)0x80u)
 
 /******************************************************************************/
 /* MACROS                                                                     */
diff --git a/core/src/aos_system.c b/core/src/aos_system.c
index ff1be67..c168be4 100644
--- a/core/src/aos_system.c
+++ b/core/src/aos_system.c
@@ -357,14 +357,14 @@ static void _printSystemInfo(BaseSequentialStream* stream)
  *
  * @return              An exit status.
  * @retval  AOS_OK                  The command was executed successfuly.
- * @retval  AOS_INVALID_ARGUMENTS   There was an issue with the arguemnts.
+ * @retval  AOS_INVALIDARGUMENTS    There was an issue with the arguemnts.
  */
 static int _shellcmd_configcb(BaseSequentialStream* stream, int argc, char* argv[])
 {
   aosDbgCheck(stream != NULL);
 
   // local variables
-  int retval = AOS_INVALID_ARGUMENTS;
+  int retval = AOS_INVALIDARGUMENTS;
 
   // if there are additional arguments
   if (argc > 1) {
@@ -401,7 +401,7 @@ static int _shellcmd_configcb(BaseSequentialStream* stream, int argc, char* argv
             }
             else {
               chprintf(stream, "unknown option '%s'\n", argv[3]);
-              return AOS_INVALID_ARGUMENTS;
+              return AOS_INVALIDARGUMENTS;
             }
           }
         }
@@ -470,7 +470,7 @@ static int _shellcmd_configcb(BaseSequentialStream* stream, int argc, char* argv
       }
       else {
         chprintf(stream, "unknown option '%s' or invalid value '%s'\n", argv[2], argv[3]);
-        return AOS_INVALID_ARGUMENTS;
+        return AOS_INVALIDARGUMENTS;
       }
       dt.tm_wday = aosTimeDayOfWeekFromDate(dt.tm_mday, dt.tm_mon+1, dt.tm_year+1900) % 7;
       aosSysSetDateTime(&dt);
@@ -487,7 +487,7 @@ static int _shellcmd_configcb(BaseSequentialStream* stream, int argc, char* argv
   }
 
   // print help, if required
-  if (retval == AOS_INVALID_ARGUMENTS) {
+  if (retval == AOS_INVALIDARGUMENTS) {
     chprintf(stream, "Usage: %s OPTION\n", argv[0]);
     chprintf(stream, "Options:\n");
     chprintf(stream, "  --help\n");
@@ -578,7 +578,7 @@ static int _shellcmd_infocb(BaseSequentialStream* stream, int argc, char* argv[]
  *
  * @return              An exit status.
  * @retval  AOS_OK                  The command was executed successfully.
- * @retval  AOS_INVALID_ARGUMENTS   There was an issue with the arguments.
+ * @retval  AOS_INVALIDARGUMENTS   There was an issue with the arguments.
  */
 static int _shellcmd_shutdowncb(BaseSequentialStream* stream, int argc, char* argv[])
 {
@@ -603,7 +603,7 @@ static int _shellcmd_shutdowncb(BaseSequentialStream* stream, int argc, char* ar
     chprintf(stream, "  --restart, -r\n");
     chprintf(stream, "    Shutdown and restart system.\n");
 
-    return (argc != 2) ? AOS_INVALID_ARGUMENTS : AOS_OK;
+    return (argc != 2) ? AOS_INVALIDARGUMENTS : AOS_OK;
   }
   // handle argument
   else {
@@ -629,7 +629,7 @@ static int _shellcmd_shutdowncb(BaseSequentialStream* stream, int argc, char* ar
     }
     else {
       chprintf(stream, "unknown argument %s\n", argv[1]);
-      return AOS_INVALID_ARGUMENTS;
+      return AOS_INVALIDARGUMENTS;
     }
   }
 #else /* (AMIROOS_CFG_SSSP_ENABLE == true) */
diff --git a/modules/DiWheelDrive_1-1/module.c b/modules/DiWheelDrive_1-1/module.c
index 138061c..7601015 100644
--- a/modules/DiWheelDrive_1-1/module.c
+++ b/modules/DiWheelDrive_1-1/module.c
@@ -786,7 +786,7 @@ static int _utShellCmdCb_AlldVcnl4020(BaseSequentialStream* stream, int argc, ch
   chprintf(stream, "    Test left wheel proximity sensor.\n");
   chprintf(stream, "  --wheelright, -wr\n");
   chprintf(stream, "    Test right wheel proximity sensor.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_vcnl4020data_t _utVcnl4020Data = {
   /* driver       */ &moduleLldProximity,
diff --git a/modules/DiWheelDrive_1-2/module.c b/modules/DiWheelDrive_1-2/module.c
index 34884f0..ab17198 100644
--- a/modules/DiWheelDrive_1-2/module.c
+++ b/modules/DiWheelDrive_1-2/module.c
@@ -684,7 +684,7 @@ static int _utShellCmdCb_AlldVcnl4020(BaseSequentialStream* stream, int argc, ch
   chprintf(stream, "    Test left wheel proximity sensor.\n");
   chprintf(stream, "  --wheelright, -wr\n");
   chprintf(stream, "    Test right wheel proximity sensor.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_vcnl4020data_t _utVcnl4020Data = {
   /* driver       */ &moduleLldProximity,
diff --git a/modules/LightRing_1-2/module.c b/modules/LightRing_1-2/module.c
index 8c1b889..3e61956 100644
--- a/modules/LightRing_1-2/module.c
+++ b/modules/LightRing_1-2/module.c
@@ -624,7 +624,7 @@ static int _utShellCmdCb_Mic9404x(BaseSequentialStream* stream, int argc, char*
   chprintf(stream, "    Test power switch for 5.0V supply.\n");
   chprintf(stream, "  VSYS\n");
   chprintf(stream, "    Test power switch for VSYS supply.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 aos_unittest_t moduleUtAlldMic9404x = {
   /* info           */ "MIC9404x",
diff --git a/modules/PowerManagement_1-1/module.c b/modules/PowerManagement_1-1/module.c
index 21ac764..df06e06 100644
--- a/modules/PowerManagement_1-1/module.c
+++ b/modules/PowerManagement_1-1/module.c
@@ -800,7 +800,7 @@ static int _utShellCmdCb_AlldBq24103a(BaseSequentialStream* stream, int argc, ch
     chprintf(stream, "    Test the front battery charger.\n");
     chprintf(stream, "  --rear, -r\n");
     chprintf(stream, "    Test the rear battery charger.\n");
-    return AOS_INVALID_ARGUMENTS;
+    return AOS_INVALIDARGUMENTS;
   } else {
     return AOS_OK;
   }
@@ -844,7 +844,7 @@ static int _utShellCmdCb_AlldBq27500(BaseSequentialStream* stream, int argc, cha
   chprintf(stream, "    Test the front battery fuel gauge.\n");
   chprintf(stream, "  --rear, -r\n");
   chprintf(stream, "    Test the rear battery fuel gauge.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_bq27500data_t _utAlldBq27500Data = {
   /* driver   */ NULL,
@@ -893,7 +893,7 @@ static int _utShellCmdCb_AlldBq27500Bq24103a(BaseSequentialStream* stream, int a
   chprintf(stream, "    Test the front battery fuel gauge and charger.\n");
   chprintf(stream, "  --rear, -r\n");
   chprintf(stream, "    Test the rear battery fuel gauge and charger.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_bq27500bq241xxdata_t _utAlldBq27500Bq24103aData= {
   /* bq27500 driver   */ NULL,
@@ -973,7 +973,7 @@ static int _utShellCmdCb_AlldIna219(BaseSequentialStream* stream, int argc, char
   chprintf(stream, "    Test VSYS 4.2V power monitor.\n");
   chprintf(stream, "  VIO5.0\n");
   chprintf(stream, "    Test VIO 5.0V power monitor.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_ina219data_t _utAlldIna219Data = {
   /* driver           */ NULL,
@@ -1149,7 +1149,7 @@ static int _utShellCmdCb_AlldPca5944a(BaseSequentialStream* stream, int argc, ch
   chprintf(stream, "    Test the multiplexer on the I2C bus #1.\n");
   chprintf(stream, "  #2\n");
   chprintf(stream, "    Test the multiplexer on the I2C bus #2.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_pca9544adata_t _utAlldPca9544aData = {
   /* driver   */ NULL,
@@ -1295,7 +1295,7 @@ static int _utShellCmdCb_AlldVcnl4020(BaseSequentialStream* stream, int argc, ch
   chprintf(stream, "    Test west-northwest sensor.\n");
   chprintf(stream, "  -nnw\n");
   chprintf(stream, "    Test north-northwest sensor.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_vcnl4020data_t _utAlldVcnl4020Data = {
   /* driver       */ NULL,
@@ -1346,7 +1346,7 @@ static int _utShellCmdCb_AlldPcal6524(BaseSequentialStream* stream, int argc, ch
   chprintf(stream, "    Test the GPIO extender on the I2C bus #1.\n");
   chprintf(stream, "  #2\n");
   chprintf(stream, "    Test the GPIO extender on the I2C bus #2.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_pcal6524data_t _utAlldPcal6524Data = {
   /* driver   */ NULL,
@@ -1423,7 +1423,7 @@ static int _utShellCmdCb_AlldPcal6524(BaseSequentialStream* stream, int argc, ch
   chprintf(stream, "    Test the GPIO extender on the I2C bus #1.\n");
   chprintf(stream, "  #2\n");
   chprintf(stream, "    Test the GPIO extender on the I2C bus #2.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_pcal6524data_t _utAlldPcal6524Data = {
   /* driver   */ NULL,
diff --git a/modules/PowerManagement_1-2/module.c b/modules/PowerManagement_1-2/module.c
index c7de881..ecb8758 100644
--- a/modules/PowerManagement_1-2/module.c
+++ b/modules/PowerManagement_1-2/module.c
@@ -816,7 +816,7 @@ static int _utShellCmdCb_AlldBq24103a(BaseSequentialStream* stream, int argc, ch
     chprintf(stream, "    Test the front battery charger.\n");
     chprintf(stream, "  --rear, -r\n");
     chprintf(stream, "    Test the rear battery charger.\n");
-    return AOS_INVALID_ARGUMENTS;
+    return AOS_INVALIDARGUMENTS;
   } else {
     return AOS_OK;
   }
@@ -860,7 +860,7 @@ static int _utShellCmdCb_AlldBq27500(BaseSequentialStream* stream, int argc, cha
   chprintf(stream, "    Test the front battery fuel gauge.\n");
   chprintf(stream, "  --rear, -r\n");
   chprintf(stream, "    Test the rear battery fuel gauge.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_bq27500data_t _utAlldBq27500Data = {
   /* driver   */ NULL,
@@ -909,7 +909,7 @@ static int _utShellCmdCb_AlldBq27500Bq24103a(BaseSequentialStream* stream, int a
   chprintf(stream, "    Test the front battery fuel gauge and charger.\n");
   chprintf(stream, "  --rear, -r\n");
   chprintf(stream, "    Test the rear battery fuel gauge and charger.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_bq27500bq241xxdata_t _utAlldBq27500Bq24103aData= {
   /* bq27500 driver   */ NULL,
@@ -989,7 +989,7 @@ static int _utShellCmdCb_AlldIna219(BaseSequentialStream* stream, int argc, char
   chprintf(stream, "    Test VSYS 4.2V power monitor.\n");
   chprintf(stream, "  VIO5.0\n");
   chprintf(stream, "    Test VIO 5.0V power monitor.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_ina219data_t _utAlldIna219Data = {
   /* driver           */ NULL,
@@ -1165,7 +1165,7 @@ static int _utShellCmdCb_AlldPca5944a(BaseSequentialStream* stream, int argc, ch
   chprintf(stream, "    Test the multiplexer on the I2C bus #1.\n");
   chprintf(stream, "  #2\n");
   chprintf(stream, "    Test the multiplexer on the I2C bus #2.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_pca9544adata_t _utAlldPca9544aData = {
   /* driver   */ NULL,
@@ -1311,7 +1311,7 @@ static int _utShellCmdCb_AlldVcnl4020(BaseSequentialStream* stream, int argc, ch
   chprintf(stream, "    Test west-northwest sensor.\n");
   chprintf(stream, "  -nnw\n");
   chprintf(stream, "    Test north-northwest sensor.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_vcnl4020data_t _utAlldVcnl4020Data = {
   /* driver       */ NULL,
@@ -1362,7 +1362,7 @@ static int _utShellCmdCb_AlldPcal6524(BaseSequentialStream* stream, int argc, ch
   chprintf(stream, "    Test the GPIO extender on the I2C bus #1.\n");
   chprintf(stream, "  #2\n");
   chprintf(stream, "    Test the GPIO extender on the I2C bus #2.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_pcal6524data_t _utAlldPcal6524Data = {
   /* driver   */ NULL,
@@ -1439,7 +1439,7 @@ static int _utShellCmdCb_AlldPcal6524(BaseSequentialStream* stream, int argc, ch
   chprintf(stream, "    Test the GPIO extender on the I2C bus #1.\n");
   chprintf(stream, "  #2\n");
   chprintf(stream, "    Test the GPIO extender on the I2C bus #2.\n");
-  return AOS_INVALID_ARGUMENTS;
+  return AOS_INVALIDARGUMENTS;
 }
 static ut_pcal6524data_t _utAlldPcal6524Data = {
   /* driver   */ NULL,
