| Version 1 (modified by , 19 years ago) (diff) |
|---|
Hello World
Hello world is the basic useless example. It tends to prove you have a complete working setup.
This example will print "Hello world !" message infinitely repeated (due tu DsxThreads?).
Task
First we will create our task and declare it.
hello.c:
#include <dsx.h>
#include "hello_proto.h"
FUNC(hello) {
dsx_log_printf(NONE, "Hello world!\n");
}
Task description in dsx's API:
hello_task = TaskModel(
'hello',
impl = [
SwTask('hello', stack_size = 128, sources = ['hello.c'])
] )
Test under Posix
Let's create a task graph containing only this one.
tcg = Tcg( Task('hello', hello_task)
)
And let's create Posix test application (and also a TopMakefile):
px = Posix() tcg.generate(px) TopMakefile(px)
Now we can compile and launch it.
$ make [...] $ ./exe.posix Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! ^C $
It works !
