keil使用

快捷键和注释

注释

安装Arm 编译器5

链接

链接2

文件头注释

模板添加

模板:
 

/**
  ******************************************************************************
  * @file    
  * @author  
  * @version V1.0.0
  * @date    
  * @brief   
  *
  * @note    Portions based on STM32 Standard Peripheral Library (V3.5.0)
  *          Original copyright notice follows:
  ******************************************************************************
  * @attention
  *
  * 

? COPYRIGHT(c) 2011 STMicroelectronics

* * Licensed under MCD-ST Liberty SW License Agreement V2 (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.st.com/software_license_agreement_liberty_v2 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** */

printf的使用

1,启用MicroLIB

keil使用_第1张图片

2,实现 fputc

#include 
#include "stm32f1xx_hal.h"  // 根据你的芯片替换头文件

// 重定向fputc到UART
int fputc(int ch, FILE *f) {
    //在这里调用串口发送数据的接口即可
    return ch;
}

你可能感兴趣的:(stm32)