Skip to content

Commit f63e840

Browse files
committed
fixup! [driver] Add vl53l5, vl53l7, vl53l8 drivers
1 parent 4aed1f8 commit f63e840

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

ext/vl53/vl53.hpp renamed to ext/vl53/vl53.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
// ----------------------------------------------------------------------------
1111

12-
#include <modm/platform.hpp>
12+
#include <modm/processing/fiber.hpp>
1313

1414
#include "vl53_transport.hpp"
1515

@@ -52,13 +52,12 @@ VL53_SwapBuffer(uint8_t *buffer, uint16_t size)
5252
for (i = 0; i < size; i = i + 4)
5353
{
5454
tmp = (buffer[i] << 24) | (buffer[i + 1] << 16) | (buffer[i + 2] << 8) | (buffer[i + 3]);
55-
5655
memcpy(&(buffer[i]), &tmp, 4);
5756
}
5857
}
5958

6059
uint8_t
61-
VL53_WaitMs(VL53_Platform *p_platform, uint32_t TimeMs)
60+
VL53_WaitMs(VL53_Platform*, uint32_t TimeMs)
6261
{
6362
modm::this_fiber::sleep_for(std::chrono::milliseconds(TimeMs));
6463
return 0;
@@ -70,4 +69,4 @@ VL53_Reset_Sensor(VL53_Platform *p_platform)
7069
auto *iface = static_cast<modm::Vl53TransportBase *>(p_platform->transport);
7170
return iface->resetSensor();
7271
}
73-
}
72+
}

ext/vl53/vl53.lb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class Vl53l5cx(Module):
2323
env.copy("vl53/vl53l5cx/src")
2424
env.copy("vl53/vl53l5cx/inc")
2525
env.copy("vl53/vl53l5cx/LICENSE.txt")
26-
env.collect(":build:path.include", "modm/src/modm/driver/vl53")
2726
env.collect(":build:path.include", "modm/ext/vl53/vl53l5cx/inc")
2827

2928
class Vl53lmz(Module):
@@ -39,7 +38,6 @@ class Vl53lmz(Module):
3938
env.copy("vl53/vl53lmz/src")
4039
env.copy("vl53/vl53lmz/inc")
4140
env.copy("vl53/vl53lmz/LICENSE.txt")
42-
env.collect(":build:path.include", "modm/src/modm/driver/vl53")
4341
env.collect(":build:path.include", "modm/ext/vl53/vl53lmz/inc")
4442

4543
def init(module):
@@ -63,7 +61,10 @@ def prepare(module, options):
6361

6462
def build(env):
6563
env.outbasepath = "modm/src/modm/driver/vl53"
66-
env.copy("vl53.hpp")
64+
env.copy("vl53.cpp")
6765
env.copy("vl53_transport.hpp")
6866
env.copy("vl53_transport_impl.hpp")
69-
env.copy("vl53_platform.h")
67+
68+
env.outbasepath = "modm/ext/vl53"
69+
env.collect(":build:path.include", "modm/ext/vl53")
70+
env.copy("vl53_platform.h")

ext/vl53/vl53_transport.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@
1212
#ifndef MODM_VL53_TRANSPORT_HPP
1313
#define MODM_VL53_TRANSPORT_HPP
1414

15-
#include <array>
1615
#include <cstdint>
1716
#include <modm/architecture/interface/delay.hpp>
1817
#include <modm/architecture/interface/i2c_device.hpp>
1918
#include <modm/architecture/interface/spi_device.hpp>
2019
#include <modm/driver/storage/i2c_eeprom.hpp>
2120
#include <modm/processing/fiber.hpp>
22-
#include <optional>
23-
#include <span>
2421

2522
namespace modm
2623
{
@@ -128,4 +125,4 @@ class Vl53I2cTransport : public I2cEeprom<I2cMaster, 2>, public Vl53TransportBas
128125

129126
#include "vl53_transport_impl.hpp"
130127

131-
#endif
128+
#endif

0 commit comments

Comments
 (0)