Skip to content

Commit 64357df

Browse files
code style fixes
1 parent ed3b139 commit 64357df

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

libraries/AP_RangeFinder/AP_RangeFinder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ __INITFUNC__ void RangeFinder::detect_instance(uint8_t instance, uint8_t& serial
633633
case Type::DTS6012M:
634634
serial_create_fn = AP_RangeFinder_DTS6012M::create;
635635
break;
636-
#endif
636+
#endif // AP_RANGEFINDER_DTS6012M_ENABLED
637637

638638
case Type::NONE:
639639
break;

libraries/AP_RangeFinder/AP_RangeFinder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class RangeFinder
193193
#endif // AP_RANGEFINDER_BENEWAKE_TFS20L_ENABLED
194194
#if AP_RANGEFINDER_DTS6012M_ENABLED
195195
DTS6012M = 47,
196-
#endif
196+
#endif // AP_RANGEFINDER_DTS6012M_ENABLED
197197
#if AP_RANGEFINDER_SIM_ENABLED
198198
SIM = 100,
199199
#endif

libraries/AP_RangeFinder/AP_RangeFinder_DTS6012M.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ bool AP_RangeFinder_DTS6012M::get_reading(float &reading_m)
9797
int32_t latest_intensity = -1;
9898

9999
// read available bytes from the sensor
100-
for (auto i = 0; i < 8192; i++) {
100+
for (uint16_t i = 0; i < 8192; i++) {
101101
uint8_t c;
102102
if (!uart->read(c)) {
103103
break;

libraries/AP_RangeFinder/AP_RangeFinder_DTS6012M.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#define DTS6012M_DEVICE_ID 0x03
2727
#define DTS6012M_DEVICE_TYPE 0x20
2828
#define DTS6012M_CMD_START_STREAM 0x01
29-
#define DTS6012M_CMD_STOP_STREAM 0x02
3029
#define DTS6012M_HEADER_LEN 7 // header(1) + devid(1) + devtype(1) + cmd(1) + reserved(1) + length(2)
3130
#define DTS6012M_DATA_LEN 14 // measurement data length
3231
#define DTS6012M_CRC_LEN 2
@@ -39,16 +38,15 @@ class AP_RangeFinder_DTS6012M : public AP_RangeFinder_Backend_Serial
3938
public:
4039
static AP_RangeFinder_Backend_Serial *create(
4140
RangeFinder::RangeFinder_State &_state,
42-
AP_RangeFinder_Params &_params) {
41+
AP_RangeFinder_Params &_params)
42+
{
4343
return NEW_NOTHROW AP_RangeFinder_DTS6012M(_state, _params);
4444
}
4545

4646
protected:
4747
using AP_RangeFinder_Backend_Serial::AP_RangeFinder_Backend_Serial;
4848

49-
MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override {
50-
return MAV_DISTANCE_SENSOR_LASER;
51-
}
49+
MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override { return MAV_DISTANCE_SENSOR_LASER; }
5250

5351
private:
5452
bool get_reading(float &reading_m) override;

0 commit comments

Comments
 (0)