静态函数函数调用

2019-07-20 22:43发布

首先  在led.h中定义
typedef struct
{
  void (*plf_test_led) (void);
}
LED_TypeDef;

然后在led.c中定义
LED_TypeDef LED_VOP=
{
    test_led
};
然后在led.c中写了一个函数
static void test_led(void)
这是一个静态的函数

然后在main.c中写
LED_VOP.plf_test_led();

然后就调用了上面的那个静态函数,没有问题。
但是完全不明白为什么要这样写函数……

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。