• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/gps


コミットメタ情報

リビジョン3389b376d34139ce9e46c39483ccd55d88c34a28 (tree)
日時2020-05-18 08:31:26
作者Alexey Cherepanov <alxchr@gmai...>
コミッターChih-Wei Huang

ログメッセージ

Fix two bugs

1. inversed timezone correction.
2. nmea string for nmea_cb should be 0-terminated.

変更サマリ

差分

--- a/gps.c
+++ b/gps.c
@@ -308,7 +308,7 @@ nmea_reader_update_time( NmeaReader* r, Token tok )
308308 tm.tm_mday = r->utc_day;
309309 tm.tm_isdst = -1;
310310
311- fix_time = mktime( &tm ) + r->utc_diff;
311+ fix_time = mktime( &tm ) - r->utc_diff; //alxchr
312312 r->fix.timestamp = (long long)fix_time * 1000;
313313 return 0;
314314 }
@@ -493,6 +493,8 @@ nmea_reader_parse( NmeaReader* r )
493493 return;
494494 }
495495
496+ r->in[r->pos] = 0; // alxchr
497+
496498 gettimeofday(&tv, NULL);
497499 if (_gps_state->init)
498500 _gps_state->callbacks->nmea_cb(tv.tv_sec*1000+tv.tv_usec/1000, r->in, r->pos);