Announcements

Equip yourself to optimize PSoc4 MCUs for Evs at the EV Webinar. Click here to register.

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

PSoC™ 4 Forum Discussions

Dave_Long
Level 3
Level 3
10 replies posted 10 questions asked 10 sign-ins

Hi:

   I used the Psoc4 to BLDC motor Driver,have to add some custom code to close the motor in the CY_ISR(IntDefaultHandler).However once  rebuild the project ,the code will be removed.What can I do to prevent the code is deleted by the building operation.

0 Likes
1 Solution
LinglingG_46
Moderator
Moderator
Moderator
10 questions asked 5 questions asked 250 sign-ins

找到cyapicallbacks.h, 申明一下callback函数。

#ifndef CYAPICALLBACKS_H
#define CYAPICALLBACKS_H
   

    /*Define your macro callbacks here */
    /*For more information, refer to the Writing Code topic in the PSoC Creator Help.*/
#ifndef CY_BOOT_INT_DEFAULT_HANDLER_ENOMEM_EXCEPTION_CALLBACK
    #define CY_BOOT_INT_DEFAULT_HANDLER_ENOMEM_EXCEPTION_CALLBACK
    void  CyBoot_IntDefaultHandler_Enomem_Exception_Callback(void);
#endif
   
   
#endif /* CYAPICALLBACKS_H */  
/* [] */

然后在mian.c里面定义一下下面这个函数:

void  CyBoot_IntDefaultHandler_Enomem_Exception_Callback()
{

}

重点:: 也许你不是要把自己的函数写到这个中断回调函数里面,但是方法是一样的。

View solution in original post

0 Likes
1 Reply
LinglingG_46
Moderator
Moderator
Moderator
10 questions asked 5 questions asked 250 sign-ins

找到cyapicallbacks.h, 申明一下callback函数。

#ifndef CYAPICALLBACKS_H
#define CYAPICALLBACKS_H
   

    /*Define your macro callbacks here */
    /*For more information, refer to the Writing Code topic in the PSoC Creator Help.*/
#ifndef CY_BOOT_INT_DEFAULT_HANDLER_ENOMEM_EXCEPTION_CALLBACK
    #define CY_BOOT_INT_DEFAULT_HANDLER_ENOMEM_EXCEPTION_CALLBACK
    void  CyBoot_IntDefaultHandler_Enomem_Exception_Callback(void);
#endif
   
   
#endif /* CYAPICALLBACKS_H */  
/* [] */

然后在mian.c里面定义一下下面这个函数:

void  CyBoot_IntDefaultHandler_Enomem_Exception_Callback()
{

}

重点:: 也许你不是要把自己的函数写到这个中断回调函数里面,但是方法是一样的。

0 Likes