diff --git a/src/platform.h b/src/platform.h index 29b3729..9204303 100644 --- a/src/platform.h +++ b/src/platform.h @@ -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) diff --git a/src/vl53l8cx_api.h b/src/vl53l8cx_api.h index db173c3..28ed61d 100644 --- a/src/vl53l8cx_api.h +++ b/src/vl53l8cx_api.h @@ -370,7 +370,8 @@ typedef struct { } VL53L8CX_ResultsData; - +#ifndef BLOCK_HEADER +#define BLOCK_HEADER union Block_header { uint32_t bytes; struct { @@ -379,6 +380,7 @@ union Block_header { uint32_t idx : 16; }; }; +#endif uint8_t vl53l8cx_is_alive( VL53L8CX_Configuration *p_dev,