3.3.1 New project construction
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;
Â
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 folder according to their needs:
1:Turn off timer interrupt
2:Print printf ("gpio new project test \ n") in while (1)
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");
   }
}
If you need to add other files related to the project, * .c files are placed in the \SP7021\workspace\gpio\ testapi\util folder; * .h files are placed in the \SP7021\workspace\gpio\include\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 folder;
Similarly, new gpio.h can be created in the \SP7021\workspace\gpio\include\util folder