3 Replies Latest reply on Jan 21, 2020 5:33 PM by jero_4273251

    PSOC Lesson 7 undeclared functions

    jero_4273251

      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

        • 1. Re: PSOC Lesson 7 undeclared functions
          MoTa_728816

          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

          • 2. Re: PSOC Lesson 7 undeclared functions
            MoTa_728816

            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

            • 3. Re: PSOC Lesson 7 undeclared functions
              jero_4273251

              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