Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion Documentation/applications/netutils/ntpclient/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ The NTP client requires:
- **CONFIG_NET_UDP**: UDP protocol support
- **CONFIG_NET_SOCKOPTS**: Socket options support
- **CONFIG_LIBC_NETDB**: DNS resolution (recommended)
- **CONFIG_HAVE_LONG_LONG**: 64-bit integer support

For best results, ensure:
- Stable network connectivity
Expand Down
1 change: 0 additions & 1 deletion Documentation/guides/rust.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ Please ensure that you have a working NuttX build environment, and with the foll

Please enable the following configurations in your NuttX configuration:

- CONFIG_SYSTEM_TIME64
- CONFIG_FS_LARGEFILE
- CONFIG_TLS_NELEM = 16
- CONFIG_DEV_URANDOM
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/armv7-a/arm_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ void up_perf_convert(clock_t elapsed, struct timespec *ts)

ts->tv_sec = elapsed / g_cpu_freq;
left = elapsed - ts->tv_sec * g_cpu_freq;
ts->tv_nsec = NSEC_PER_SEC * (uint64_t)left / g_cpu_freq;
ts->tv_nsec = NSEC_PER_SEC * left / g_cpu_freq;
}
#endif
2 changes: 1 addition & 1 deletion arch/arm/src/armv7-m/arm_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ void up_perf_convert(clock_t elapsed, struct timespec *ts)

ts->tv_sec = elapsed / g_cpu_freq;
left = elapsed - ts->tv_sec * g_cpu_freq;
ts->tv_nsec = NSEC_PER_SEC * (uint64_t)left / g_cpu_freq;
ts->tv_nsec = NSEC_PER_SEC * left / g_cpu_freq;
}
#endif
2 changes: 1 addition & 1 deletion arch/arm/src/armv7-r/arm_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void up_perf_convert(clock_t elapsed, struct timespec *ts)

ts->tv_sec = elapsed / g_cpu_freq;
left = elapsed - ts->tv_sec * g_cpu_freq;
ts->tv_nsec = NSEC_PER_SEC * (uint64_t)left / g_cpu_freq;
ts->tv_nsec = NSEC_PER_SEC * left / g_cpu_freq;
}
#endif /* CONFIG_BUILD_FLAT || __KERNEL__ */

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/armv8-m/arm_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ void up_perf_convert(clock_t elapsed, struct timespec *ts)

ts->tv_sec = elapsed / g_cpu_freq;
left = elapsed - ts->tv_sec * g_cpu_freq;
ts->tv_nsec = NSEC_PER_SEC * (uint64_t)left / g_cpu_freq;
ts->tv_nsec = NSEC_PER_SEC * left / g_cpu_freq;
}
#endif
2 changes: 1 addition & 1 deletion arch/arm/src/armv8-r/arm_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ void up_perf_convert(clock_t elapsed, struct timespec *ts)

ts->tv_sec = elapsed / g_cpu_freq;
left = elapsed - ts->tv_sec * g_cpu_freq;
ts->tv_nsec = NSEC_PER_SEC * (uint64_t)left / g_cpu_freq;
ts->tv_nsec = NSEC_PER_SEC * left / g_cpu_freq;
}
#endif /* CONFIG_ARCH_PERF_EVENTS */
2 changes: 1 addition & 1 deletion arch/arm/src/cxd56xx/cxd56_cisif.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static uint64_t cisif_get_msec_time(void)

clock_systime_timespec(&tp);

return (((uint64_t)tp.tv_sec) * 1000 + tp.tv_nsec / 1000000);
return tp.tv_sec * 1000 + tp.tv_nsec / 1000000;
}

static void cisif_trace_time_start(void)
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/src/cxd56xx/cxd56_nxaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2096,8 +2096,8 @@ static int cxd56_power_on_micbias(struct cxd56_dev_s *dev)

clock_systime_timespec(&start);

dev->mic_boot_start = (uint64_t)start.tv_sec * 1000 +
(uint64_t)start.tv_nsec / 1000000;
dev->mic_boot_start = start.tv_sec * 1000 +
start.tv_nsec / 1000000;

return OK;
}
Expand Down Expand Up @@ -2951,8 +2951,8 @@ static int cxd56_start(struct audio_lowerhalf_s *lower)

clock_systime_timespec(&end);

uint64_t time = (uint64_t)end.tv_sec * 1000 +
(uint64_t)end.tv_nsec / 1000000 -
uint64_t time = end.tv_sec * 1000 +
end.tv_nsec / 1000000 -
priv->mic_boot_start;

if (time < CXD56_MIC_BOOT_WAIT)
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/src/cxd56xx/cxd56_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ time_t up_rtc_time(void)
count += g_rtc_save->offset;
count >>= 15; /* convert to 1sec resolution */

return (time_t)count / CONFIG_RTC_FREQUENCY;
return count / CONFIG_RTC_FREQUENCY;
}
#endif

Expand Down Expand Up @@ -481,7 +481,7 @@ int up_rtc_settime(const struct timespec *tp)
/* Only save the difference from HW raw value */

count = SEC_TO_CNT(tp->tv_sec) | NSEC_TO_PRECNT(tp->tv_nsec);
g_rtc_save->offset = (int64_t)count - (int64_t)cxd56_rtc_count();
g_rtc_save->offset = count - cxd56_rtc_count();
#endif

cxd56_update_basetime(&g_basetime);
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/src/efm32/efm32_rtc_burtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ int up_rtc_initialize(void)
#ifndef CONFIG_RTC_HIRES
time_t up_rtc_time(void)
{
return (time_t)efm32_get_burtc_tick() / CONFIG_RTC_FREQUENCY;
return efm32_get_burtc_tick() / CONFIG_RTC_FREQUENCY;
}
#endif

Expand Down Expand Up @@ -466,7 +466,7 @@ int up_rtc_settime(const struct timespec *tp)

/* Compute Burtc offset because we cannot reset counter */

val = (((uint64_t)tp->tv_sec) * CONFIG_RTC_FREQUENCY) + \
val = (tp->tv_sec * CONFIG_RTC_FREQUENCY) + \
(tp->tv_nsec / (NSEC_PER_SEC / CONFIG_RTC_FREQUENCY));

if (val < cnt_reg)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/imxrt/imxrt_rtc_lowerhalf.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ static int imxrt_rdalarm(struct rtc_lowerhalf_s *lower,

/* Get the current alarm setting in seconds */

alarm = (time_t)imxrt_hprtc_getalarm();
alarm = imxrt_hprtc_getalarm();

/* Convert the one second epoch time to a struct tm */

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/imxrt/imxrt_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ int up_timer_gettime(struct timespec *ts)
int up_alarm_start(const struct timespec *ts)
{
size_t offset = 1;
uint64_t tm = ((uint64_t)ts->tv_sec * NSEC_PER_SEC + ts->tv_nsec) /
uint64_t tm = (ts->tv_sec * NSEC_PER_SEC + ts->tv_nsec) /
NSEC_PER_TICK;
irqstate_t flags;
uint32_t regval;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/lc823450/lc823450_dvfs2.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static uint64_t _get_current_time64(void)
struct timespec ts;

clock_systime_timespec(&ts);
return (uint64_t)ts.tv_sec * NSEC_PER_SEC + (uint64_t)ts.tv_nsec;
return ts.tv_sec * NSEC_PER_SEC + ts.tv_nsec;
}

/****************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/lc823450/lc823450_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static void tm_divider(struct tm *tm, int divn, int divm)
{
time_t tt;
tt = timegm(tm);
tt = (time_t) ((uint64_t)tt * divn / divm);
tt = tt * divn / divm;
gmtime_r(&tt, tm);
}
#endif /* CONFIG_RTC_DIV */
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/src/lc823450/lc823450_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ int up_rtc_gettime(struct timespec *tp)

/* Get the elapsed time */

elapsed = NSEC_PER_TICK * (uint64_t)clock_systime_ticks();
elapsed = NSEC_PER_TICK * clock_systime_ticks();

/* Add the timer fraction in nanoseconds */

Expand All @@ -724,8 +724,8 @@ int up_rtc_gettime(struct timespec *tp)

/* And return the result to the caller. */

tp->tv_sec = (time_t)secs;
tp->tv_nsec = (long)nsecs;
tp->tv_sec = secs;
tp->tv_nsec = nsecs;

tmrinfo("Returning tp=(%d,%d)\n", (int)tp->tv_sec, (int)tp->tv_nsec);
return OK;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/lpc31xx/lpc31_timerisr.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void up_timer_initialize(void)
freq >>= 4;
}

load = ((freq * (uint64_t)10000) / 1000000);
load = ((freq * 10000) / 1000000);
putreg32((uint32_t)load, LPC31_TIMER0_LOAD);

/* Set periodic mode */
Expand Down
8 changes: 3 additions & 5 deletions arch/arm/src/lpc43xx/lpc43_rit.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static int lpc43_rit_isr(int irq, void *context, void *arg)

putreg32(RIT_CTRL_INT, LPC43_RIT_CTRL);

g_internal_timer += (uint64_t)RIT_TIMER_RESOLUTION;
g_internal_timer += RIT_TIMER_RESOLUTION;
if (g_alarm > 0 && g_internal_timer >= g_alarm)
{
/* handle expired alarm */
Expand Down Expand Up @@ -228,8 +228,7 @@ int up_alarm_start(const struct timespec *ts)
* coded.
*/

g_alarm = (uint64_t)ts->tv_sec * (uint64_t)1000000000 +
(uint64_t)ts->tv_nsec;
g_alarm = ts->tv_sec * 1000000000 + ts->tv_nsec;
return OK;
}

Expand All @@ -252,8 +251,7 @@ int up_timer_start(const struct timespec *ts)
*/

g_alarm = g_internal_timer;
g_alarm += (uint64_t)ts->tv_sec * (uint64_t)1000000000 +
(uint64_t)ts->tv_nsec;
g_alarm += ts->tv_sec * 1000000000 + ts->tv_nsec;
return OK;
}

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/src/lpc54xx/lpc54_tickless.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ static void lpc54_ts_sub(const struct timespec *ts1,

static inline uint64_t lpc54_ts2tick(const struct timespec *ts)
{
return ((uint64_t)ts->tv_sec * LPC54_CCLK +
((uint64_t)ts->tv_nsec / g_min_nsec * g_min_ticks));
return (ts->tv_sec * LPC54_CCLK +
(ts->tv_nsec / g_min_nsec * g_min_ticks));
}

static uint64_t lpc54_tick2ts(uint64_t ticks, struct timespec *ts,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/max326xx/common/max326_rtc_lowerhalf.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ static int max326_rdalarm(struct rtc_lowerhalf_s *lower,
{
/* Extract integer seconds from the b32_t value */

time_t sec = (time_t)(b32toi(ftime));
time_t sec = b32toi(ftime);

/* Convert to struct rtc_time (aka struct tm) */

Expand Down
8 changes: 4 additions & 4 deletions arch/arm/src/sam34/sam4cm_oneshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ int sam_oneshot_start(struct sam_oneshot_s *oneshot,

/* Express the delay in microseconds */

usec = (uint64_t)ts->tv_sec * USEC_PER_SEC +
(uint64_t)(ts->tv_nsec / NSEC_PER_USEC);
usec = ts->tv_sec * USEC_PER_SEC +
(ts->tv_nsec / NSEC_PER_USEC);

/* Get the timer counter frequency and determine the number of counts need
* to achieve the requested delay.
Expand Down Expand Up @@ -496,8 +496,8 @@ int sam_oneshot_cancel(struct sam_oneshot_s *oneshot,
sec = usec / USEC_PER_SEC;
nsec = ((usec) - (sec * USEC_PER_SEC)) * NSEC_PER_USEC;

ts->tv_sec = (time_t)sec;
ts->tv_nsec = (unsigned long)nsec;
ts->tv_sec = sec;
ts->tv_nsec = nsec;
}

tmrinfo("remaining (%lu, %lu)\n",
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/src/sam34/sam4cm_oneshot_lowerhalf.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ static int sam_max_delay(struct oneshot_lowerhalf_s *lower,
uint64_t sec = usecs / 1000000;
usecs -= 1000000 * sec;

ts->tv_sec = (time_t)sec;
ts->tv_nsec = (long)(usecs * 1000);
ts->tv_sec = sec;
ts->tv_nsec = usecs * 1000;
}

return ret;
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/src/sama5/sam_oneshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ int sam_oneshot_start(struct sam_oneshot_s *oneshot,

/* Express the delay in microseconds */

usec = (uint64_t)ts->tv_sec *
USEC_PER_SEC + (uint64_t)(ts->tv_nsec /
usec = ts->tv_sec *
USEC_PER_SEC + (ts->tv_nsec /
NSEC_PER_USEC);

/* Get the timer counter frequency and determine the number of counts
Expand All @@ -311,7 +311,7 @@ int sam_oneshot_start(struct sam_oneshot_s *oneshot,
* = (usecs * frequency) / USEC_PER_SEC;
*/

regval = (usec * (uint64_t)sam_tc_divfreq(oneshot->tch)) / USEC_PER_SEC;
regval = (usec * sam_tc_divfreq(oneshot->tch)) / USEC_PER_SEC;

tmrinfo("usec=%llu regval=%08llx\n", usec, regval);
DEBUGASSERT(regval <= UINT32_MAX);
Expand Down Expand Up @@ -507,8 +507,8 @@ int sam_oneshot_cancel(struct sam_oneshot_s *oneshot,
sec = usec / USEC_PER_SEC;
nsec = ((usec) - (sec * USEC_PER_SEC)) * NSEC_PER_USEC;

ts->tv_sec = (time_t)sec;
ts->tv_nsec = (unsigned long)nsec;
ts->tv_sec = sec;
ts->tv_nsec = nsec;
}

tmrinfo("remaining (%lu, %lu)\n",
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/src/sama5/sam_oneshot_lowerhalf.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ static int sam_max_delay(struct oneshot_lowerhalf_s *lower,
uint64_t sec = usecs / 1000000;
usecs -= 1000000 * sec;

ts->tv_sec = (time_t)sec;
ts->tv_nsec = (long)(usecs * 1000);
ts->tv_sec = sec;
ts->tv_nsec = usecs * 1000;
}

return ret;
Expand Down
7 changes: 3 additions & 4 deletions arch/arm/src/samd5e5/sam_oneshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ int sam_oneshot_start(struct sam_oneshot_s *oneshot,

/* Express the delay in microseconds */

usec = (uint64_t)ts->tv_sec * USEC_PER_SEC + (uint64_t)(ts->tv_nsec /
NSEC_PER_USEC);
usec = ts->tv_sec * USEC_PER_SEC + (ts->tv_nsec / NSEC_PER_USEC);

/* Get the timer counter frequency and determine
* the number of counts need to achieve the requested delay.
Expand Down Expand Up @@ -442,8 +441,8 @@ int sam_oneshot_cancel(struct sam_oneshot_s *oneshot,
sec = usec / USEC_PER_SEC;
nsec = ((usec) - (sec * USEC_PER_SEC)) * NSEC_PER_USEC;

ts->tv_sec = (time_t)sec;
ts->tv_nsec = (unsigned long)nsec;
ts->tv_sec = sec;
ts->tv_nsec = nsec;
}

tmrinfo("remaining (%lu, %lu)\n",
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/src/samd5e5/sam_oneshot_lowerhalf.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ static int sam_max_delay(struct oneshot_lowerhalf_s *lower,
uint64_t sec = usecs / 1000000;
usecs -= 1000000 * sec;

ts->tv_sec = (time_t)sec;
ts->tv_nsec = (long)(usecs * 1000);
ts->tv_sec = sec;
ts->tv_nsec = usecs * 1000;
}

return ret;
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/src/samv7/sam_oneshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ int sam_oneshot_start(struct sam_oneshot_s *oneshot,

/* Express the delay in microseconds */

usec = (uint64_t)ts->tv_sec * USEC_PER_SEC +
(uint64_t)(ts->tv_nsec / NSEC_PER_USEC);
usec = ts->tv_sec * USEC_PER_SEC +
(ts->tv_nsec / NSEC_PER_USEC);

/* Get the timer counter frequency and determine the number of counts
* needed to achieve the requested delay.
Expand Down Expand Up @@ -506,8 +506,8 @@ int sam_oneshot_cancel(struct sam_oneshot_s *oneshot,
sec = usec / USEC_PER_SEC;
nsec = ((usec) - (sec * USEC_PER_SEC)) * NSEC_PER_USEC;

ts->tv_sec = (time_t)sec;
ts->tv_nsec = (unsigned long)nsec;
ts->tv_sec = sec;
ts->tv_nsec = nsec;
}

tmrinfo("remaining (%lu, %lu)\n",
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/src/samv7/sam_oneshot_lowerhalf.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ static int sam_max_delay(struct oneshot_lowerhalf_s *lower,
uint64_t sec = usecs / 1000000;
usecs -= 1000000 * sec;

ts->tv_sec = (time_t)sec;
ts->tv_nsec = (long)(usecs * 1000);
ts->tv_sec = sec;
ts->tv_nsec = usecs * 1000;
}

return ret;
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/src/stm32/stm32_oneshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ int stm32_oneshot_start(struct stm32_oneshot_s *oneshot,

/* Express the delay in microseconds */

usec = (uint64_t)ts->tv_sec * USEC_PER_SEC +
(uint64_t)(ts->tv_nsec / NSEC_PER_USEC);
usec = ts->tv_sec * USEC_PER_SEC +
(ts->tv_nsec / NSEC_PER_USEC);

/* Get the timer counter frequency and determine the number of counts need
* to achieve the requested delay.
Expand Down Expand Up @@ -445,8 +445,8 @@ int stm32_oneshot_cancel(struct stm32_oneshot_s *oneshot,
sec = usec / USEC_PER_SEC;
nsec = ((usec) - (sec * USEC_PER_SEC)) * NSEC_PER_USEC;

ts->tv_sec = (time_t)sec;
ts->tv_nsec = (unsigned long)nsec;
ts->tv_sec = sec;
ts->tv_nsec = nsec;
}

tmrinfo("remaining (%lu, %lu)\n",
Expand Down
Loading
Loading