您的位置:首页 > 编程语言

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

2017-11-16 15:19 323 查看
一、文件结构:头文件、定义文件

      头文件内容规范

版本信息

预处理块
函数声明
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 
        定义文件内容规范
版本信息
头文件引用
函数体实现
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: