Skip to content

Commit b5a2342

Browse files
authored
Merge pull request #5 from jmchiappa/common-resources-conflict
fix issue when instantiating 2 differents ToF
2 parents 8805451 + f18bfc7 commit b5a2342

7 files changed

+19
-17
lines changed

src/vl53l7cx_api.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545

4646

47-
#include "platform.h"
47+
#include "vl53l7cx_platform.h"
4848

4949
/**
5050
* @brief Current driver version.
@@ -378,7 +378,8 @@ typedef struct {
378378

379379
} VL53L7CX_ResultsData;
380380

381-
381+
#ifndef BLOCK_HEADER
382+
#define BLOCK_HEADER
382383
union Block_header {
383384
uint32_t bytes;
384385
struct {
@@ -387,5 +388,6 @@ union Block_header {
387388
uint32_t idx : 16;
388389
};
389390
};
391+
#endif
390392

391393
#endif //VL53L7CX_API_H_

src/vl53l7cx_buffers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#ifndef VL53L7CX_BUFFERS_H_
4040
#define VL53L7CX_BUFFERS_H_
4141

42-
#include "platform.h"
42+
#include "vl53l7cx_platform.h"
4343

4444
/**
4545
* @brief Inner internal number of targets.

src/vl53l7cx_class.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
/* Includes ------------------------------------------------------------------*/
4242
#include "Arduino.h"
43-
#include "platform.h"
43+
#include "vl53l7cx_platform.h"
4444
#include "vl53l7cx_api.h"
4545
#include "vl53l7cx_plugin_detection_thresholds.h"
4646
#include "vl53l7cx_plugin_motion_indicator.h"
File renamed without changes.

src/platform.h renamed to src/vl53l7cx_platform.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
******************************************************************************
3636
*/
3737

38-
#ifndef _PLATFORM_H_
39-
#define _PLATFORM_H_
38+
#ifndef _VL53L7_PLATFORM_H_
39+
#define _VL53L7_PLATFORM_H_
4040
#pragma once
4141

4242
#include <stdint.h>
4343
#include <string.h>
4444
#include <Arduino.h>
4545
#include <Wire.h>
46-
#include "platform_config.h"
46+
#include "vl53l7cx_platform_config.h"
4747

4848

4949
#ifndef DEFAULT_I2C_BUFFER_LEN
@@ -78,4 +78,4 @@ typedef struct {
7878

7979
} VL53L7CX_Platform;
8080

81-
#endif // _PLATFORM_H_
81+
#endif // _VL53L7_PLATFORM_H_

src/platform_config.h renamed to src/vl53l7cx_platform_config.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@
3535
******************************************************************************
3636
*/
3737

38-
#ifndef _PLATFORM_CONFIG_H_
39-
#define _PLATFORM_CONFIG_H_
38+
#ifndef _VL53L7CX_PLATFORM_CONFIG_H_
39+
#define _VL53L7CX_PLATFORM_CONFIG_H_
4040

41-
#if __has_include("platform_config_custom.h")
42-
#include "platform_config_custom.h"
41+
#if __has_include("vl53l7cx_platform_config_custom.h")
42+
#include "vl53l7cx_platform_config_custom.h"
4343
#else
44-
#include "platform_config_default.h"
44+
#include "vl53l7cx_platform_config_default.h"
4545
#endif
4646

47-
#endif // _PLATFORM_CONFIG_H_
47+
#endif // _VL53L7CX_PLATFORM_CONFIG_H_

src/platform_config_default.h renamed to src/vl53l7cx_platform_config_default.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
******************************************************************************
3636
*/
3737

38-
#ifndef _PLATFORM_CONFIG_DEFAULT_H_
39-
#define _PLATFORM_CONFIG_DEFAULT_H_
38+
#ifndef _VL53L7CX_PLATFORM_CONFIG_DEFAULT_H_
39+
#define _VL53L7CX_PLATFORM_CONFIG_DEFAULT_H_
4040

4141
/*
4242
* @brief If you want to customize these defines you can add in the application
@@ -80,4 +80,4 @@
8080
// #define VL53L7CX_DISABLE_TARGET_STATUS
8181
// #define VL53L7CX_DISABLE_MOTION_INDICATOR
8282

83-
#endif // _PLATFORM_CONFIG_DEFAULT_H_
83+
#endif // _VL53L7CX_PLATFORM_CONFIG_DEFAULT_H_

0 commit comments

Comments
 (0)