obsidian-notes/MCU/STM32/uint64_t打印.md
CSSC-WORK\murmur 3e6078442b init version
2024-04-15 11:19:57 +08:00

482 B

title updated created tags
uint64_t打印 2022-01-08 14:11:56Z 2022-01-08 13:18:08Z
mcu
printf
代码块
浮点运算

stm32cubeIDE默认无法直接用printf("Freq is %llu.\r\n",tmp)打印输出

在开启standard C 后可以正常输出但是占用资源猛增,变通的方法是拼接输出

uint8_t tt = (uint8_t)(tmp/1e9)%10; //取最高位

printf("Freq is %1d%09u.\r\n",tt,(uint32_t)(tmp-tt*1e9));

#printf #mcu #代码块 #浮点运算