From 648541bb1f21e1503d9cbbdce0c0330391419694 Mon Sep 17 00:00:00 2001 From: Chromaryu Date: Tue, 4 Jun 2019 06:24:21 +0900 Subject: [PATCH] Add NTP_IP dynamic changes via -D or #define (#1261) * Add define option on Makefile to change NTP_IP dynamically * Remove Makefile -D option --- sysmodules/rosalina/source/ntp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sysmodules/rosalina/source/ntp.c b/sysmodules/rosalina/source/ntp.c index ebdee25..d19b0e8 100644 --- a/sysmodules/rosalina/source/ntp.c +++ b/sysmodules/rosalina/source/ntp.c @@ -34,6 +34,10 @@ #define NTP_TIMESTAMP_DELTA 2208988800ull +#ifndef NTP_IP +#define NTP_IP 0xD8EF2300 +#endif + typedef struct RtcTime { // From 3dbrew u8 seconds; @@ -109,7 +113,7 @@ Result ntpGetTimeStamp(time_t *outTimestamp) // Copy the server's IP address to the server address structure. - servAddr.sin_addr.s_addr = htonl(0xD8EF2300); // 216.239.35.0 time1.google.com + servAddr.sin_addr.s_addr = htonl(NTP_IP); // 216.239.35.0 time1.google.com // Convert the port number integer to network big-endian style and save it to the server address structure. servAddr.sin_port = htons(123); @@ -189,4 +193,4 @@ Result ntpSetTimeDate(const struct tm *localt) mcuHwcExit(); cfguExit(); return res; -} \ No newline at end of file +}