start e-program in the subfunction

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

start e-program in the subfunction

Postby howardhh » Mon Oct 13, 2014 1:33 am

Hi all,

Is there any difference between subfunction and main function, when I want to start the e-program.

Because in my program, I initialize the epiphany device in the main function, load the program into the cores in the main functionm, but I start the device in sub-function.
In this case, seems the e-program isn't executed.
While in the example program "dotproduct", it has no subfunction, and it works fine.

Does this mean I have to put all code in the main function?

Could you give me any advice? Thank you!
howardhh
 
Posts: 28
Joined: Fri Aug 22, 2014 1:50 am

Re: start e-program in the subfunction

Postby sebraa » Mon Oct 20, 2014 1:03 pm

Every C program starts in main() (excluding the magic behind the scene). So this function is where you put your code. If you want to write your code in different functions - and please do it to keep your code clean and readable - you have to call those functions yourself to run the code.

If you are not familiar with the C language, you probably want to start using it on the computer first. Then do the Epiphany details later.
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 10 guests

cron