guowenxue
10 days ago a40997aa12029f24ef0904d9af6415c975c4322f
ex1.auto-light/Board/miscdev.c
@@ -79,7 +79,7 @@
    if( which >= LedMax )
        return ;
    level = status==OFF ? GPIO_PIN_SET : GPIO_PIN_RESET;
    level = status==ON ? leds[which].active : !leds[which].active;
    HAL_GPIO_WritePin(leds[which].group, leds[which].pin, level);
}
@@ -174,13 +174,15 @@
 *+----------------------+
 */
/* gcc 编译器中的 printf 函数将会调用 __io_putchar() 函数,实现最终的字符打印
 * keil编译器中的 printf 函数将会调用 fputc() 函数,实现最终的字符打印
 * 这里我们定义一个宏 PUTCHAR_PROTOTYPE 来兼容这两个编译器所需要的函数原型;
/* gcc 编译器的 printf 将会调用 __io_putchar() 函数,实现最终的字符打印
 * keil编译器的 printf 将会调用 fputc() 函数,实现最终的字符打印
 * 这里我们定义一个宏 PUTCHAR_PROTOTYPE 来兼容两个编译器所需要的函数原型
 *
 * 注意:
 *  1. Keil5 工程需要勾选:Options for Target -> Target -> Use MicroLIB
 *  2. Keil5 的编译器 armclang(AC6) 会定义 __GNUC__ 宏,而旧版 armcc(AC5) 则不会
 */
#if defined(__ARMCC_VERSION) /* MDK ARM Compiler */
FILE __stdout;
FILE __stdin;
#if defined(__ARMCC_VERSION) /*  */
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#elif defined(__GNUC__) /* GCC */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)