From e2e37049738656649b4ff5e99a599ac0fbfee4a9 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Sun, 5 Jun 2016 16:38:32 +0200 Subject: [PATCH] sys/phydat: adding illuminance unit (Lux) --- sys/include/phydat.h | 2 ++ sys/phydat/phydat_str.c | 1 + 2 files changed, 3 insertions(+) diff --git a/sys/include/phydat.h b/sys/include/phydat.h index 7a1568a0cc..0a8162c550 100644 --- a/sys/include/phydat.h +++ b/sys/include/phydat.h @@ -79,6 +79,8 @@ enum { UNIT_TEMP_C, /**< degree Celsius */ UNIT_TEMP_F, /**< degree Fahrenheit */ UNIT_TEMP_K, /**< Kelvin */ + /* illuminance */ + UNIT_LUX, /**< Lux (lx) */ /* dimension */ UNIT_M, /**< meters */ UNIT_M2, /**< square meters */ diff --git a/sys/phydat/phydat_str.c b/sys/phydat/phydat_str.c index 431c60361c..7adb4fe6bf 100644 --- a/sys/phydat/phydat_str.c +++ b/sys/phydat/phydat_str.c @@ -62,6 +62,7 @@ const char *phydat_unit_to_str(uint8_t unit) case UNIT_TEMP_C: return "°C"; case UNIT_TEMP_F: return "°F"; case UNIT_TEMP_K: return "K"; + case UNIT_LUX: return "lx"; case UNIT_M: return "m"; case UNIT_G: return "g"; case UNIT_DPS: return "dps";