This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

问一个基础问题:MAP_IntMasterEnable()这类函数,不加MAP_和加上有啥区别?

Other Parts Discussed in Thread: CC3200

问一个基础问题:MAP_IntMasterEnable()这类函数,不加MAP_和加上有啥区别?

  • 在rom_map.h中通过宏定义方式等价替换:

    #define MAP_IntUnregister \
    IntUnregister

    加不加MAP是等效的。

  • 非常感谢您的回答

    不过作为初学者,我对"MAP"的含义依然有所疑惑。

    在rom_map.h里完整的代码是这样的:

    ------------------

    #ifdef ROM_IntUnregister
    #define MAP_IntUnregister \
    ROM_IntUnregister
    #else
    #define MAP_IntUnregister \
    IntUnregister
    #endif

    -------------------

    在需要用到ROM API时,把MAP_IntUnregister转换为ROM_IntUnregister

    否则把MAP_IntUnregister转换为IntUnregister,也就是RAM API

    因此我猜测加上MAP_可以理解为根据实际需要对API进行映射

    不知道这样理解对不对

  • CC3200 在内部ROM中驻留了外设的驱动函数,用户程序既可以使用ROM中的驱动函数,也可用外部库的函数。使用ROM中的驱动函数可以缩小用户代码的体积。