Merge pull request #29 from swilson/master

Add support for building under TI-RTOS
This commit is contained in:
Kosma Moczek 2018-01-24 14:59:48 +01:00 committed by GitHub
commit cd27e72970
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 3 deletions

View File

@ -0,0 +1,18 @@
/*
* Copyright © 2017 Kosma Moczek <kosma@cloudyourcar.com>
* This program is free software. It comes without any warranty, to the extent
* permitted by applicable law. You can redistribute it and/or modify it under
* the terms of the Do What The Fuck You Want To Public License, Version 2, as
* published by Sam Hocevar. See the COPYING file for more details.
*/
#if defined(__TI_ARM__)
// timespec definition
#include <ti/sysbios/posix/types.h>
#define timegm mktime
#endif
/* vim: set ts=4 sw=4 et: */

View File

@ -323,7 +323,7 @@ bool minmea_scan(const char *sentence, const char *format, ...)
default: { // Unknown.
goto parse_error;
} break;
}
}
next_field();
@ -581,7 +581,7 @@ bool minmea_parse_vtg(struct minmea_sentence_vtg *frame, const char *sentence)
c_knots != 'N' ||
c_kph != 'K')
return false;
frame->faa_mode = c_faa_mode;
frame->faa_mode = (enum minmea_faa_mode)c_faa_mode;
return true;
}
@ -633,7 +633,7 @@ int minmea_gettime(struct timespec *ts, const struct minmea_date *date, const st
tm.tm_sec = time_->seconds;
time_t timestamp = timegm(&tm); /* See README.md if your system lacks timegm(). */
if (timestamp != -1) {
if (timestamp != (time_t)-1) {
ts->tv_sec = timestamp;
ts->tv_nsec = time_->microseconds * 1000;
return 0;