Skip to content

Commit b24a4ac

Browse files
committed
[driver] Added vl53 ext submodule
1 parent d158a25 commit b24a4ac

File tree

9 files changed

+20
-12
lines changed

9 files changed

+20
-12
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,6 @@
5252
[submodule "ext/segger/rtt"]
5353
path = ext/segger/rtt
5454
url = https://github.com/modm-ext/segger-rtt.git
55+
[submodule "ext/vl53/vl53"]
56+
path = ext/vl53/vl53
57+
url = https://github.com/modm-ext/vl53-partial.git

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,6 @@ your specific needs.
872872
<td align="center"><a href="https://modm.io/reference/module/modm-driver-touch2046">TOUCH2046</a></td>
873873
<td align="center"><a href="https://modm.io/reference/module/modm-driver-vl53l0">VL53L0</a></td>
874874
</tr><tr>
875-
<td align="center"><a href="https://modm.io/reference/module/modm-vl53-vl53l5cx">VL53L5CX</a></td>
876-
<td align="center"><a href="https://modm.io/reference/module/modm-vl53-vl53lmz">VL53L7/VL53L8</a></td>
877875
<td align="center"><a href="https://modm.io/reference/module/modm-driver-vl6180">VL6180</a></td>
878876
<td align="center"><a href="https://modm.io/reference/module/modm-driver-ws2812">WS2812</a></td>
879877
</tr>

examples/nucleo_h723zg/vl53/vl53l5cx_i2c/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
// ----------------------------------------------------------------------------
1111

1212
#include <modm/board.hpp>
13-
#include <modm/ext/vl53/vl53.hpp>
14-
#include <modm/ext/vl53/vl53_transport.hpp>
1513

1614
// Tested with VL53L5CX-SATEL
1715
extern "C" {
@@ -21,6 +19,9 @@ extern "C" {
2119
#include <vl53/vl53l5cx/examples/Example_5_multiple_targets_per_zone.h>
2220
}
2321

22+
#include <modm/driver/vl53/vl53.hpp>
23+
#include <modm/driver/vl53/vl53_transport.hpp>
24+
2425
using namespace Board;
2526

2627
using I2c = I2cMaster1;

examples/nucleo_h723zg/vl53/vl53l7_vl53l8_i2c/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
// ----------------------------------------------------------------------------
1111

1212
#include <modm/board.hpp>
13-
#include <modm/ext/vl53/vl53.hpp>
14-
#include <modm/ext/vl53/vl53_transport.hpp>
1513

1614
// Tested with MIKROE LIGHTRANGER 12 CLICK Breakout
1715
// with VL53L8CH variant, so histogram example 12 is supported
@@ -23,6 +21,9 @@ extern "C" {
2321
#include <vl53/vl53lmz/examples/Example_5_multiple_targets_per_zone.h>
2422
}
2523

24+
#include <modm/driver/vl53/vl53.hpp>
25+
#include <modm/driver/vl53/vl53_transport.hpp>
26+
2627
using namespace Board;
2728

2829
using I2c = I2cMaster1;

examples/nucleo_h723zg/vl53/vl53l8_spi/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ extern "C" {
2121
#include <vl53/vl53lmz/examples/Example_5_multiple_targets_per_zone.h>
2222
}
2323

24-
#include <modm/ext/vl53/vl53.hpp>
25-
#include <modm/ext/vl53/vl53_transport.hpp>
24+
#include <modm/driver/vl53/vl53.hpp>
25+
#include <modm/driver/vl53/vl53_transport.hpp>
2626

2727
using namespace Board;
2828

ext/vl53/vl53

Submodule vl53 added at e41b856

ext/vl53/vl53.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ VL53_SwapBuffer(uint8_t *buffer, uint16_t size)
6060
uint8_t
6161
VL53_WaitMs(VL53_Platform *p_platform, uint32_t TimeMs)
6262
{
63-
modm::delay_ms(TimeMs);
63+
modm::this_fiber::sleep_for(std::chrono::milliseconds(TimeMs));
6464
return 0;
6565
}
6666

ext/vl53/vl53.lb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Vl53l5cx(Module):
3232
env.copy("vl53/vl53l5cx/LICENSE.txt")
3333
if env[":vl53:vl53l5cx:examples"]:
3434
env.copy("vl53/vl53l5cx/examples")
35-
env.collect(":build:path.include", "modm/ext/vl53/")
35+
env.collect(":build:path.include", "modm/src/modm/driver/vl53")
3636
env.collect(":build:path.include", "modm/ext/vl53/vl53l5cx/inc")
3737

3838
class Vl53lmz(Module):
@@ -57,7 +57,7 @@ class Vl53lmz(Module):
5757
env.copy("vl53/vl53lmz/LICENSE.txt")
5858
if env[":vl53:vl53lmz:examples"]:
5959
env.copy("vl53/vl53lmz/examples")
60-
env.collect(":build:path.include", "modm/ext/vl53/")
60+
env.collect(":build:path.include", "modm/src/modm/driver/vl53")
6161
env.collect(":build:path.include", "modm/ext/vl53/vl53lmz/inc")
6262

6363
def init(module):
@@ -79,7 +79,7 @@ def prepare(module, options):
7979
return True
8080

8181
def build(env):
82-
env.outbasepath = "modm/ext/vl53"
82+
env.outbasepath = "modm/src/modm/driver/vl53"
8383
env.copy("vl53.hpp")
8484
env.copy("vl53_transport.hpp")
8585
env.copy("vl53_transport_impl.hpp")

ext/vl53/vl53_platform.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
#define VL53_PLATFORM_H_
1919
#pragma once
2020

21+
#if __has_include("modm_config_vl53.h")
22+
#include "modm_config_vl53.h"
23+
#endif
24+
2125
#include <stdint.h>
2226
#include <string.h>
2327

0 commit comments

Comments
 (0)