ST Expansion SW Team / Mbed 2 deprecated HelloWorld_53L1A1_Polling_All

Dependencies:   mbed X_NUCLEO_53L1A1_mbed

Revision:
21:769dbb594f88
Parent:
20:639c4cbcfad9
--- a/main.cpp	Thu May 23 12:09:59 2019 +0000
+++ b/main.cpp	Wed Jul 24 10:44:06 2019 +0000
@@ -30,13 +30,13 @@
 
 #include "mbed.h"
 #include "XNucleo53L1A1.h"
-#include "vl53L1x_I2c.h"
+#include "VL53L1X_I2C.h"
 
 #define VL53L1_I2C_SDA   D14
 #define VL53L1_I2C_SCL   D15
 
 static XNucleo53L1A1 *board=NULL;
-Serial pc(SERIAL_TX, SERIAL_RX);
+//Serial pc(SERIAL_TX, SERIAL_RX);
 
 volatile bool polling_stop = false;
 
@@ -50,8 +50,8 @@
 int main()
 {
 #if USER_BUTTON==PC_13  // we are cross compiling for Nucleo-f401
-    InterruptIn stop_button(USER_BUTTON);
-    stop_button.rise(&stop_polling);
+//    InterruptIn stop_button(USER_BUTTON);
+//    stop_button.rise(&stop_polling);
 #endif
     int status = 0;
     uint8_t ready_centre = 0;
@@ -63,7 +63,7 @@
 
     printf("Hello world!\r\n");
 
-    vl53L1X_DevI2C *dev_I2C = new vl53L1X_DevI2C(VL53L1_I2C_SDA, VL53L1_I2C_SCL);
+    VL53L1X_DevI2C *dev_I2C = new VL53L1X_DevI2C(VL53L1_I2C_SDA, VL53L1_I2C_SCL);
 
     printf("I2C device created!\r\n");
 
@@ -82,7 +82,7 @@
 
     /* Start ranging on the centre sensor */
     if (board->sensor_centre != NULL) {
-        status = board->sensor_centre->VL53L1X_StartRanging();
+        status = board->sensor_centre->vl53l1x_start_ranging();
         if (status != 0) {
             printf("Centre sensor failed to start ranging!\r\n");
             return status;
@@ -91,7 +91,7 @@
 
     /* Start ranging on the left sensor */
     if (board->sensor_left != NULL) {
-        status = board->sensor_left->VL53L1X_StartRanging();
+        status = board->sensor_left->vl53l1x_start_ranging();
         if (status != 0) {
             printf("Left sensor failed to start ranging!\r\n");
             return status;
@@ -100,7 +100,7 @@
 
     /* Start ranging on the right sensor */
     if (board->sensor_right != NULL) {
-        status = board->sensor_right->VL53L1X_StartRanging();
+        status = board->sensor_right->vl53l1x_start_ranging();
         if (status != 0) {
             printf("Right sensor failed to start ranging!\r\n");
             return status;
@@ -118,25 +118,25 @@
             break;
         }
         if (board->sensor_centre != NULL) {
-            board->sensor_centre->VL53L1X_CheckForDataReady(&ready_centre);
+            board->sensor_centre->vl53l1x_check_for_data_ready(&ready_centre);
         }
         if (board->sensor_left != NULL) {
-            board->sensor_left->VL53L1X_CheckForDataReady(&ready_left);
+            board->sensor_left->vl53l1x_check_for_data_ready(&ready_left);
         }
         if (board->sensor_right != NULL) {
-            board->sensor_right->VL53L1X_CheckForDataReady(&ready_right);
+            board->sensor_right->vl53l1x_check_for_data_ready(&ready_right);
         }
         if (ready_centre) {
-            board->sensor_centre->VL53L1X_GetRangeStatus(&ready_centre);
-            board->sensor_centre->VL53L1X_GetDistance(&distance_centre);
+            board->sensor_centre->vl53l1x_get_range_status(&ready_centre);
+            board->sensor_centre->vl53l1x_get_distance(&distance_centre);
         }
         if (ready_left) {
-            board->sensor_left->VL53L1X_GetRangeStatus(&ready_left);
-            board->sensor_left->VL53L1X_GetDistance(&distance_left);
+            board->sensor_left->vl53l1x_get_range_status(&ready_left);
+            board->sensor_left->vl53l1x_get_distance(&distance_left);
         }
         if (ready_right) {
-            board->sensor_right->VL53L1X_GetRangeStatus(&ready_right);
-            board->sensor_right->VL53L1X_GetDistance(&distance_right);
+            board->sensor_right->vl53l1x_get_range_status(&ready_right);
+            board->sensor_right->vl53l1x_get_distance(&distance_right);
         }
 
         if (board->sensor_centre != NULL) {