Skip to content

fix issue when instantiating 2 differents ToF #5

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: 4 additions & 2 deletions src/vl53l7cx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@



#include "platform.h"
#include "vl53l7cx_platform.h"

/**
* @brief Current driver version.
Expand Down Expand Up @@ -378,7 +378,8 @@ typedef struct {

} VL53L7CX_ResultsData;


#ifndef BLOCK_HEADER
#define BLOCK_HEADER
union Block_header {
uint32_t bytes;
struct {
Expand All @@ -387,5 +388,6 @@ union Block_header {
uint32_t idx : 16;
};
};
#endif

#endif //VL53L7CX_API_H_
2 changes: 1 addition & 1 deletion src/vl53l7cx_buffers.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#ifndef VL53L7CX_BUFFERS_H_
#define VL53L7CX_BUFFERS_H_

#include "platform.h"
#include "vl53l7cx_platform.h"

/**
* @brief Inner internal number of targets.
Expand Down
2 changes: 1 addition & 1 deletion src/vl53l7cx_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

/* Includes ------------------------------------------------------------------*/
#include "Arduino.h"
#include "platform.h"
#include "vl53l7cx_platform.h"
#include "vl53l7cx_api.h"
#include "vl53l7cx_plugin_detection_thresholds.h"
#include "vl53l7cx_plugin_motion_indicator.h"
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/platform.h → src/vl53l7cx_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
******************************************************************************
*/

#ifndef _PLATFORM_H_
#define _PLATFORM_H_
#ifndef _VL53L7_PLATFORM_H_
#define _VL53L7_PLATFORM_H_
#pragma once

#include <stdint.h>
#include <string.h>
#include <Arduino.h>
#include <Wire.h>
#include "platform_config.h"
#include "vl53l7cx_platform_config.h"


#ifndef DEFAULT_I2C_BUFFER_LEN
Expand Down Expand Up @@ -78,4 +78,4 @@ typedef struct {

} VL53L7CX_Platform;

#endif // _PLATFORM_H_
#endif // _VL53L7_PLATFORM_H_
12 changes: 6 additions & 6 deletions src/platform_config.h → src/vl53l7cx_platform_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
******************************************************************************
*/

#ifndef _PLATFORM_CONFIG_H_
#define _PLATFORM_CONFIG_H_
#ifndef _VL53L7CX_PLATFORM_CONFIG_H_
#define _VL53L7CX_PLATFORM_CONFIG_H_

#if __has_include("platform_config_custom.h")
#include "platform_config_custom.h"
#if __has_include("vl53l7cx_platform_config_custom.h")
#include "vl53l7cx_platform_config_custom.h"
#else
#include "platform_config_default.h"
#include "vl53l7cx_platform_config_default.h"
#endif

#endif // _PLATFORM_CONFIG_H_
#endif // _VL53L7CX_PLATFORM_CONFIG_H_
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
******************************************************************************
*/

#ifndef _PLATFORM_CONFIG_DEFAULT_H_
#define _PLATFORM_CONFIG_DEFAULT_H_
#ifndef _VL53L7CX_PLATFORM_CONFIG_DEFAULT_H_
#define _VL53L7CX_PLATFORM_CONFIG_DEFAULT_H_

/*
* @brief If you want to customize these defines you can add in the application
Expand Down Expand Up @@ -80,4 +80,4 @@
// #define VL53L7CX_DISABLE_TARGET_STATUS
// #define VL53L7CX_DISABLE_MOTION_INDICATOR

#endif // _PLATFORM_CONFIG_DEFAULT_H_
#endif // _VL53L7CX_PLATFORM_CONFIG_DEFAULT_H_