[VL53L1X] Move includes to .cpp for linker to leave out unused code

This commit is contained in:
TD-er
2026-08-20 12:55:41 +02:00
parent 27048f5a8f
commit 19806006ff
4 changed files with 15 additions and 9 deletions
@@ -33,6 +33,12 @@
#include <stdlib.h>
#include "SparkFun_VL53L1X.h"
#include "st_src/RangeSensor.h"
#include "st_src/vl53l1_error_codes.h"
#include "st_src/ComponentObject.h"
#include "st_src/RangeSensor.h"
SFEVL53L1X::SFEVL53L1X()
{
_i2cPort = &Wire;
+1 -5
View File
@@ -33,12 +33,8 @@
#pragma once
#include "Arduino.h"
#include "Wire.h"
#include "st_src/RangeSensor.h"
#include "st_src/vl53l1_error_codes.h"
#include "st_src/vl53l1x_class.h"
#include "st_src/ComponentObject.h"
#include "st_src/RangeSensor.h"
#define DISTANCE_SHORT 1
#define DISTANCE_LONG 2
@@ -2,6 +2,13 @@
#ifdef USES_P113
# if P113_USE_ROI
# include "../Static/WebStaticData.h" // Javascript and support functions
# endif // if P113_USE_ROI
# include <SparkFun_VL53L1X.h>
P113_data_struct::P113_data_struct(uint8_t i2c_addr, int timing, bool range) : i2cAddress(i2c_addr), timing(timing), range(range) {
sensor = new (std::nothrow) SFEVL53L1X();
}
+1 -4
View File
@@ -23,11 +23,8 @@
# endif // if defined(LIMIT_BUILD_SIZE) && defined(ESP8266)
# endif // ifndef P113_USE_ROI
# include <SparkFun_VL53L1X.h>
class SFEVL53L1X; // Forward declaration
# if P113_USE_ROI
# include "../Static/WebStaticData.h" // Javascript and support functions
# endif // if P113_USE_ROI
# define P113_I2C_ADDRESS PCONFIG(0)
# define P113_TIMING PCONFIG(1)