/* Main generated for Simulink Real-Time model control_vectorial */
#include <ModelInfo.hpp>
#include <utilities.hpp>
#include "control_vectorial.h"
#include "rte_control_vectorial_parameters.h"

/* Task wrapper function definitions */
void control_vectorial_Task1(void)
{ 
    control_vectorial_step0();
} 
void control_vectorial_Task2(void)
{ 
    control_vectorial_step2();
} 
/* Task descriptors */
slrealtime::TaskInfo task_1( 0u, std::bind(control_vectorial_Task1), slrealtime::TaskInfo::PERIODIC, 5e-05, 0, 40);
slrealtime::TaskInfo task_2( 1u, std::bind(control_vectorial_Task2), slrealtime::TaskInfo::PERIODIC, 0.0001, 0, 39);

/* Executable base address for XCP */
#ifdef __linux__
extern char __executable_start;
static uintptr_t const base_address = reinterpret_cast<uintptr_t>(&__executable_start);
#else
/* Set 0 as placeholder, to be parsed later from /proc filesystem */
static uintptr_t const base_address = 0;
#endif

/* Model descriptor */
slrealtime::ModelInfo control_vectorial_Info =
{
    "control_vectorial",
    control_vectorial_initialize,
    control_vectorial_terminate,
    []()->char const*& { return control_vectorial_M->errorStatus; },
    []()->unsigned char& { return control_vectorial_M->Timing.stopRequestedFlag; },
    { task_1, task_2 },
    slrealtime::getSegmentVector()
};

int main(int argc, char *argv[]) {
    slrealtime::BaseAddress::set(base_address);
    return slrealtime::runModel(argc, argv, control_vectorial_Info);
}
