
6.3 User task for own C/C++ Programs
To simplify the start into the C/C++ programming world on the Marvin Robot and his Real Time Operating
System (FreeRTOS), a special “User Task” has been created which works similar to the “main()” function
and without influencing the rest of the software system.
6.3.1 C++ code - example
In the files user_code.h and user_code.cpp you will find basic definitions which are required to run a simple
“Hello World!” program which will be “printed” on the virtual display in the browser.
For own more complex program you have to add the resources (lib-files) and the C++ code as well.
Hint:
If you want to use iRP with your modified C++ code then you have to exchange the
“irpapi” file in the folder “web” on the SD-Card!
This API file will be generated automatically while executing “make” and can be found
in the following path or folder “./irp/irpapi”.
6.3.2 user_code.h file
Example h++ file.
#pragma once
#include "virtualDisplay.h"
// TODO: add required includes here
class
user_code
{
public
:
// Fully static class.
// Delete all constructors and destructors
user_code() =
delete
;
user_code(
const
user_code&) =
delete
;
user_code(user_code&&) =
delete
;
~user_code() =
delete
;
static void
Task(
void
* pContext);
private
:
// TODO: add your declarations here
};
AREXX Engineering & JM³ Engineering
Version: 1.3.1
October 27, 2017
Page: 49