PSOC Lesson 7 undeclared functions

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
jero_4273251
Level 1
Level 1
First like received

the Timer counter is named "Timer", the interrupt pin is named "Timer_Int"

I get several undeclared function errors for "Timer_ClearInterrupt", "Timer_Int_StartEX", and "Timer_Start"

it's like there are files not included in the project.h file

0 Likes
1 Solution
jero_4273251
Level 1
Level 1
First like received

thanks for your response Moto ... I used the Update Manager to repair PSOC4.2 and it didn't help ... then I realized I had three or four different versions of the Peripheral Driver library ... I tried to delete the older ones ... some deleted, some kinda deleted ... I retried the Counter program and it worked

View solution in original post

3 Replies
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

Are you referencing the PSoC 101 : Lesson 7 Counter ?

https://www.cypress.com/training/psoc-101-video-tutorial-series-how-use-arm-cortex-m0-based-psoc-4

If so, in the video the tutor named the TCPWM as "Counter" so you need to use name

"Counter_Int", "Counter_ClearInterrupt", "Counter_Int_StartEx" and "Counter_Start"

Although I agree with you that "Timer" sounds better fit for the application,

since the class of the component is "Timer Counter", there may be conflict(s) with the name "Timer"

So I imagine that the tutor chose name "Counter" (which makes less sense though)

I tried this again with CY8CKIT-042 (it's been a few years...)

At least, using the name "Counter", the project seems to be working.

schematic

000-schematic.JPG

pins

001-pins.JPG

main.c

=====================

#include "project.h"

CY_ISR( Counter_Int_Handler )

{

    Pin_Green_Write( ~ Pin_Green_Read() ) ;

   

    Counter_ClearInterrupt( Counter_INTR_MASK_TC ) ;

}

int main(void)

{

    CyGlobalIntEnable; /* Enable global interrupts. */

   

    Counter_Start() ;

    Counter_Int_StartEx( Counter_Int_Handler ) ;

    for(;;)

    {

        /* Place your application code here. */

    }

}

=====================

moto

0 Likes
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

After posting my previous response, I wondered if the name "Timer" is really bad?

So I modified the schematic as

002-schematic.JPG

and main.c as

=============

#include "project.h"

CY_ISR( Counter_Int_Handler )

{

    Pin_Green_Write( ~ Pin_Green_Read() ) ;

  

    Timer_ClearInterrupt( Timer_INTR_MASK_TC ) ;

}

int main(void)

{

    CyGlobalIntEnable; /* Enable global interrupts. */

  

    Timer_Start() ;

    Timer_Int_StartEx( Counter_Int_Handler ) ;

    for(;;)

    {

        /* Place your application code here. */

    }

}

=============

Then the project could be compiled without error and the project seems to be working fine.

So, I'm afraid that there must have been some spelling miss or your component might have been named as  "Timer_1" or something like that.

moto

0 Likes
jero_4273251
Level 1
Level 1
First like received

thanks for your response Moto ... I used the Update Manager to repair PSOC4.2 and it didn't help ... then I realized I had three or four different versions of the Peripheral Driver library ... I tried to delete the older ones ... some deleted, some kinda deleted ... I retried the Counter program and it worked