Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Combining 2 application c files: NIOS II

Status
Not open for further replies.

beginner_EDA

Full Member level 4
Joined
Aug 14, 2013
Messages
191
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
3,854
Hi,
For my application(UDP in FPGA) I have 2 c files (one for Stack having one main and another for application like setting MAC, IP, UDP, etc. manually and it also have separte main()) which works perfectly but have to program FPGA 2 times.

I would like to combines both c files together so that I can store it into Flash and and change only hardware part as per need.
But I don't know how to combine 2 c files.

Normally one declare a separate function for one of the main() and include its header to another main().
I tried this way but then it doesn't work but Separately(2 times) it works.

Any idea how to combine in a workable way?

P.S. In attachment the files (prbs_packet_generator.c, prbs_packet_generator_regs.h, udp_payload_inserter_regs.h) have one main and others files have another main.
 

Attachments

  • c files.7z
    19.1 KB · Views: 39

i can see one main in 'iniche_init.c'.

you can combine this to your orig "prbs***.c"
but the flow is not suitable.

your iniche_init.c has OSStart() and while(1) which is infinite loop.

so combining them ,
how will you treat the while(1) in "prbs*.c" file.

a solution is there only when you remove one of the while() , probably in the iniche_init.c

you must tell which one .
 
Last edited:

a solution is there only when you remove one of the while() , probably in the iniche_init.c

you must tell which one .

If I remove while() from inich_init.c, I think it(the stack part) stops working then.
How do you think?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top