Fast flight preparing and reboot on failed initialization
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include "RangingSensor.hpp"
|
||||
#include "esp_log.h"
|
||||
|
||||
RangingSensor::RangingSensor(TwoWire &i2c, volatile bool loop_on_fail) {
|
||||
RangingSensor::RangingSensor(TwoWire &i2c) {
|
||||
_sensor = VL53L0X();
|
||||
_sensor.setBus(&i2c);
|
||||
if (_sensor.init()) {
|
||||
@@ -14,7 +14,7 @@ RangingSensor::RangingSensor(TwoWire &i2c, volatile bool loop_on_fail) {
|
||||
ESP_LOGI(_tag, "Sensor initialized");
|
||||
} else {
|
||||
ESP_LOGE(_tag, "Failed to initialize RangingSensor!");
|
||||
while (loop_on_fail) {}
|
||||
assert(false);
|
||||
}
|
||||
_sensor.startContinuous(10);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user