energia / msp432-core

MSP432 Core and Framework
14 stars 10 forks source link

Undefined References for GateTask #25

Closed robertinant closed 7 years ago

robertinant commented 8 years ago

From @rei-vilo on June 22, 2015 8:14

When exploring the implementation of the GateTasks, both embedXcode and Energia raise errors about undefined references.

sketch_jun20a.obj: In function ti_sysbios_gates_GateTask_Params_init': /Applications/IDE/Energia.app/Contents/Resources/Java/hardware/common/ti/sysbios/gates/GateTask.h:353: undefined reference toti_sysbios_gates_GateTask_Paramsinit(void) static' sketch_jun20a.obj: In function begin()': /privatesketch_jun20a.ino:17: undefined reference toti_sysbios_gates_GateTask_create' sketch_jun20a.obj: In function enter()': /privatesketch_jun20a.ino:22: undefined reference toti_sysbios_gates_GateTask_enterE' sketch_jun20a.obj: In function leave()': /privatesketch_jun20a.ino:27: undefined reference toti_sysbios_gates_GateTask_leave__E' collect2: error: ld returned 1 exit status make: *\ [sketch_jun20a.cpp.elf] Error 1

Here's the code for Energia:

#include <Energia.h>
#include <xdc/runtime/Error.h>
#include <ti/sysbios/gates/GateTask.h>
#include <ti/sysbios/BIOS.h>

    GateTask_Handle GateTaskHandle;
    IArg GateTask_key;

void begin()
{
    Error_Block eb;
    Error_init(&eb);

    GateTask_Params params;
    GateTask_Params_init(&params);
    GateTaskHandle = GateTask_create(&params, &eb);
}

void enter()
{
    GateTask_key = GateTask_enter(GateTaskHandle);
}

void leave()
{
    GateTask_leave(GateTaskHandle, GateTask_key);
}

void setup()
{
  // put your setup code here, to run once:
  begin();
}

void loop()
{
  // put your main code here, to run repeatedly:
  enter();
  leave();
}

Copied from original issue: energia/Energia#637

robertinant commented 7 years ago

GateTaks is a very advanced feature and can lead to fatal thread behavior if not used properly hence we decided not to include.