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

Function calculate_speed_print

examples/test/device_test.c:16–37  ·  view source on GitHub ↗

calculate speed */

Source from the content-addressed store, hash-verified

14
15/* calculate speed */
16static void calculate_speed_print(rt_uint32_t speed)
17{
18 rt_uint32_t k,m;
19
20 k = speed/1024UL;
21 if( k )
22 {
23 m = k/1024UL;
24 if( m )
25 {
26 rt_kprintf("%d.%dMbyte/s",m,k%1024UL*100/1024UL);
27 }
28 else
29 {
30 rt_kprintf("%d.%dKbyte/s",k,speed%1024UL*100/1024UL);
31 }
32 }
33 else
34 {
35 rt_kprintf("%dbyte/s",speed);
36 }
37}
38
39static rt_err_t _block_device_test(rt_device_t device)
40{

Callers 1

_block_device_testFunction · 0.85

Calls 1

rt_kprintfFunction · 0.85

Tested by

no test coverage detected