|
Hi,
I am sure I am opening the xc-1a. Here is the code generated by the wizard for the concurrent led project, as you can see it is for the xc-1a. However the previous errors pointed out are there.
/* ============================================================================ Name : xc1a-concurrent-led.xc Description : Illuminate multiple LEDs concurrently on the XC-1A board ============================================================================ */
#include <platform.h> #define PERIOD 20000000
out port cled0 = PORT_CLOCKLED_0; out port cled1 = PORT_CLOCKLED_1; out port cled2 = PORT_CLOCKLED_2; out port cled3 = PORT_CLOCKLED_3; out port cledG = PORT_CLOCKLED_SELG; out port cledR = PORT_CLOCKLED_SELR;
void flashLED (out port led, int period);
int main (void) { par { on stdcore [0]: { cledG <: 1; flashLED (cled0 , PERIOD); } on stdcore [1]: flashLED (cled1, PERIOD); on stdcore [2]: flashLED (cled2, PERIOD); on stdcore [3]: flashLED (cled3, PERIOD); } return 0; }
Here is the code that I copied from the last post that is supposed to work, but only works once and does not continue.
/* ============================================================================ Name : xc1a-concurrent-led.xc Description : Illuminate multiple LEDs concurrently on the XC-1A board ============================================================================ */ #include <platform.h> #define PERIOD 100000000 #define PERIODA 20000000 #define PERIODB 300000000 #define PERIODC 400000000
on stdcore [0] : out port cled0 = PORT_CLOCKLED_0; on stdcore [1] : out port cled1 = PORT_CLOCKLED_1; on stdcore [2] : out port cled2 = PORT_CLOCKLED_2; on stdcore [3] : out port cled3 = PORT_CLOCKLED_3; on stdcore [0] : out port cledG = PORT_CLOCKLED_SELG; on stdcore [0] : out port cledR = PORT_CLOCKLED_SELR;
void flashLED (out port led, int timeout){ timer tmr; unsigned t; unsigned isOn = 0b01110000; while(1){ tmr :> t; led <: isOn; t += timeout; tmr when timerafter (t) :> void; isOn = !isOn; } }
int main (void) { par { on stdcore [0]: { cledR <: 1; flashLED (cled0 , PERIOD); } on stdcore [1]: flashLED (cled1, PERIODA); on stdcore [2]: flashLED (cled2, PERIODB); on stdcore [3]: flashLED (cled3, PERIODC); } return 0; }
Again any help from anyone would be appreciated. It looks like it should work... Also would like answers to the other questions I posted previously.
Thanks.
|