AP_Rangefinder: compiler warning float to double on atof()

- this is horribly inefficient so better to change the parsing
This commit is contained in:
Tom Pittenger 2016-02-29 10:25:56 -08:00
parent 9e452838ab
commit b1ea82079e

View File

@ -62,7 +62,7 @@ bool AP_RangeFinder_LightWareSerial::get_reading(uint16_t &reading_cm)
char c = uart->read();
if (c == '\r') {
linebuf[linebuf_len] = 0;
sum += atof(linebuf);
sum += (float)atof(linebuf);
count++;
linebuf_len = 0;
} else if (isdigit(c) || c == '.') {