4343#endif
4444/* *INDENT-ON* */
4545
46- /**
47- * @brief Type representing seconds since Unix epoch (January 1, 1970 UTC).
48- *
49- * The width of this type depends on the configuration macro USE_LEGACY_TIME_API:
50- * - If USE_LEGACY_TIME_API is defined, a 32-bit unsigned integer is used.
51- * This limits date representation to the year 2038 (Y2038 limitation).
52- * - Otherwise, a 64-bit unsigned integer is used for Y2038 compliance.
53- */
54- #ifdef USE_LEGACY_TIME_API
55- typedef uint32_t UnixTime_t ; /**< 32-bit Unix time for legacy systems. */
56- #else
57- typedef uint64_t UnixTime_t ; /**< 64-bit Unix time for Y2038 compliance. */
58- #endif
59-
6046/**
6147 * @ingroup sntp_constants
6248 * @brief The base packet size of request and response of the (S)NTP protocol.
@@ -504,15 +490,7 @@ SntpStatus_t Sntp_CalculatePollInterval( uint16_t clockFreqTolerance,
504490 * @brief Utility to convert SNTP timestamp (that uses 1st Jan 1900 as the epoch) to
505491 * UNIX timestamp (that uses 1st Jan 1970 as the epoch).
506492 *
507- * @note This function converts SNTP timestamps to UNIX time supporting both 32-bit and
508- * 64-bit representations based on the configuration macro USE_LEGACY_TIME_API.
509- *
510- * - If USE_LEGACY_TIME_API is defined, the conversion is limited to the date range
511- * from 1st Jan 1970 0h 0m 0s (UNIX epoch) to 19th Jan 2038 3h 14m 7s, due to the
512- * 32-bit width limitation.
513- *
514- * - If USE_LEGACY_TIME_API is not defined, 64-bit UNIX time representation is used,
515- * allowing conversion of SNTP timestamps beyond the year 2038 (Y2038 problem mitigated).
493+ * Refer to (this image)[docs/doxygen/images/Ntp_To_Unix_Time.png].
516494 *
517495 * @note The function also correctly handles SNTP era overflow (from 7 Feb 2036 6h 28m 16s,
518496 * i.e., SNTP era 1) to ensure accurate conversion across SNTP eras.
@@ -529,7 +507,7 @@ SntpStatus_t Sntp_CalculatePollInterval( uint16_t clockFreqTolerance,
529507 */
530508/* @[define_sntp_converttounixtime] */
531509SntpStatus_t Sntp_ConvertToUnixTime ( const SntpTimestamp_t * pSntpTime ,
532- UnixTime_t * pUnixTimeSecs ,
510+ uint32_t * pUnixTimeSecs ,
533511 uint32_t * pUnixTimeMicrosecs );
534512/* @[define_sntp_converttounixtime] */
535513
0 commit comments