Skip to content

Commit 0167e56

Browse files
committed
Move documentation
1 parent df8361e commit 0167e56

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

include/swiftnav/gnss_time.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -272,28 +272,8 @@ void gps_time_match_weeks(gps_time_t *t, const gps_time_t *ref);
272272
u16 gps_adjust_week_cycle(u16 wn_raw, u16 wn_ref);
273273
u16 gps_adjust_week_cycle256(u16 wn_raw, u16 wn_ref);
274274

275-
/**
276-
* @brief Converts a decimal year to a MJD (modified Julian date).
277-
*
278-
* @param epoch_years The epoch in decimal years representation.
279-
* @return The epoch in MJD representation.
280-
*/
281275
double decimal_year_to_mjd(const double epoch_years);
282-
283-
/**
284-
* @brief Converts a GPS time to a decimal year.
285-
*
286-
* @param gps_time The GPS epoch to convert.
287-
* @return The epoch in decimal years representation.
288-
*/
289276
double gps_time_to_decimal_years(const gps_time_t *time);
290-
291-
/**
292-
* @brief Converts a epoch represented as a decimal year to a GPS time.
293-
*
294-
* @param years The epoch in decimal years representation.
295-
* @return The epoch in GPS time representation.
296-
*/
297277
gps_time_t decimal_years_to_gps_time(const double years);
298278

299279
static inline bool is_leap_year(s32 year) {

src/gnss_time.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,12 @@ u16 gps_adjust_week_cycle256(u16 wn_raw, u16 wn_ref) {
507507
return wn_raw + 256 * ((wn_ref + 255 - wn_raw) / 256);
508508
}
509509

510+
/**
511+
* Converts a decimal year to a MJD (modified Julian date).
512+
*
513+
* \param epoch_years The epoch in decimal years representation.
514+
* \return The epoch in MJD representation.
515+
*/
510516
double decimal_year_to_mjd(const double epoch_years) {
511517
const double integer_year = floor(epoch_years);
512518
const double fractional_year = epoch_years - integer_year;
@@ -519,6 +525,12 @@ double decimal_year_to_mjd(const double epoch_years) {
519525
return epoch_mjd;
520526
}
521527

528+
/**
529+
* Converts a GPS time to a decimal year.
530+
*
531+
* \param gps_time The GPS epoch to convert.
532+
* \return The epoch in decimal years representation.
533+
*/
522534
double gps_time_to_decimal_years(const gps_time_t *time) {
523535
utc_tm utc;
524536
make_utc_tm(time, &utc);
@@ -531,6 +543,12 @@ double gps_time_to_decimal_years(const gps_time_t *time) {
531543
return (double)utc.year + (double)utc.year_day / days_in_year;
532544
}
533545

546+
/**
547+
* Converts a epoch represented as a decimal year to a GPS time.
548+
*
549+
* \param years The epoch in decimal years representation.
550+
* \return The epoch in GPS time representation.
551+
*/
534552
gps_time_t decimal_years_to_gps_time(const double years) {
535553
const double mjd = decimal_year_to_mjd(years);
536554
return mjd2gps(mjd);

0 commit comments

Comments
 (0)