Skip to content

Commit b6a79c5

Browse files
authored
Merge pull request #13 from jmchiappa/common-resources-conflict
fix issue when instantiating 2 differents ToF
2 parents 3535c7d + 45dc970 commit b6a79c5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/platform.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,12 @@ extern "C" {
5252
#define VL53L8CX_COMMS_CHUNK_SIZE 4096
5353
#define SPI_WRITE_MASK(x) (uint16_t)(x | 0x8000)
5454
#define SPI_READ_MASK(x) (uint16_t)(x & ~0x8000)
55-
#ifndef DEFAULT_I2C_BUFFER_LEN
56-
57-
58-
5955

6056
typedef uint8_t (*VL53L8CX_wait_Func)(void *, uint32_t);
6157
typedef uint8_t (*VL53L8CX_write_Func)(void *, uint16_t, uint8_t *, uint32_t);
6258
typedef uint8_t (*VL53L8CX_read_Func)(void *, uint16_t, uint8_t *, uint32_t);
6359

64-
60+
#ifndef DEFAULT_I2C_BUFFER_LEN
6561
#ifdef ARDUINO_SAM_DUE
6662
/* FIXME: It seems that an I2C buffer of BUFFER_LENGTH does not work on Arduino DUE. So, we need to decrease the size */
6763
#define DEFAULT_I2C_BUFFER_LEN (BUFFER_LENGTH - 2)

src/vl53l8cx_api.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,8 @@ typedef struct {
370370

371371
} VL53L8CX_ResultsData;
372372

373-
373+
#ifndef BLOCK_HEADER
374+
#define BLOCK_HEADER
374375
union Block_header {
375376
uint32_t bytes;
376377
struct {
@@ -379,6 +380,7 @@ union Block_header {
379380
uint32_t idx : 16;
380381
};
381382
};
383+
#endif
382384

383385
uint8_t vl53l8cx_is_alive(
384386
VL53L8CX_Configuration *p_dev,

0 commit comments

Comments
 (0)