c - doxygen 变量被识别为函数

标签 c doxygen 8051 sdcc

在我当前的项目中,我正在尝试使用 doxygen 生成文档。但是我有一个变量的问题。 doxygen 以某种方式将变量识别为函数。

代码:

__xdata __at (0x0F00) volatile static unsigned char Programmed; /*!< an indicator if     the board is programmed or not, during init copied from flash to xram*/

/*! 
*   The main loop that does all the magic
*   besides the "compiler startup" _sdcc_external_startup (in HWInit.c) is called to handle some "urgent" init (disabling of the watchdog)
*/
void main(void){
    unsigned short int TempUSInt;
    //init the device.
    Init_Device();

关于代码的注意事项:代码是为 SDCC compiler 编写的对于 8051 微 Controller 。 __xdata __at () 指令是一条特殊指令,因此编译器知道它必须将数据放置在预定位置(地址 0x0F00)的单独内存段(称为 XDATA)中。

我的问题是 doxygen 将 __at() 识别为函数而不是变量,因此覆盖了 main() 函数。

虽然有一些方法可以让 doxygen 忽略 __xdata __at () char Programmed 语句,但它的缺点是变量会被忽略,因此不会被记录。

那么有没有人知道如何让 doxygen 识别 __xdata __at () char Programmed 作为变量而不是函数?

最佳答案

我的策略是使用 doxygen 宏从 doxygen 中隐藏(定义为空)编译器魔术(未经测试;玩弄):

PREDEFINED = __xdata= \
             __at()=

您还可以查看有关 EXPAND_AS_DEFINED 的文档。

PS:你的操作系统真的允许 void 返回 main 吗?如果没有,您应该使用 int main(void)

关于c - doxygen 变量被识别为函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19949357/

相关文章:

c++ - 如何使用 doxygen 在 markdown 中自动创建指向 C++ 类的链接?

c - 位移位不正确?

assembly - JB在这里是做什么用的?

c - 我遇到左值错误

c - 在 Linux 内核和用户空间/MCU 之间共享代码

c - 需要解释此代码(算法)

将 C 语言转换为 MIPS 汇编语言

doxygen - 如何超链接到深Doxygen内容?

c++ - Doxygen:是否可以去除 CHM 索引中的命名空间名称?