Browse Source

ulanding fix sign-compare

sbg
Daniel Agar 8 years ago committed by Beat Küng
parent
commit
fc4a8ebb2a
  1. 4
      src/drivers/ulanding/ulanding.cpp

4
src/drivers/ulanding/ulanding.cpp

@ -328,7 +328,7 @@ bool Radar::read_and_parse(uint8_t *buf, int len, float *range) @@ -328,7 +328,7 @@ bool Radar::read_and_parse(uint8_t *buf, int len, float *range)
bool ret = false;
// write new data into a ring buffer
for (unsigned i = 0; i < len; i++) {
for (int i = 0; i < len; i++) {
_head++;
@ -357,7 +357,7 @@ bool Radar::read_and_parse(uint8_t *buf, int len, float *range) @@ -357,7 +357,7 @@ bool Radar::read_and_parse(uint8_t *buf, int len, float *range)
// go through the buffer backwards starting from the newest byte
// if we find a header byte and the previous two bytes weren't header bytes
// then we found the newest package.
for (unsigned i = 0; i < num_bytes; i++) {
for (int i = 0; i < num_bytes; i++) {
if (is_header_byte(_buf[index])) {
if (no_header_counter >= BUF_LEN / 3 - 1) {
if (ULANDING_VERSION == 1) {

Loading…
Cancel
Save