beginner_EDA
Full Member level 4
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.
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.