Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
公告
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

how can i include fun.c in nios

Altera_Forum
名誉分销商 II
1,517 次查看

hi everyone  

i put some functions in fun.c, try to make the main.c easy to read. 

how can i include fun.c in main.c? where should i put the fun.c? 

i tried to put it in the bsp floder, but the eclipse build the project with many errors# include "alt_types.h" 

//#include "altera_avalon_pio_regs.h"# include <io.h># include "sys/alt_irq.h"# include "system.h"# include <stdio.h># include <unistd.h># include "timer_fun.c" // this is my own fun# include "ft245_driver_fun.c" // this is my own fun# include "biss_driver_fun.c" // this is my own fun
0 项奖励
4 回复数
Altera_Forum
名誉分销商 II
743 次查看

Print the code in a paper, then paste into the Nios package with a sticker

0 项奖励
Altera_Forum
名誉分销商 II
743 次查看

If you are asking a question so basic, you need to read up on the NIOS software development process. There are several intro documents on the Altera website.

0 项奖励
Altera_Forum
名誉分销商 II
743 次查看

You can include that into your app folder instead. You can run the command to update the makefile "nios2-app-update-makefile --add-src-files <filenames>"

0 项奖励
Altera_Forum
名誉分销商 II
743 次查看

alternately, you may consider to glue the file printed on the paper straight to the ground, this is called include as well.

0 项奖励
回复