1、代码几乎一样
#include "msp430.h"
#include "stdio.h"
float a=10.5;
/**
* main.c
*/
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
while(1)
{
printf("%f",a);
}
}
int fputc(int _c, register FILE *_fp)
{
while(!(UCA0IFG&UCTXIFG));
UCA0TXBUF = _c;
return(_c);
}
2、print_support都选最大的
3、编译后代码量差别很大
4、将代码下载到MSP430芯片,CCS编译的大体积代码却只支持printf("%s")不支持printf("%f")printf("%d"),而IAR编译的小体积代码却支持全功能的printf();
5、哪里出了问题?
Susan Yang:
首先建议您详细看一下下面的wiki页面说明
processors.wiki.ti.com/…/Printf_support_for_MSP430_CCSTUDIO_compiler
full: Supports all format specifiers. This is the default.
nofloat: Excludes support for printing floating point values. Supports all format specifiers except %f, %F, %g, %G, %e, and %E.
minimal: Supports the printing of integer, char, or string values without width or precision flags. Specifically, only the %%, %d, %o, %c, %s, and %x format specifiers are supported
灰小子:
不能单纯比较代码量的。
两个开发环境差别还是很大的