How can we assign pin output from .c file?
As the <: syntax is not available.
as well as 'port' / 'on tile[]'
assign output from C? Topic is solved
-
- Member++
- Posts: 29
- Joined: Wed Jul 04, 2018 4:06 pm
-
- XCore Legend
- Posts: 1913
- Joined: Thu Jun 10, 2010 11:43 am
Hi. Rename your source code file to .xc and try again.
Which hardware kit are you using for this testing?
Which port pins are you attempting to drive with an output?
You can review the following:
http://www.xcore.com/viewtopic.php?f=3& ... led#p31562
if using the XCORE Audio board. Hope this helps.
Which hardware kit are you using for this testing?
Which port pins are you attempting to drive with an output?
You can review the following:
http://www.xcore.com/viewtopic.php?f=3& ... led#p31562
if using the XCORE Audio board. Hope this helps.
-
- Member++
- Posts: 29
- Joined: Wed Jul 04, 2018 4:06 pm
What I have found out that if I use a global variable between XC, and C by using extern keyword..
The variable end-up in a different address somehow(found this while debugging).
I have wrote an interface that would change the LEDs based on this value.
Since it's not the in the same address, the change in the value in C does not effect the one in XC.
I was desperate enough to try to change the LEDs directly from C file.. which is the part of the module_usb_audio > endpoint0 > endpoint0.c
I'm using the XCORE Audio board.. I'll dig into your thread tomorrow.
For those ran into this thread look for a way to interact between XC and C file.
you might find this useful.
http://www.xcore.com/viewtopic.php?t=1721
The variable end-up in a different address somehow(found this while debugging).
I have wrote an interface that would change the LEDs based on this value.
Since it's not the in the same address, the change in the value in C does not effect the one in XC.
I was desperate enough to try to change the LEDs directly from C file.. which is the part of the module_usb_audio > endpoint0 > endpoint0.c
I'm using the XCORE Audio board.. I'll dig into your thread tomorrow.
For those ran into this thread look for a way to interact between XC and C file.
you might find this useful.
http://www.xcore.com/viewtopic.php?t=1721
-
- XCore Expert
- Posts: 573
- Joined: Thu Nov 26, 2015 11:47 pm
If you can rewrite your code in XC or make an XC wrapper for your C code I think you will be happier in the long run. Maybe your XC code can call a C function that returns the LED state or something, rather than using a global variable to talk between XC and C.