File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,12 @@ class VL53L8CX {
106
106
}
107
107
if (_dev.platform .i2c_rst_pin >= 0 ) {
108
108
pinMode (_dev.platform .i2c_rst_pin , OUTPUT);
109
- digitalWrite (_dev.platform .i2c_rst_pin , LOW);
109
+ if (_dev.platform .dev_i2c ) {
110
+ digitalWrite (_dev.platform .i2c_rst_pin , LOW);
111
+ }
112
+ if (_dev.platform .dev_spi ) {
113
+ digitalWrite (_dev.platform .i2c_rst_pin , HIGH);
114
+ }
110
115
}
111
116
112
117
if (_dev.platform .dev_spi ) {
@@ -165,7 +170,7 @@ class VL53L8CX {
165
170
*/
166
171
virtual void vl53l8cx_i2c_reset (void )
167
172
{
168
- if (_dev.platform .i2c_rst_pin >= 0 ) {
173
+ if (_dev.platform .dev_i2c && _dev. platform . i2c_rst_pin >= 0 ) {
169
174
digitalWrite (_dev.platform .i2c_rst_pin , LOW);
170
175
delay (10 );
171
176
digitalWrite (_dev.platform .i2c_rst_pin , HIGH);
You can’t perform that action at this time.
0 commit comments