When you write a program, you tend to follow certain norms. Good code style can improve the readability of the code, easy to maintain and upgrade. Here are some comment templates that mimic the code style of the STM32 official HAL library source code.
1. Add user comment template to MDK
2. Use some code comment templates
Void bsp_dac1_Init(void) {void bsp_dac1_Init(void) {void bsp_dac1_Init(void) {void bsp_dac1_Init(void);
/** @defgroup BSP_DAC_Driver
* @brief xxx driver modules
* @{
*/
void bsp_dac1_Init(void);
/**
* @}
*/
void bsp_dac2_Init(void) is added to the BSP_DAC_Driver group.
/** @addtogroup BSP_DAC_Driver
* @{
*/
void bsp_dac2_Init(void);
/**
* @}
*/
2.3 use formal code comments mode can enhance code can read a gender, use the following statement can be more comprehensive description.
@brief
te
@p>
@retval>>@retval
@brief
@brief
@note
@param
@retval
@retval
/**
* @brief Stop ADC data switch
* @note NONE
* @param NONE
* @retval NONE
*/
void bsp_adc1_stop(void)
{
///
}
3, summarize
MDK’s Template function makes it easy to add a user’s code comment Template, improve the quality of the code, and facilitate subsequent maintenance and upgrade.
Read More:
- org.thymeleaf.exceptions.TemplateInputException: Error resolving template [hello scope], template mi
- Error resolving template [index], template might not exist
- [Solved] Error resolving template template might not exist or might not be accessible
- [Solved] Error resolving template [x] template might not exist or might not be accessible by any of the con
- How to Solve JAR pack error: Error resolving template [/userInfo], template might not exist or might not be accessib
- Springboot thymeleaf Error: Exception processing template “table/dynamic_table”: Error resolving template [common]…
- [Solved] org.thymeleaf.exceptions.TemplateInputException: Error resolving template
- [Solved] org.thymeleaf.exceptions.TemplateInputException: Error resolving template
- How to Solve Springboot use thymeleaf template error
- thymeleaf Error: An error happened during template parsing Cannot render error page for request
- Spring project import @Resource Annotation Error [How to Solve]
- [Integrate the mobile MAS SMS service] SDK start error: NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtil
- Annotation @resource & @Autowired introduces Spring bean error
- [Solved] Error:(3, 46) java: Program Package org.springframework.context.annotation does not exist
- [Solved] Annotation Customize Error: ElementType cannot be resolved to a variable
- Springboot reports an error After adding the import annotation: application failed to start
- Springboot startup error “No bean named’org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry’ available”
- [Solved] Error: (4, 52) Java: package org springframework. beans. factory. Annotation does not exist
- Springboot integrates Redis annotation and access error: java.io.NotSerializableException: com.demo.entity.MemberEntity
- The @value annotation of springboot adds the default value to solve the startup error caused by the non-existent key