Incorrect printf on 16-bit MCUs

40 views
Skip to first unread message

alfe...@gmail.com

unread,
Jul 16, 2015, 6:41:31 PM7/16/15
to core...@googlegroups.com
Hi

I found that following code will print zero values

ee_printf("Total time (secs): %d\n",time_in_secs(total_time));
if (time_in_secs(total_time) > 0)
    ee_printf("Iterations/Sec   : %d\n",default_num_contexts*results[0].iterations/time_in_secs(total_time));

if ee_u32 type defined as unsigned long. It is actual for 16bit MCUs.

Just change %d to %lu to fix this issue
Reply all
Reply to author
Forward
0 new messages