scorrpeio
Full Member level 5
- Joined
- Dec 26, 2006
- Messages
- 286
- Helped
- 10
- Reputation
- 20
- Reaction score
- 9
- Trophy points
- 1,298
- Activity points
- 3,496
Hello,
Is there any standard of what should be included in commenting the Embedded Code?
Right now, I am of my own, using following information in commenting...
For .c file
for.h file
- - - Updated - - -
Please let me know, if something more should be added in it.
Is there any standard of what should be included in commenting the Embedded Code?
Right now, I am of my own, using following information in commenting...
For .c file
Code:
/************************************************************************************************
* File Name: - UART.c
* COPYRIGHT NOTICE: (C) 2011 <Company Name>
* All Rights reserved
************************************************************************************************/
/*****************************************************************************************
* File Name: - UART.c
* Date Created: - 25.July.2011
* Created By: -
*
* Dependencies: - The RxBuf of MCU is mapped with the char buffer which is declared
* global in other .c file
* While porting this file in other projects, care should be taken that
* RxBuf of MCU should be mapped as per project requirement.
*
* Description: - 1. This file implements the driver for UART communication.
* 2. It has routines for Initialisation of UART, sending single byte on
* UART port by polling and receiving single byte through interrupt.
*
* Compiler Used: - CCS4.0
* MCU used: - MSP430F5418A
* Date Modified: -
* Modifications: -
* Modified By: -
*****************************************************************************************/
/////////////////////////////////////////////////////////////////////////////////////////
// INCLUDE FILES
/////////////////////////////////////////////////////////////////////////////////////////
#include "Config.h"
#include "StdTypes.h"
#include "Display.h"
#include "Slave.h"
#include "UART.h"
/////////////////////////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
/////////////////////////////////////////////////////////////////////////////////////////
/* The following buffer is used to store data received.*/
UINT8_T u8Buf[];
/////////////////////////////////////////////////////////////////////////////////////////
// FUNCTION DEFINITIONS
/////////////////////////////////////////////////////////////////////////////////////////
/****************************************************************************************
* Function Name- UART_CallFunc
* Return Type- void
* Argument List- UINT8_T u8FunctionNo
* Calling Functions-
* Called Functions-
*
* Global Variables Affected- none
*
* Description-
* Note -
****************************************************************************************/
...
//.c file ends here
for.h file
Code:
/************************************************************************************************
* File Name: - UART.h
* COPYRIGHT NOTICE: (C) 2011 <Company Name>
* All Rights reserved
************************************************************************************************/
/*****************************************************************************************
* File Name: - UART.h
* Date Created: - 25.July.2011
* Created By: -
*
* Dependencies: -
* Description: - This header file contains the declarations of the functions used in
* UART.c File. Further the extern variables are declared here.
* The macros associated with function call also go here.
*
* Compiler Used: - CCS4.0
* MCU used: - MSP430F5418A
* Date Modified: -
* Modifications: -
* Modified By: -
*****************************************************************************************/
#ifndef UART_H_
#define UART_H_
/////////////////////////////////////////////////////////////////////////////////////////
// MACRO DEFINITIONS
/////////////////////////////////////////////////////////////////////////////////////////
/* Macros associated with Calling of Function in UART_Driver.c file */
/////////////////////////////////////////////////////////////////////////////////////////
// EXTERN VARIABLES
/////////////////////////////////////////////////////////////////////////////////////////
/* Variables Declared global in file x.c */
...
/* Variables Declared global in file y.c */
...
/////////////////////////////////////////////////////////////////////////////////////////
// FUNCTION DECLARATION
/////////////////////////////////////////////////////////////////////////////////////////
...
#endif /*UART_H_*/
- - - Updated - - -
Please let me know, if something more should be added in it.