I received my startKit last wednesday an fired up xTimecomposer friday evening.
The compiling/running the examples went without trouble.
Next thing I liked to do is start my own project. Parallel tasks included.
This is; let a LED blink on core 0 and another LED on core 1.
Unfortunately the xTIMEcomposer complaisn about
../src/test_app3.xc: In function `main':
../src/test_app3.xc:20: error: statement placed on a core must be call to combinable function
../src/test_app3.xc:21: error: statement placed on a core must be call to combinable function
xmake[1]: *** [.build_Debug/src/test_app3.xc.o] Error 1
xmake: *** [bin/Debug/test_app3_Debug.xe] Error 2
here is the code:
Code: Select all
#include <stdio.h>
#include <xs1.h>
#include <platform.h>
#include <print.h>
#include "task1.h"
#include "task2.h"
int main()
{
par {
on tile[0].core[0]: task1();
on tile[0].core[1]: task2();
}
return 0;
}
Code: Select all
#include <xs1.h>
#include <timer.h>
port p = XS1_PORT_1A;
[[combinable]]
void task1()
{
while (1)
{
select
{
p <: 0;
delay_milliseconds(200);
p <: 1;
delay_milliseconds(200);
}
}
}
Code: Select all
#include <xs1.h>
#include <timer.h>
port p2 = XS1_PORT_4A;
[[combinable]]
void task2()
{
while (1)
{
p2 <: 0;
delay_milliseconds(200);
p2 <: 1;
delay_milliseconds(200);
}
}
best regards
Simon