软件代码规范笔记_文件结构

一、文件结构:头文件、定义文件

      头文件内容规范

  • 版本信息
  • 预处理块
  • 函数声明
  • For example:
    /*
    * @ Version Information:
    * @ current version: v0.0
    * @ File name: monitor_task.h  
    * @ Summary: This file and the open source flight control platform
    *                         PX4 PC QGroundControl communication
    * @ Author: Yancy
    * @ Date: 2017.11.16
    * @ Version history information: 
    */

    //Prevent header files from being re-referenced
    #ifndef _MONITOR_TASK_H_
    #define _MONITOR_TASK_H_

    //Reference standard library header files
    #include <stdint.h>

    //Reference non-standard library header files
    #include "mavlink.h"

    #define Monitor_Device MONITOR_DEVICE_UART

    typedef struct
    {
        char name[16];
        Param_Type type;
        void* data;
        float max;
        float min;
    }Param;

    typedef enum
    {
        PARAM_IMU_P,
        KEYLEVEL,
        PARAM_ID_NUM
}Param_id;
void param_init(void);
void monitor_task_init(void);
void monitor_uart_get_decode(uint8_t read_c);
void monitor_usb_get_decode(void);
void monitor_default_send_task(MONITOR_DEVICE device,uint16_t send_frequency);
#endif 
        定义文件内容规范
  • 版本信息
  • 头文件引用
  • 函数体实现

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值