X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fnet%2Fnmea.c;h=d232c73adfa253de40069cfff4797c081884d905;hb=2d0ed91b73aafe29d183c4c525b953f169a6da51;hp=d4600e07d21e1f8c7ebfc6b2d4afe241aeb57210;hpb=ea0866deab4dc1f387ec1bad371efc3bbc21b4af;p=bertos.git diff --git a/bertos/net/nmea.c b/bertos/net/nmea.c index d4600e07..d232c73a 100644 --- a/bertos/net/nmea.c +++ b/bertos/net/nmea.c @@ -165,9 +165,9 @@ static udegree_t nmea_longitude(const char *plot, const char *phem) * Return altitude in meter from a string. * */ -static uint16_t nmea_altitude(const char *palt, const char *punits) +static int32_t nmea_altitude(const char *palt, const char *punits) { - uint32_t alt; + int32_t alt; if (*palt == 0) return 0; @@ -456,13 +456,19 @@ int nmea_gpgsv(nmeap_context_t *context, nmeap_sentence_t *sentence) } -/* +/** * Parse NMEA sentence from a channel. */ void nmea_poll(nmeap_context_t *context, KFile *channel) { - int c; + int c, e; while ((c = kfile_getc(channel)) != EOF) nmeap_parse(context, c); + + if ((e = kfile_error(channel))) + { + LOG_ERR("ch error [%0X]\n", e); + kfile_clearerr(channel); + } }