Skip to content

fix issue when instantiating 2 differents ToF #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,12 @@ extern "C" {
#define VL53L8CX_COMMS_CHUNK_SIZE 4096
#define SPI_WRITE_MASK(x) (uint16_t)(x | 0x8000)
#define SPI_READ_MASK(x) (uint16_t)(x & ~0x8000)
#ifndef DEFAULT_I2C_BUFFER_LEN




typedef uint8_t (*VL53L8CX_wait_Func)(void *, uint32_t);
typedef uint8_t (*VL53L8CX_write_Func)(void *, uint16_t, uint8_t *, uint32_t);
typedef uint8_t (*VL53L8CX_read_Func)(void *, uint16_t, uint8_t *, uint32_t);


#ifndef DEFAULT_I2C_BUFFER_LEN
#ifdef ARDUINO_SAM_DUE
/* FIXME: It seems that an I2C buffer of BUFFER_LENGTH does not work on Arduino DUE. So, we need to decrease the size */
#define DEFAULT_I2C_BUFFER_LEN (BUFFER_LENGTH - 2)
Expand Down
4 changes: 3 additions & 1 deletion src/vl53l8cx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ typedef struct {

} VL53L8CX_ResultsData;


#ifndef BLOCK_HEADER
#define BLOCK_HEADER
union Block_header {
uint32_t bytes;
struct {
Expand All @@ -379,6 +380,7 @@ union Block_header {
uint32_t idx : 16;
};
};
#endif

uint8_t vl53l8cx_is_alive(
VL53L8CX_Configuration *p_dev,
Expand Down