Hercules DIY 五:对中断的疑感 按照计划这周应是解决程序,由于我的项目是报警器我想用管脚中断最好,但是我找遍了例程,也没看到一个中断的例程。
而我想让管脚中断,在HAL里已经设完并生成代码。但我用仿真无论如何也进入不了中断。而且生产的中断函数的定义让我感到疑感
我的主函数如下:
/* Include Files */
#include "sys_common.h"
#include "system.h"
/* USER CODE BEGIN (1) */
/* USER CODE BEGIN (1) */
#include "gio.h"
#include "het.h"
/* USER CODE END */
/** @fn void main(void)
* @brief Application main function
* @NOTE This function is empty by default.
*
* This function is called after startup.
* The user can use this function to implement the application.
*/
/* USER CODE BEGIN (2) */
/* USER CODE END */
void main(void)
{
/* USER CODE BEGIN (3) */
gioInit();
gioEnableNotification(1);
_enable_IRQ();
while(1);
/* USER CODE END */
}
生成的中断函数如下:
/** @file notification.c
* @brief User Notification Definition File
* @date 15.Aug.2012
* @version 03.01.02
*
* This file defines empty notification routines to avoid
* linker errors, Driver expects user to define the notification.
* The user needs to either remove this file and use their custom
* notification function or place their code sequence in this file
* between the provided USER CODE BEGIN and USER CODE END.
*
*/
/* Include Files */
#include "esm.h"
#include "gio.h"
#include "het.h"
/* USER CODE BEGIN (0) */
/* USER CODE END */
void esmGroup1Notification(uint32_t channel)
{
/* enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (1) */
/* USER CODE END */
}
/* USER CODE BEGIN (2) */
/* USER CODE END */
void esmGroup2Notification(uint32_t channel)
{
/* enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (3) */
/* USER CODE END */
}
/* USER CODE BEGIN (4) */
/* USER CODE END */
void gioNotification(int bit)
{
/* enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (13) */
return;
/* USER CODE END */
}
/* USER CODE BEGIN (14) */
/* USER CODE END */
void pwmNotification(unsigned pwm, unsigned notification)
{
/* enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (23) */
/* USER CODE END */
}
/* USER CODE BEGIN (24) */
/* USER CODE END */
void edgeNotification(unsigned edge)
{
/* enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (25) */
return;
/* USER CODE END */
}
/* USER CODE BEGIN (26) */
/* USER CODE END */
void hetNotification(hetBASE_t *het, uint32_t offset)
{
/* enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (27) */
return;
/* USER CODE END */
}
/* USER CODE BEGIN (28) */
/* USER CODE END */
/* USER CODE BEGIN (29) */
/* USER CODE END */
我在中断函数里打个断点但无论如何也进不去。大家遇到过中断的问题么???
这个后来解决了,确实是因为图形配置时没有配全。 |