MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_tick_from_millisecond

Function rt_tick_from_millisecond

src/clock.c:214–234  ·  view source on GitHub ↗

* @brief This function will calculate the tick from millisecond. * * @param ms is the specified millisecond. * - Negative Number wait forever * - Zero not wait * - Max 0x7fffffff * * @return Return the calculated tick. */

Source from the content-addressed store, hash-verified

212 * @return Return the calculated tick.
213 */
214rt_tick_t rt_tick_from_millisecond(rt_int32_t ms)
215{
216 rt_tick_t tick;
217
218 if (ms < 0)
219 {
220 tick = (rt_tick_t)RT_WAITING_FOREVER;
221 }
222 else
223 {
224#if RT_TICK_PER_SECOND == 1000u
225 tick = ms;
226#else
227 tick = RT_TICK_PER_SECOND * (ms / 1000);
228 tick += (RT_TICK_PER_SECOND * (ms % 1000) + 999) / 1000;
229#endif /* RT_TICK_PER_SECOND == 1000u */
230 }
231
232 /* return the calculated tick */
233 return tick;
234}
235RTM_EXPORT(rt_tick_from_millisecond);
236
237/**

Callers 15

rt_ecm_eth_txFunction · 0.85
rt_rndis_eth_txFunction · 0.85
scsi_device_setupFunction · 0.85
rx_timeout_test_itemFunction · 0.85
tx_timeout_test_itemFunction · 0.85
_send_cmdFunction · 0.85
_wait_tokenFunction · 0.85
_wait_readyFunction · 0.85
rt_msd_initFunction · 0.85
rootfs_mnt_initFunction · 0.85
rt_led_registerFunction · 0.85
rt_led_set_periodFunction · 0.85

Calls

no outgoing calls