RTEMS Doxygen编写规范
头文件块:
头文件应该包含与其他源文件相似的注释块:
/**
* @file
*
* @ingroup FlipFlop
*
* @brief Flip-Flop API
*/
/*
* Copyright (c) YYYY Author.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*/
#ifndef RTEMS_LIB_FLIP_FLOP_H
#define RTEMS_LIB_FLIP_FLOP_H
Include
#include <rtems.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
Ending file
** @} */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* RTEMS_LIB_FLIP_FLOP_H */
/**
* @file
*
* @ingroup FlipFlop
*
* @brief Flip-Flop implementation.
*/
/*
* Copyright (c) YYYY Author.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*/
#include <rtems/lib/flipflop.h>
static flip_flop_state current_state;
rtems_status_code flip_flop_initialize(flip_flop_state state)
{
if (current_state == START) {
current_state = state;
return RTEMS_SUCCESSFUL;
} else {
return RTEMS_INCORRECT_STATE;
}
}
rtems_status_code flip_flop_restart(void)
{
if (current_state == FLIP) {
current_state = START;
return RTEMS_SUCCESSFUL;
} else {
return RTEMS_INCORRECT_STATE;
}
}
flip_flop_state flip_flop_current_state(void)
{
return current_state;
}
rtems_status_code flip(void)
{
if (current_state == FLOP) {
current_state = FLIP;
return RTEMS_SUCCESSFUL;
} else {
return RTEMS_INCORRECT_STATE;
}
}
rtems_status_code flop(void)
{
if (current_state == FLIP) {
current_state = FLOP;
return RTEMS_SUCCESSFUL;
} else {
return RTEMS_INCORRECT_STATE;
}
}
posted on 2017-05-14 23:41 sichenzhao 阅读(99) 评论(0) 编辑 收藏 举报