Hi
Anyone knows how can i printf a unsigned long long (uint_64) variable?
uint_32 var32 = 0;
uint_64 var64 = 0;
printf("var32 = %lu \n", var32);
printf("var64 = %?? \n", var64); // Question ??
Note: %llu doesn't work for unsigned long long variables
I am using M52259Demo Board, MQX 3.6.2 and CodeWarrior Coldfire Classic 7.2.1 with C++ Compiler.
thanks in advance
Solved! Go to Solution.
Hi,
It is a good ideia but it is not exactly what i intend.
I reported this subject to Support Center and the answer was:
"long long printf support is currently not supported by MQX printf function – we have it logged in our bug tracking system, not sure if it will be solved for verson 3.7.0 which is launched in March 31, but definitely for 3.8.0."
Thanks for your attention.
Hi RuiFaria,
I haven't tried this so am just suggesting one idea.
You might do something like:
uint_64 var64=0xfeedbeefdefacbad;
uint_32 tmp32h=var64>>32;
uint_32 tmp32l=(var64<<32)>>32;
printf("var60=0x%08X%08X\n", tmp32h, tmp32l);
Hope this might work :smileyhappy:
Regards,
David
One more try:
uint_64 var64=0xfeedbeefdefacbad;
uint_32 tmp32h=(uint_32)(var64>>32);
uint_32 tmp32l=(uint_32)((var64<<32)>>32);
printf("var64=0x%08X%08X\n", tmp32h, tmp32l);
printf("var64=0x%08X%08X\n", (uint_32)(var64>>32), (uint_32)((var64<<32)>>32));
Output looked like:
var64=0xFEEDBEEFDEFACBAD
var64=0xFEEDBEEFDEFACBAD
Hi,
It is a good ideia but it is not exactly what i intend.
I reported this subject to Support Center and the answer was:
"long long printf support is currently not supported by MQX printf function – we have it logged in our bug tracking system, not sure if it will be solved for verson 3.7.0 which is launched in March 31, but definitely for 3.8.0."
Thanks for your attention.