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

Function rt_tick_get_millisecond

src/clock.c:246–259  ·  view source on GitHub ↗

* @brief This function will return the passed millisecond from boot. * * @note if the value of RT_TICK_PER_SECOND is lower than 1000 or * is not an integral multiple of 1000, this function will not * provide the correct 1ms-based tick. * * @return Return passed millisecond from boot. */

Source from the content-addressed store, hash-verified

244 * @return Return passed millisecond from boot.
245 */
246rt_weak rt_tick_t rt_tick_get_millisecond(void)
247{
248#if RT_TICK_PER_SECOND == 0 /* make cppcheck happy*/
249#error "RT_TICK_PER_SECOND must be greater than zero"
250#endif
251
252#if 1000 % RT_TICK_PER_SECOND == 0u
253 return rt_tick_get() * (1000u / RT_TICK_PER_SECOND);
254#else
255 #warning "rt-thread cannot provide a correct 1ms-based tick any longer,\
256 please redefine this function in another file by using a high-precision hard-timer."
257 return 0;
258#endif /* 1000 % RT_TICK_PER_SECOND == 0u */
259}
260
261/**@}*/

Callers 13

sys_sysinfoFunction · 0.85
sys_nowFunction · 0.85
single_showFunction · 0.85
dfs_pcache_threadFunction · 0.85
dfs_pcache_initFunction · 0.85
dfs_page_dirtyFunction · 0.85
ETH_InitFunction · 0.85
sdhci_send_data_cmdFunction · 0.85
dw_iic_recvFunction · 0.85
dw_iic_sendFunction · 0.85
designware_eth_initFunction · 0.85
dw_eth_mac_phy_readFunction · 0.85

Calls 1

rt_tick_getFunction · 0.85

Tested by

no test coverage detected