* 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;
}
-/*
+/**
* 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);
+ }
}