32位 STM32 打印 uint64_t 类型
测试代码,未整理,可参考!
uint64_t cnt = 0x1122334455667788;
uint32_t test1 = (uint32_t)(cnt >> 32);
uint64_t test2 = (uint64_t)(cnt & 0x00000000FFFFFFFF);
LOG(LOG_LVL_INFO, "0x%llx; 0x%08x_%08x\r\n", cnt, test1, (uint32_t)test2);
hexdump(0, "uint64_t", &cnt, 8);
char buf[100];
memset(buf, 0, sizeof(buf));
snprintf(buf, sizeof(buf), "0x%llx, 0x%08x_%08x\r\n", cnt, test1, (uint32_t)test2);
LOG(LOG_LVL_INFO, "%s", buf);
LOG(LOG_LVL_INFO, "%"PRId64"\r\n", cnt);
文章来源:https://www.toymoban.com/news/detail-670319.html
文章来源地址https://www.toymoban.com/news/detail-670319.html
到了这里,关于32位 STM32 打印 uint64_t 类型的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!