INSAT Mini Project

Dependencies:   ST_INTERFACES X_NUCLEO_COMMON

Fork of X_NUCLEO_6180XA1 by ST

Revision:
54:17f3bb228b13
Parent:
51:229ea522cff8
Child:
55:a37f407230ca
--- a/Components/VL6180X/vl6180x_class.cpp	Tue Sep 27 12:18:09 2016 +0000
+++ b/Components/VL6180X/vl6180x_class.cpp	Wed Nov 30 08:25:04 2016 +0000
@@ -979,7 +979,7 @@
     return status;
 }
  
-int VL6180X::VL6180x_RangeGetResult(VL6180xDev_t dev, int32_t *pRange_mm) {
+int VL6180X::VL6180x_RangeGetResult(VL6180xDev_t dev, uint32_t *pRange_mm) {
     int status;
     uint8_t RawRange;
     int32_t Upscale;
@@ -2734,6 +2734,7 @@
            return (r_status|l_status);
                  
       case(range_continuous_interrupt):
+        if (gpio1Int==NULL) return 1;
         r_status=VL6180x_RangeConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_NEW_SAMPLE_READY);
         l_status=VL6180x_AlsConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_DISABLED);
         if((!r_status)&&(!l_status))
@@ -2742,6 +2743,7 @@
            return (r_status|l_status);
                      
       case(als_continuous_interrupt):
+        if (gpio1Int==NULL) return 1;      
         l_status=VL6180x_AlsConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_NEW_SAMPLE_READY);
         r_status=VL6180x_RangeConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_DISABLED);
         if((!r_status)&&(!l_status))
@@ -2750,6 +2752,7 @@
            return (r_status|l_status);
  
       case(interleaved_mode_interrupt):
+        if (gpio1Int==NULL) return 1;      
         l_status=VL6180x_AlsConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_NEW_SAMPLE_READY);
         r_status=VL6180x_RangeConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_DISABLED);            
         if((!r_status)&&(!l_status))
@@ -2842,6 +2845,7 @@
            return (r_status|l_status);
                 
       case(range_continuous_interrupt_low_threshold):
+        if (gpio1Int==NULL) return 1;      
         r_status=VL6180x_RangeConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_LEVEL_LOW);
         l_status=VL6180x_AlsConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_DISABLED);
         if((!r_status)&&(!l_status))
@@ -2855,7 +2859,8 @@
         else
            return (r_status|l_status);                  
             
-      case(range_continuous_interrupt_high_threshold):   
+      case(range_continuous_interrupt_high_threshold): 
+        if (gpio1Int==NULL) return 1;        
         r_status=VL6180x_RangeConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_LEVEL_HIGH);
         l_status=VL6180x_AlsConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_DISABLED);
         if((!r_status)&&(!l_status))
@@ -2870,6 +2875,7 @@
            return (r_status|l_status);
                 
        case(range_continuous_interrupt_out_of_window):
+        if (gpio1Int==NULL) return 1;       
         r_status=VL6180x_RangeConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_OUT_OF_WINDOW);
         l_status=VL6180x_AlsConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_DISABLED);
         if((!r_status)&&(!l_status))
@@ -2884,6 +2890,7 @@
            return (r_status|l_status);
             
       case(als_continuous_interrupt_low_threshold):
+        if (gpio1Int==NULL) return 1;      
         l_status=VL6180x_AlsConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_LEVEL_LOW);
         r_status=VL6180x_RangeConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_DISABLED);
         if((!r_status)&&(!l_status))
@@ -2898,6 +2905,7 @@
            return (r_status|l_status);  
                 
       case(als_continuous_interrupt_high_threshold):
+        if (gpio1Int==NULL) return 1;      
         l_status=VL6180x_AlsConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_LEVEL_HIGH);
         r_status=VL6180x_RangeConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_DISABLED);
         if((!r_status)&&(!l_status))
@@ -2912,6 +2920,7 @@
            return (r_status|l_status);
                 
       case(als_continuous_interrupt_out_of_window):
+        if (gpio1Int==NULL) return 1;      
         l_status=VL6180x_AlsConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_OUT_OF_WINDOW);
         r_status=VL6180x_RangeConfigInterrupt(Device, CONFIG_GPIO_INTERRUPT_DISABLED);
         if((!r_status)&&(!l_status))