How to add new files / folders?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to add new files / folders?

3,061 Views
application_ninja
Contributor IV

I want to add new files and folders to be compiled into a GUI Guider simulator project, but it seems that there is no way to do this, and that "custom.c" is all we can use?

0 Kudos
Reply
9 Replies

3,005 Views
paolog
Contributor III

Hi @application_ninja ,

create .c files in "custom" folder with your favorite editor and they will be built with your application (custom.mk takes care of it).

 

Best regards,

 

Paolo

0 Kudos
Reply

3,003 Views
application_ninja
Contributor IV

I've tried this, I want to add folders, not just .c files. Adding folders doesn't work.

0 Kudos
Reply

2,999 Views
paolog
Contributor III

You should then modify the custom.mk makefile file to build subfolders too.

0 Kudos
Reply

2,991 Views
application_ninja
Contributor IV

My question is how to use the IDE, not outside the IDE. Anyone can manually manipulate the "make" files to compile whatever they need, but I want to use the IDE to build an interface with sub-folders / files / structure, etc...

0 Kudos
Reply

2,960 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

This is AE reply:

You have two application scenarios to add your custom code in GUI Guider.

    1. For example, there is a screen named scrHome in you design. You want to add some initialization code when this screen is initialized. You can do it like this

xiangjun_rong_0-1698291274420.png

 

then you reopen or update your project, you can see the new code are all added to the project like this:

xiangjun_rong_1-1698291317793.png

 

2. For example, you have a button and you hope when this button is clicked, you can execute your custom code. You can do it like this:

1.Place a button in the editor

2.Add a clicked event

3. Add your code with method described in scenario 1, your code will be added into the event handler

4. If your code in event handler has a function call, you can implement it in custom.c located in the custom folder, certainly, you can create your own file and placed into custom folder.

However, the current version, 1.6.1, GUI Guider doesn't support subfolder. Subfolder will be supported in 1.7.1.

 

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply

2,956 Views
application_ninja
Contributor IV

OK, thank you for the response, looks like I have to wait until version 1.7.1 to fully use GUI Guider as I'd like to.

0 Kudos
Reply

2,944 Views
zhenhualuo
NXP Employee
NXP Employee

Hi @application_ninja,

Thanks for your question and comments

Below is the workaround for subfolder support based on GUI Guider v1.6.1.

1. create "src" subfolder in "custom" folder

2. add source files, e.g. "mytest.c" and "mytest.h"

3. add "src.mk" in "src“ folder, the following is the content of src.mk

GEN_CSRCS += $(notdir $(wildcard $(PRJ_DIR)/custom/src/*.c))

DEPPATH += --dep-path $(PRJ_DIR)/custom/src

VPATH += :$(PRJ_DIR)/custom/src

CFLAGS += "-I$(PRJ_DIR)/custom/src"

4. edit "custom.mk" to add "include $(PRJ_DIR)/custom/src/src.mk"

## SPDX-License-Identifier: MIT
## Copyright 2020 NXP

include $(PRJ_DIR)/custom/src/src.mk

GEN_CSRCS += $(notdir $(wildcard $(PRJ_DIR)/custom/*.c))

DEPPATH += --dep-path $(PRJ_DIR)/custom
VPATH += :$(PRJ_DIR)/custom

CFLAGS += "-I$(PRJ_DIR)/custom"

Then the newly added source files in subfolder will be included and built.

 

Best Regards,

Zhenhua

0 Kudos
Reply

3,032 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that the simulator compiles the code in custom.c, whether the customer.c will be overwritten by simulator is dependent on the version of GUI guider.

I will ask the AE team for detailed information.

BR

XiangJun Rong

0 Kudos
Reply

3,010 Views
application_ninja
Contributor IV

Thank you for the response, urgently looking for a response if additional files could be added to GUI Guider project rather than only using custom.c...

0 Kudos
Reply