Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

本实验介绍如何创建一个新项目工程,这里以新建gpio项目工程为例,如下:

在IDE 环境中如下图所示,选择sp7021工程名,单击鼠标右键在弹出的菜单中选Copy

...

接下来再次选择sp7021工程名This experiment introduces how to create a new project. Here we take the new gpio project as an example, as follows:

In the IDE environment, as shown below, select the sp7021 project name, click the right mouse button and select Copy in the pop-up menu

...

Next, select the sp7021 project name again;

 

...

单击鼠标右键在弹出的菜单中选Paste,出现下图

...

在Project name框中填写gpio,完成gpio 项目工程名及目录建立,如下图所示

...

接下来可看到gpio项目工程已在安装目录Click the right mouse button and select Paste in the pop-up menu, the following picture appears

...

Fill in gpio in the Project name box to complete the gpio project project name and directory creation, as shown below

...

Next, you can see that the gpio project has been installed in the installation directory \SP7021\workspace\ gpio,用户可根据自己得需要修改. Users can modify the main.c file in the \SP7021\workspace\gpio文件夹下的main.c文件;比如我们想在main.c中实现:

1:关闭定时器中断

2:在while(1)中打印printf(gpio folder according to their needs:

1:Turn off timer interrupt

2:Print printf ("gpio new project test \ n") in while (1)

修改main.c如下;Modify main.c as follows;

int main(void)

{

    printf("Build @%s, %s\n", __DATE__, __TIME__);

    hw_init();

    sys_init();

    disp_hdmi_init();

    //timer_test_init();/*interrupt test api */

    sp_interrupt_setup(); /* interrupt manager module init */

    while(1)

    {

        printf("gpio new project test \n");

    }

}

若还需增加项目相关得其它文件,*.c文件放到If you need to add other files related to the project, * .c files are placed in the \SP7021\workspace\gpio\ testapi\util 文件夹下;folder; * .h文件放到h files are placed in the \SP7021\workspace\gpio\include\util文件夹下; 下面举例新建gpio.c文件的方法:

按下图所示,鼠标选中红框1,接着点击鼠标右键出现下拉菜单,然后选中红框2,接着选中红框3;

...

在弹出的下图中,在红框中输入gpio.c,

...

这样就在util folder; Here is an example of how to create a new gpio.c file:

As shown in the figure below, the mouse selects the red box 1, then clicks the right mouse button to display a drop-down menu, then selects the red box 2, then selects the red box 3

...

In the following picture that pops up, enter gpio.c in the red box,

...

In this way, a new gpio.c file is created in the \SP7021\workspace\gpio\testapi\util文件夹下新建了gpio.c文件;util folder;

...

同理可在Similarly, new gpio.h can be created in the \SP7021\workspace\gpio\include\util文件夹下新建gpio.hutil folder