I've defined the output port,
Code: Select all
#include "xs1.h"
#include "platform.h"
#include "gpio.h"
unsigned short data[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
on tile[0] : out port explorer_outs = XS1_PORT_16A;
on tile[0] : in port explorer_butts = XS1_PORT_4E
[[combinable]]
void xCoreDriveOutputs(unsigned short *data, int n, out port oPort, client input_gpio_if butt) {
int i;
unsigned value = 1;
while (1) {
seleect {
case butt.event():
phPort <: value;
delay_microseconds(5);
for (i = 0; i < n; i++) {
value = ((data[i] << 1) | 0x01);
phPort <: value;
value &= ~((unsigned)0x01);
phPort <: value;
}
break;
}
}
}
int main() {
input_gpio_if i_explore_butts[2];
output_gpio_if i_explore_outs[16];
par
{
on tile[0] : input_gpio_with_events(i_explore_butts, 2, explorer_butts, null);
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
on tile[0] : xCoreDriveOutputs(data, 10, explorer_outs, i_explore_butts[0]);
}
return 0;
}
Code: Select all
12:15:37 **** Incremental Build of configuration Default for project AN00190_Getting_started_with_xTIMEcomposer_Studio ****
xmake CONFIG=Default all
Checking build modules
Using build modules: lib_gpio(1.0.1) lib_xassert(2.0.1)
Analyzing main.xc
../src/main.xc:158:5: error: use of `explorer_outs' violates parallel usage rules
par
^~~
../src/main.xc:165:65: note: violation occurs here
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~
../src/main.xc:168:47: note: violation occurs here
explorer_printhead,
^~~~~~~~~~~~~~~~~~
../src/main.xc:160:45: warning: `i_explore_butts' not used in two parallel statements (byte range 4..8)
on tile[0] : input_gpio_with_events(i_explore_butts, 2, explorer_buttons, null);
^~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 0..4)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 4..8)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 8..12)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 12..16)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 16..20)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 20..24)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 24..28)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 28..32)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 32..36)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 36..40)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 40..44)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 44..48)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 48..52)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 52..56)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 56..60)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
../src/main.xc:165:34: warning: `i_explore_outs' not used in two parallel statements (byte range 60..64)
on tile[0] : output_gpio(i_explore_outs, 16, explorer_outs, null);
^~~~~~~~~~~~~~~~~~~~~~~~~
xmake[1]: *** [.build/src//main.xc.pca.xml] Error 1
xmake: *** [analyze] Error 2
12:15:38 Build Finished (took 1s.555ms)