From 78078b3f288d49ca645c057172079a96a3f455f5 Mon Sep 17 00:00:00 2001
From: Alexandre Abadie <alexandre.abadie@inria.fr>
Date: Wed, 21 Feb 2018 10:24:19 +0100
Subject: [PATCH] drivers/saul: add UV and distance sense options

---
 drivers/include/saul.h  |  1 +
 drivers/saul/saul_str.c | 46 +++++++++++++++++++++--------------------
 2 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/drivers/include/saul.h b/drivers/include/saul.h
index 832f4f3854..6db0fa45b7 100644
--- a/drivers/include/saul.h
+++ b/drivers/include/saul.h
@@ -93,6 +93,7 @@ enum {
     SAUL_SENSE_UV       = 0x8b,     /**< sensor: UV index */
     SAUL_SENSE_OBJTEMP  = 0x8c,     /**< sensor: object temperature */
     SAUL_SENSE_COUNT    = 0x8d,     /**< sensor: pulse counter */
+    SAUL_SENSE_DISTANCE = 0x8e,     /**< sensor: distance */
     SAUL_CLASS_ANY      = 0xff      /**< any device - wildcard */
     /* extend this list as needed... */
 };
diff --git a/drivers/saul/saul_str.c b/drivers/saul/saul_str.c
index 500a7f7ac9..fafc7aba74 100644
--- a/drivers/saul/saul_str.c
+++ b/drivers/saul/saul_str.c
@@ -29,27 +29,29 @@
 const char *saul_class_to_str(const uint8_t class_id)
 {
     switch (class_id) {
-        case SAUL_CLASS_UNDEF:  return "CLASS_UNDEF";
-        case SAUL_ACT_ANY:      return "ACT_ANY";
-        case SAUL_ACT_LED_RGB:  return "ACT_LED_RGB";
-        case SAUL_ACT_SERVO:    return "ACT_SERVO";
-        case SAUL_ACT_MOTOR:    return "ACT_MOTOR";
-        case SAUL_ACT_SWITCH:   return "ACT_SWITCH";
-        case SAUL_ACT_DIMMER:   return "ACT_DIMMER";
-        case SAUL_SENSE_ANY:    return "SENSE_ANY";
-        case SAUL_SENSE_BTN:    return "SENSE_BTN";
-        case SAUL_SENSE_TEMP:   return "SENSE_TEMP";
-        case SAUL_SENSE_HUM:    return "SENSE_HUM";
-        case SAUL_SENSE_LIGHT:  return "SENSE_LIGHT";
-        case SAUL_SENSE_ACCEL:  return "SENSE_ACCEL";
-        case SAUL_SENSE_MAG:    return "SENSE_MAG";
-        case SAUL_SENSE_GYRO:   return "SENSE_GYRO";
-        case SAUL_SENSE_COLOR:  return "SENSE_COLOR";
-        case SAUL_SENSE_PRESS:  return "SENSE_PRESS";
-        case SAUL_SENSE_ANALOG: return "SENSE_ANALOG";
-        case SAUL_SENSE_OBJTEMP:return "SENSE_OBJTEMP";
-        case SAUL_SENSE_COUNT:  return "SENSE_PULSE_COUNT";
-        case SAUL_CLASS_ANY:    return "CLASS_ANY";
-        default:                return "CLASS_UNKNOWN";
+        case SAUL_CLASS_UNDEF:     return "CLASS_UNDEF";
+        case SAUL_ACT_ANY:         return "ACT_ANY";
+        case SAUL_ACT_LED_RGB:     return "ACT_LED_RGB";
+        case SAUL_ACT_SERVO:       return "ACT_SERVO";
+        case SAUL_ACT_MOTOR:       return "ACT_MOTOR";
+        case SAUL_ACT_SWITCH:      return "ACT_SWITCH";
+        case SAUL_ACT_DIMMER:      return "ACT_DIMMER";
+        case SAUL_SENSE_ANY:       return "SENSE_ANY";
+        case SAUL_SENSE_BTN:       return "SENSE_BTN";
+        case SAUL_SENSE_TEMP:      return "SENSE_TEMP";
+        case SAUL_SENSE_HUM:       return "SENSE_HUM";
+        case SAUL_SENSE_LIGHT:     return "SENSE_LIGHT";
+        case SAUL_SENSE_ACCEL:     return "SENSE_ACCEL";
+        case SAUL_SENSE_MAG:       return "SENSE_MAG";
+        case SAUL_SENSE_GYRO:      return "SENSE_GYRO";
+        case SAUL_SENSE_COLOR:     return "SENSE_COLOR";
+        case SAUL_SENSE_PRESS:     return "SENSE_PRESS";
+        case SAUL_SENSE_ANALOG:    return "SENSE_ANALOG";
+        case SAUL_SENSE_UV:        return "SENSE_UV";
+        case SAUL_SENSE_OBJTEMP:   return "SENSE_OBJTEMP";
+        case SAUL_SENSE_COUNT:     return "SENSE_PULSE_COUNT";
+        case SAUL_SENSE_DISTANCE:  return "SENSE_DISTANCE";
+        case SAUL_CLASS_ANY:       return "CLASS_ANY";
+        default:                   return "CLASS_UNKNOWN";
     }
 }
-- 
GitLab