- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
How can insert user in a driver function ?
I have understood that there was this method:
/* `#START UART_1_SPI_UART_ISR` */
/* `#END` */
But no work, what's the problem ?
Best regards
LuBe
Solved! Go to Solution.
- Labels:
-
PSoC Creator & Designer Software
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LuBe,
Thank you for sharing your project.
I downloaded your project.
I see the confusion. Cypress did not provide a "#START ... #END" means of inserting user code into the UART_1_SPI_UART_INT.c component code. (They did in the file UART_1_SCB_IRQ.c).
However they did provide a method of inserting custom user code in the UART_1_SPI_UART_ISR function. They have a means of inserting an ENTRY and/or EXIT callback.
Here is the entry callback method:
#ifdef UART_1_SPI_UART_ISR_ENTRY_CALLBACK
UART_1_SPI_UART_ISR_EntryCallback();
#endif /* UART_1_SPI_UART_ISR_ENTRY_CALLBACK */
and the exit callback:
#ifdef UART_1_SPI_UART_ISR_EXIT_CALLBACK
UART_1_SPI_UART_ISR_EXITCallback();
#endif /* UART_1_SPI_UART_ISR_EXIT_CALLBACK */
As I described in an earlier post, this is a significantly preferred method of inserting custom user code.
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LuBe,
What component were you using?
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm using the standard UART.
Best regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LuBe,
I am unable to generate component code with
/* `#START UART_1_SPI_UART_ISR` */
/* `#END` */
What configuration did you use to get this code?
Are you willing to share your project with the forum?
Generally speaking I avoid changing component generated code for three main reasons.
Reason #1
Every time I perform a Application Build phase, the components in TopDesign get regenerated.
If you keep your modified code between the #START and #END sections, your changes SHOULD BE preserved. However this is possibly not always guaranteed. If the component author eliminates this custom code section in a new version of the component, your changes are not guaranteed to be preserved.
Reason #2
If you change the instance name of the component that previously contained your custom code, this code will NOT be preserved.
Reason #3
If you perform a project or workspace "Clean" operation, your custom code is not guaranteed.
Methods to provide custom ISR code without touching the component-generated code
Method #1 - CALLBACKS
Virtually ALL component ISR code has a method to place custom code in your root directory .c file using CALLBACKS.
Consult the "Macro Callbacks" section of the datasheet to find out how to allow for ISRs to be used without altering the component code. This is preserved against all the Reasons I list above.
Method #2 - External ISRs
You can select Interrupt = "External". It will place an output connection from the UART to allow you to place a ISR component. Consult the ISR datasheet and example projects how to create ISR code without changing the component generated code.
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
it is clear that there are others solutions, but I want understand why the comments (#START #END) not work.
The module that I want change is UART_1_SPI_UART_INT.c
Best regards
LuBe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LuBe,
Thank you for sharing your project.
I downloaded your project.
I see the confusion. Cypress did not provide a "#START ... #END" means of inserting user code into the UART_1_SPI_UART_INT.c component code. (They did in the file UART_1_SCB_IRQ.c).
However they did provide a method of inserting custom user code in the UART_1_SPI_UART_ISR function. They have a means of inserting an ENTRY and/or EXIT callback.
Here is the entry callback method:
#ifdef UART_1_SPI_UART_ISR_ENTRY_CALLBACK
UART_1_SPI_UART_ISR_EntryCallback();
#endif /* UART_1_SPI_UART_ISR_ENTRY_CALLBACK */
and the exit callback:
#ifdef UART_1_SPI_UART_ISR_EXIT_CALLBACK
UART_1_SPI_UART_ISR_EXITCallback();
#endif /* UART_1_SPI_UART_ISR_EXIT_CALLBACK */
As I described in an earlier post, this is a significantly preferred method of inserting custom user code.
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can you delete my project from community (PSoC_EmEEPROM_PSoC401_LB) ?
Best regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, can someone answer to me ?
Best regards
LuBe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LuBe,
Try this:
- Select "Edit Reply" on the top right corner of the post with the code attached.
- Go to the "Drag and drop" section at the bottom of the post and select the "X" box on the file to delete.
"Engineering is an Art. The Art of Compromise."