From 61dc1920d3095c874ff55dbb6f56159cb4131c3a Mon Sep 17 00:00:00 2001
From: Michel Rottleuthner <michel.rottleuthner@haw-hamburg.de>
Date: Thu, 22 Nov 2018 19:14:20 +0100
Subject: [PATCH] sys/phydat: add unit for mass concentration (g/m^3)

---
 sys/include/phydat.h    | 4 +++-
 sys/phydat/phydat_str.c | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/sys/include/phydat.h b/sys/include/phydat.h
index 8a4e161f18..e57a517c54 100644
--- a/sys/include/phydat.h
+++ b/sys/include/phydat.h
@@ -110,7 +110,9 @@ enum {
     UNIT_PPB,       /**< part per billion */
     /* aggregate values */
     UNIT_TIME,      /**< the three dimensions contain sec, min, and hours */
-    UNIT_DATE       /**< the 3 dimensions contain days, months and years */
+    UNIT_DATE,      /**< the 3 dimensions contain days, months and years */
+    /* mass concentration */
+    UNIT_GPM3       /**< grams per cubic meters */
     /* extend this list as needed */
 };
 
diff --git a/sys/phydat/phydat_str.c b/sys/phydat/phydat_str.c
index 27916b31be..f450c9aa65 100644
--- a/sys/phydat/phydat_str.c
+++ b/sys/phydat/phydat_str.c
@@ -102,6 +102,7 @@ const char *phydat_unit_to_str(uint8_t unit)
         case UNIT_PERCENT:  return "%";
         case UNIT_CTS:      return "cts";
         case UNIT_COULOMB:  return "C";
+        case UNIT_GPM3:     return "g/m^3";
         default:            return "";
     }
 }
-- 
GitLab