projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Signed-off by Robin Gilham:
[bertos.git]
/
bertos
/
net
/
nmea.c
diff --git
a/bertos/net/nmea.c
b/bertos/net/nmea.c
index d4600e07d21e1f8c7ebfc6b2d4afe241aeb57210..f74879523e9bcf2f543c1520efc4e374e39e19af 100644
(file)
--- a/
bertos/net/nmea.c
+++ b/
bertos/net/nmea.c
@@
-84,7
+84,7
@@
static uint32_t tokenToInt(const char *s, int precision)
for(i = 0; i < NMEAP_MAX_SENTENCE_LENGTH; i++)
{
for(i = 0; i < NMEAP_MAX_SENTENCE_LENGTH; i++)
{
- char c = *s++;
+
unsigned
char c = *s++;
if (c == '.')
{
if (c == '.')
{
@@
-165,9
+165,9
@@
static udegree_t nmea_longitude(const char *plot, const char *phem)
* Return altitude in meter from a string.
*
*/
* 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)
{
{
-
u
int32_t alt;
+ int32_t alt;
if (*palt == 0)
return 0;
if (*palt == 0)
return 0;
@@
-413,7
+413,7
@@
int nmea_gpvtg(nmeap_context_t *context, nmeap_sentence_t *sentence)
*/
if (sentence->callout != 0)
(*sentence->callout)(context, vtg, context->user_data);
*/
if (sentence->callout != 0)
(*sentence->callout)(context, vtg, context->user_data);
-
+
return NMEA_GPVTG;
}
return NMEA_GPVTG;
}
@@
-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)
{
* 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);
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);
+ }
}
}