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.

[参考译文] RTOS/MSP432p401r:如何使用cfg文件中定义的事件?

Guru**** 2609955 points
Other Parts Discussed in Thread: SYSBIOS

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/661287/rtos-msp432p401r-how-do-i-use-an-event-defined-in-cfg-file

部件号:MSP432P401R
“Thread:SysBIOS”中讨论的其它部件

工具/软件:TI-RTOS

您好,

我在cfg文件中定义了以下事件:

var event0Params = new Event.Params();
event0Params.instance.name ="背景活动";
program.globe.backgroundEvent = event.creation(event0Params);

使用我的BackgroundEvent需要包含哪些头文件?

我已经在源代码中包含了以下文件,但仍收到编译器错误。

#include <XDC/std.h>
#include <XDC/runtime / Error.h>
#include <XDC/runtime /System.h>

#include <ti/SysBIOS/BIOS.h>
#include <ti/SysBIOS/KNL/Clock.h>
#include <ti/SysBIOS/KNL/Event.h>

void *mainThread(void *arg0)

  UINT事件;

  Events = Event_Pend (BackgroundEvent,Event_ID_none,Event_ID_01 + Event_ID_02,BIOS_WAIT_Forever);

}

>>编译失败
src/subdir_rules.mk:30:目标'src/background.obj'的配方失败
"../src/background.c",第84行:错误#20:标识符"backgroundEvent"未定义
"../src/background.c",第113行:错误#20:标识符"backgroundEvent"未定义
编译"../src/background.c"时检测到2个错误。
gmake:***[src/background.obj]错误1
gmake:由于错误,目标'all'没有重制。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    你好Jeffrey:

    错误似乎是编译器无法在backgroundEvent文件或background.c文件中包括的任何头文件中找到"backgroundEvent"的声明。

    解决此问题的一种方法是将函数"backgroundEvent"的定义包含在头文件中,并将该头文件包含在"background.c"文件中。

    谢谢!
    SAI