mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-05 06:18:53 +08:00
ulanding fix sign-compare
This commit is contained in:
@@ -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)
|
||||
// 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) {
|
||||
|
||||
Reference in New Issue
Block a user